The Gaudi Framework  master (181af51f)
Loading...
Searching...
No Matches
PoolClasses.h
Go to the documentation of this file.
1/***********************************************************************************\
2* (c) Copyright 1998-2025 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#pragma once
12
13// The following two classes are the interfaces to facilitate reading POOL formatted ROOT files:
14#include <GaudiKernel/Kernel.h> // GAUDI_API
15#include <string>
16#include <utility>
17#include <vector>
18
19/*
20 * POOL namespace declaration
21 */
22namespace pool {
23 class Guid { // size is 16
24 public:
25 unsigned int Data1;
26 unsigned short Data2;
27 unsigned short Data3;
28 unsigned char Data4[8];
29 };
30
35 class Token {
36 public:
37 int m_refCount{};
39 std::string m_dbID;
40 std::string m_cntID;
42 std::pair<int, int> m_oid;
43 int m_type{};
44 public:
45 Token() = default;
46 virtual ~Token() = default;
47 bool operator==( const Token& t ) const { return m_oid.first == t.m_oid.first && m_oid.second == t.m_oid.second; }
48 };
49} // namespace pool
50
57public:
59 int m_size = 0;
61 unsigned char* m_buffer = nullptr; //[m_size]
63 UCharDbArray() = default;
65 virtual ~UCharDbArray() {
66 if ( m_buffer ) delete[] m_buffer;
67 m_buffer = nullptr;
68 }
69};
70
79public:
83 PoolDbTokenWrap() = default;
85 PoolDbTokenWrap( const PoolDbTokenWrap& wrp ) : token( wrp.token ) {}
87 virtual ~PoolDbTokenWrap() = default;
89 bool operator==( const PoolDbTokenWrap& c ) const { return token == c.token; }
92 if ( this != &wrp ) token = wrp.token;
93 return *this;
94 }
95};
96
106protected:
108 std::vector<pool::Token*> m_refs;
110 std::vector<std::string> m_links;
111
112public:
114 PoolDbLinkManager() = default;
117 for ( auto& i : m_refs ) delete i;
118 }
119
120 std::vector<pool::Token*>& references() { return m_refs; }
122 std::vector<std::string>& links() { return m_links; }
123};
#define GAUDI_API
Definition Kernel.h:49
pool::Token token
Aggregated token object.
Definition PoolClasses.h:81
PoolDbTokenWrap(const PoolDbTokenWrap &wrp)
Copy constructor.
Definition PoolClasses.h:85
virtual ~PoolDbTokenWrap()=default
Standard destructor.
PoolDbTokenWrap & operator=(const PoolDbTokenWrap &wrp)
Assignment operator.
Definition PoolClasses.h:91
PoolDbTokenWrap()=default
Standard constructor.
bool operator==(const PoolDbTokenWrap &c) const
Equality operator.
Definition PoolClasses.h:89
unsigned short Data2
Definition PoolClasses.h:26
unsigned short Data3
Definition PoolClasses.h:27
unsigned int Data1
Definition PoolClasses.h:25
unsigned char Data4[8]
Definition PoolClasses.h:28
Shadow class to mimik POOL tokens.
Definition PoolClasses.h:35
std::pair< int, int > m_oid
Object global identifier.
Definition PoolClasses.h:42
int m_type
POOL OID data member: transient (a streamer is used to read it)
Definition PoolClasses.h:43
Guid m_classID
transient (a streamer is used to read it)
Definition PoolClasses.h:41
std::string m_dbID
transient (a streamer is used to read it)
Definition PoolClasses.h:39
int m_technology
transient (a streamer is used to read it)
Definition PoolClasses.h:38
bool operator==(const Token &t) const
Definition PoolClasses.h:47
virtual ~Token()=default
std::string m_cntID
transient (a streamer is used to read it)
Definition PoolClasses.h:40
Token()=default
transient (a streamer is used to read it)
UCharDbArray()=default
Default constructor.
unsigned char * m_buffer
Buffer with object content.
Definition PoolClasses.h:61
int m_size
Size of buffer.
Definition PoolClasses.h:59
virtual ~UCharDbArray()
Standard destructor.
Definition PoolClasses.h:65