| The Gaudi Framework v32r1 (f65d50dc)

PoolClasses.h
Go to the documentation of this file.
1
2 // The following two classes are the interfaces to facilitate reading POOL formatted ROOT files:
3 #include "GaudiKernel/Kernel.h" // GAUDI_API
4 #include <string>
5 #include <utility>
6 #include <vector>
7
8 /*
9 * POOL namespace declaration
10 */
11 namespace pool {
12 class Guid { // size is 16
13 public:
14 unsigned int Data1;
15 unsigned short Data2;
16 unsigned short Data3;
17 unsigned char Data4[8];
18 };
24 class Token {
25 public:
26 int m_refCount;
27 int m_technology;
28 std::string m_dbID;
29 std::string m_cntID;
30 Guid m_classID;
31 std::pair<int, int> m_oid;
32 int m_type;
33 public:
34 Token() = default;
35 virtual ~Token() = default;
36 bool operator==( const Token& t ) const { return m_oid.first == t.m_oid.first && m_oid.second == t.m_oid.second; }
37 };
38 } // namespace pool
39
45 struct UCharDbArray {
46 public:
48 int m_size = 0;
50 unsigned char* m_buffer = nullptr; //[m_size]
52 UCharDbArray() = default;
54 virtual ~UCharDbArray() {
55 if ( m_buffer ) delete[] m_buffer;
56 m_buffer = nullptr;
57 }
58 };
59
67 class PoolDbTokenWrap {
68 public:
70 pool::Token token;
72 PoolDbTokenWrap() = default;
74 PoolDbTokenWrap( const PoolDbTokenWrap& wrp ) { token = wrp.token; }
76 virtual ~PoolDbTokenWrap() = default;
78 bool operator==( const PoolDbTokenWrap& c ) const { return token == c.token; }
80 PoolDbTokenWrap& operator=( const PoolDbTokenWrap& wrp ) {
81 if ( this != &wrp ) token = wrp.token;
82 return *this;
83 }
84 };
85
94 class GAUDI_API PoolDbLinkManager {
95 protected:
97 std::vector<pool::Token*> m_refs;
99 std::vector<std::string> m_links;
100
101 public:
103 PoolDbLinkManager() = default;
105 virtual ~PoolDbLinkManager() {
106 for ( auto& i : m_refs ) delete i;
107 }
109 std::vector<pool::Token*>& references() { return m_refs; }
111 std::vector<std::string>& links() { return m_links; }
112 };
pool::Guid::Data1
unsigned int Data1
Definition: PoolClasses.h:14
pool::Token::m_type
int m_type
POOL OID data member: transient (a streamer is used to read it)
Definition: PoolClasses.h:32
Kernel.h
PoolDbTokenWrap::PoolDbTokenWrap
PoolDbTokenWrap(const PoolDbTokenWrap &wrp)
Copy constructor.
Definition: PoolClasses.h:74
PoolDbTokenWrap::operator==
bool operator==(const PoolDbTokenWrap &c) const
Equality operator.
Definition: PoolClasses.h:78
PoolDbLinkManager::m_refs
std::vector< pool::Token * > m_refs
Directory links.
Definition: PoolClasses.h:97
pool::Token::operator==
bool operator==(const Token &t) const
Definition: PoolClasses.h:36
gaudirun.c
c
Definition: gaudirun.py:487
pool::Token::Token
Token()=default
transient (a streamer is used to read it)
pool::Token::m_classID
Guid m_classID
transient (a streamer is used to read it)
Definition: PoolClasses.h:30
pool::Guid::Data2
unsigned short Data2
Definition: PoolClasses.h:15
UCharDbArray::~UCharDbArray
virtual ~UCharDbArray()
Standard destructor.
Definition: PoolClasses.h:54
UCharDbArray::m_size
int m_size
Size of buffer.
Definition: PoolClasses.h:48
pool::Token::m_technology
int m_technology
transient (a streamer is used to read it)
Definition: PoolClasses.h:27
PoolDbLinkManager::references
std::vector< pool::Token * > & references()
Access to token array.
Definition: PoolClasses.h:109
PoolDbLinkManager::m_links
std::vector< std::string > m_links
Logical links.
Definition: PoolClasses.h:99
pool::Guid
Definition: PoolClasses.h:12
pool::Guid::Data3
unsigned short Data3
Definition: PoolClasses.h:16
UCharDbArray::UCharDbArray
UCharDbArray()=default
Default constructor.
PoolDbTokenWrap::operator=
PoolDbTokenWrap & operator=(const PoolDbTokenWrap &wrp)
Assignment operator.
Definition: PoolClasses.h:80
UCharDbArray
Shadow class to mimik POOL blobs.
Definition: PoolClasses.h:45
std::string
STL class.
pool::Token::m_oid
std::pair< int, int > m_oid
Object global identifier.
Definition: PoolClasses.h:31
PoolDbLinkManager::links
std::vector< std::string > & links()
Access to link array.
Definition: PoolClasses.h:111
pool::Token
Shadow class to mimik POOL tokens.
Definition: PoolClasses.h:24
pool
Definition: PoolClasses.h:11
PoolDbTokenWrap::token
pool::Token token
Aggregated token object.
Definition: PoolClasses.h:70
PoolDbLinkManager
Description: PoolDbLinkManager class implementation definition.
Definition: PoolClasses.h:94
PoolDbTokenWrap::~PoolDbTokenWrap
virtual ~PoolDbTokenWrap()=default
Standard destructor.
PoolDbTokenWrap
Description:
Definition: PoolClasses.h:67
PoolDbLinkManager::~PoolDbLinkManager
virtual ~PoolDbLinkManager()
Standard destructor.
Definition: PoolClasses.h:105
std::pair< int, int >
pool::Token::m_cntID
std::string m_cntID
transient (a streamer is used to read it)
Definition: PoolClasses.h:29
std::vector< pool::Token * >
UCharDbArray::m_buffer
unsigned char * m_buffer
Buffer with object content.
Definition: PoolClasses.h:50
pool::Guid::Data4
unsigned char Data4[8]
Definition: PoolClasses.h:17
pool::Token::~Token
virtual ~Token()=default
pool::Token::m_dbID
std::string m_dbID
transient (a streamer is used to read it)
Definition: PoolClasses.h:28
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:71
pool::Token::m_refCount
int m_refCount
Definition: PoolClasses.h:26
PoolDbTokenWrap::PoolDbTokenWrap
PoolDbTokenWrap()=default
Standard constructor.