The Gaudi Framework  master (37c0b60a)
PoolClasses.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2024 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 
12 // The following two classes are the interfaces to facilitate reading POOL formatted ROOT files:
13 #include <GaudiKernel/Kernel.h> // GAUDI_API
14 #include <string>
15 #include <utility>
16 #include <vector>
17 
18 /*
19  * POOL namespace declaration
20  */
21 namespace pool {
22  class Guid { // size is 16
23  public:
24  unsigned int Data1;
25  unsigned short Data2;
26  unsigned short Data3;
27  unsigned char Data4[8];
28  };
34  class Token {
35  public:
36  int m_refCount{};
37  int m_technology{};
42  int m_type{};
43  public:
44  Token() = default;
45  virtual ~Token() = default;
46  bool operator==( const Token& t ) const { return m_oid.first == t.m_oid.first && m_oid.second == t.m_oid.second; }
47  };
48 } // namespace pool
49 
55 struct UCharDbArray {
56 public:
58  int m_size = 0;
60  unsigned char* m_buffer = nullptr; //[m_size]
62  UCharDbArray() = default;
64  virtual ~UCharDbArray() {
65  if ( m_buffer ) delete[] m_buffer;
66  m_buffer = nullptr;
67  }
68 };
69 
78 public:
82  PoolDbTokenWrap() = default;
84  PoolDbTokenWrap( const PoolDbTokenWrap& wrp ) { token = wrp.token; }
86  virtual ~PoolDbTokenWrap() = default;
88  bool operator==( const PoolDbTokenWrap& c ) const { return token == c.token; }
91  if ( this != &wrp ) token = wrp.token;
92  return *this;
93  }
94 };
95 
105 protected:
110 
111 public:
113  PoolDbLinkManager() = default;
115  virtual ~PoolDbLinkManager() {
116  for ( auto& i : m_refs ) delete i;
117  }
119  std::vector<pool::Token*>& references() { return m_refs; }
121  std::vector<std::string>& links() { return m_links; }
122 };
pool::Guid::Data4
unsigned char Data4[8]
Definition: PoolClasses.h:27
PoolDbTokenWrap
Definition: PoolClasses.h:77
std::string
STL class.
pool::Token::m_cntID
std::string m_cntID
transient (a streamer is used to read it)
Definition: PoolClasses.h:39
pool::Token::Token
Token()=default
transient (a streamer is used to read it)
UCharDbArray::m_size
int m_size
Size of buffer.
Definition: PoolClasses.h:58
PoolDbTokenWrap::PoolDbTokenWrap
PoolDbTokenWrap(const PoolDbTokenWrap &wrp)
Copy constructor.
Definition: PoolClasses.h:84
std::pair< int, int >
pool::Token::m_oid
std::pair< int, int > m_oid
Object global identifier.
Definition: PoolClasses.h:41
UCharDbArray::UCharDbArray
UCharDbArray()=default
Default constructor.
pool::Token::m_classID
Guid m_classID
transient (a streamer is used to read it)
Definition: PoolClasses.h:40
std::vector< pool::Token * >
pool
Definition: PoolClasses.h:21
gaudirun.c
c
Definition: gaudirun.py:525
UCharDbArray::~UCharDbArray
virtual ~UCharDbArray()
Standard destructor.
Definition: PoolClasses.h:64
PoolDbTokenWrap::token
pool::Token token
Aggregated token object.
Definition: PoolClasses.h:80
pool::Token::m_dbID
std::string m_dbID
transient (a streamer is used to read it)
Definition: PoolClasses.h:38
bug_34121.t
t
Definition: bug_34121.py:31
pool::Token::m_refCount
int m_refCount
Definition: PoolClasses.h:36
PoolDbTokenWrap::operator==
bool operator==(const PoolDbTokenWrap &c) const
Equality operator.
Definition: PoolClasses.h:88
pool::Guid::Data1
unsigned int Data1
Definition: PoolClasses.h:24
pool::Guid
Definition: PoolClasses.h:22
PoolDbTokenWrap::PoolDbTokenWrap
PoolDbTokenWrap()=default
Standard constructor.
pool::Token::operator==
bool operator==(const Token &t) const
Definition: PoolClasses.h:46
pool::Token::m_technology
int m_technology
transient (a streamer is used to read it)
Definition: PoolClasses.h:37
UCharDbArray
Definition: PoolClasses.h:55
pool::Guid::Data2
unsigned short Data2
Definition: PoolClasses.h:25
Kernel.h
pool::Token::~Token
virtual ~Token()=default
PoolDbTokenWrap::~PoolDbTokenWrap
virtual ~PoolDbTokenWrap()=default
Standard destructor.
pool::Token
Definition: PoolClasses.h:34
UCharDbArray::m_buffer
unsigned char * m_buffer
Buffer with object content.
Definition: PoolClasses.h:60
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:81
pool::Guid::Data3
unsigned short Data3
Definition: PoolClasses.h:26
PoolDbTokenWrap::operator=
PoolDbTokenWrap & operator=(const PoolDbTokenWrap &wrp)
Assignment operator.
Definition: PoolClasses.h:90
pool::Token::m_type
int m_type
POOL OID data member: transient (a streamer is used to read it)
Definition: PoolClasses.h:42