The Gaudi Framework  v33r0 (d5ea422b)
PoolClasses.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2019 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;
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 };
unsigned int Data1
Definition: PoolClasses.h:24
int m_type
POOL OID data member: transient (a streamer is used to read it)
Definition: PoolClasses.h:42
PoolDbTokenWrap(const PoolDbTokenWrap &wrp)
Copy constructor.
Definition: PoolClasses.h:84
bool operator==(const PoolDbTokenWrap &c) const
Equality operator.
Definition: PoolClasses.h:88
bool operator==(const Token &t) const
Definition: PoolClasses.h:46
Token()=default
transient (a streamer is used to read it)
Guid m_classID
transient (a streamer is used to read it)
Definition: PoolClasses.h:40
unsigned short Data2
Definition: PoolClasses.h:25
virtual ~UCharDbArray()
Standard destructor.
Definition: PoolClasses.h:64
int m_size
Size of buffer.
Definition: PoolClasses.h:58
int m_technology
transient (a streamer is used to read it)
Definition: PoolClasses.h:37
unsigned short Data3
Definition: PoolClasses.h:26
UCharDbArray()=default
Default constructor.
PoolDbTokenWrap & operator=(const PoolDbTokenWrap &wrp)
Assignment operator.
Definition: PoolClasses.h:90
Shadow class to mimik POOL blobs.
Definition: PoolClasses.h:55
STL class.
std::pair< int, int > m_oid
Object global identifier.
Definition: PoolClasses.h:41
Shadow class to mimik POOL tokens.
Definition: PoolClasses.h:34
pool::Token token
Aggregated token object.
Definition: PoolClasses.h:80
virtual ~PoolDbTokenWrap()=default
Standard destructor.
Description:
Definition: PoolClasses.h:77
std::string m_cntID
transient (a streamer is used to read it)
Definition: PoolClasses.h:39
unsigned char * m_buffer
Buffer with object content.
Definition: PoolClasses.h:60
unsigned char Data4[8]
Definition: PoolClasses.h:27
virtual ~Token()=default
std::string m_dbID
transient (a streamer is used to read it)
Definition: PoolClasses.h:38
#define GAUDI_API
Definition: Kernel.h:81
int m_refCount
Definition: PoolClasses.h:36
PoolDbTokenWrap()=default
Standard constructor.