| The Gaudi Framework v32r1 (f65d50dc)

RootObjAddress.h
Go to the documentation of this file.
1 #ifndef ROOTHISTCNV_ROOTOBJADDRESS_H
2 #define ROOTHISTCNV_ROOTOBJADDRESS_H 1
3
4 #include "GaudiKernel/IOpaqueAddress.h"
5 #include <string_view>
6
7 class TObject;
8
9 namespace RootHistCnv {
10
11 class RootObjAddress : public IOpaqueAddress {
12
13 protected:
14 unsigned long m_refCount = 0;
16 long m_svcType = 0;
18 CLID m_clID = 0;
20 std::string m_par[2];
22 unsigned long m_ipar[2] = {0xFFFFFFFF, 0xFFFFFFFF};
24 IRegistry* m_pRegistry = nullptr;
26 TObject* m_tObj = nullptr;
27
28 public:
30 RootObjAddress() = default;
31
32 RootObjAddress( const RootObjAddress& copy )
33 : IOpaqueAddress( copy )
34 , m_refCount( 0 )
35 , m_svcType( copy.m_svcType )
36 , m_clID( copy.m_clID )
37 , m_pRegistry( copy.m_pRegistry )
38 , m_tObj( copy.m_tObj ) {
39 m_par[0] = copy.m_par[0];
40 m_par[1] = copy.m_par[1];
41 m_ipar[0] = copy.m_ipar[0];
42 m_ipar[1] = copy.m_ipar[1];
43 }
44
46 RootObjAddress( long svc, const CLID& clid, std::string_view p1 = {}, std::string_view p2 = {},
47 unsigned long ip1 = 0, unsigned long ip2 = 0, TObject* tObj = nullptr )
48 : m_svcType( svc ), m_clID( clid ), m_tObj( tObj ) {
49 m_par[0] = std::string{p1};
50 m_par[1] = std::string{p2};
51 m_ipar[0] = ip1;
52 m_ipar[1] = ip2;
53 }
54
56 unsigned long addRef() override { return ++m_refCount; }
57
58 unsigned long release() override {
59 int cnt = --m_refCount;
60 if ( 0 == cnt ) delete this;
61 return cnt;
62 }
64 IRegistry* registry() const override { return m_pRegistry; }
66 void setRegistry( IRegistry* pRegistry ) override { m_pRegistry = pRegistry; }
68 const CLID& clID() const override { return m_clID; }
70 virtual void setClID( const CLID& clid ) { m_clID = clid; }
72 long svcType() const override { return m_svcType; }
74 virtual void setSvcType( long typ ) { m_svcType = typ; }
76 const std::string* par() const override { return m_par; }
78 const unsigned long* ipar() const override { return m_ipar; }
79
81 virtual TObject* tObj() const { return m_tObj; }
82 };
83 } // namespace RootHistCnv
84
85 #endif
RootHistCnv::RootObjAddress::release
unsigned long release() override
release reference to object
Definition: RootObjAddress.h:58
RootHistCnv::RootObjAddress::tObj
virtual TObject * tObj() const
Retrieve TObject* ptr.
Definition: RootObjAddress.h:81
RootHistCnv::RootObjAddress::m_pRegistry
IRegistry * m_pRegistry
Pointer to corresponding directory.
Definition: RootObjAddress.h:24
RootHistCnv::RootObjAddress::ipar
const unsigned long * ipar() const override
Retrieve integer parameters.
Definition: RootObjAddress.h:78
RootHistCnv::RootObjAddress::m_clID
CLID m_clID
Class id.
Definition: RootObjAddress.h:18
RootHistCnv::RootObjAddress::setClID
virtual void setClID(const CLID &clid)
Access : Set class ID of the link.
Definition: RootObjAddress.h:70
RootHistCnv::RootObjAddress
Definition: RootObjAddress.h:11
RootHistCnv::RootObjAddress::m_ipar
unsigned long m_ipar[2]
Integer parameters to be accessed.
Definition: RootObjAddress.h:22
RootHistCnv::RootObjAddress::par
const std::string * par() const override
Retrieve string parameters.
Definition: RootObjAddress.h:76
RootHistCnv::RootObjAddress::m_par
std::string m_par[2]
String parameters to be accessed.
Definition: RootObjAddress.h:20
RootHistCnv::RootObjAddress::setRegistry
void setRegistry(IRegistry *pRegistry) override
Set pointer to directory.
Definition: RootObjAddress.h:66
std::string
STL class.
RootHistCnv::RootObjAddress::setSvcType
virtual void setSvcType(long typ)
Access : set the storage type of the class id.
Definition: RootObjAddress.h:74
RootHistCnv::RootObjAddress::RootObjAddress
RootObjAddress(const RootObjAddress &copy)
Definition: RootObjAddress.h:32
RootHistCnv::RootObjAddress::RootObjAddress
RootObjAddress()=default
Dummy constructor.
RootHistCnv::RootObjAddress::clID
const CLID & clID() const override
Access : Retrieve class ID of the link.
Definition: RootObjAddress.h:68
RootHistCnv::RootObjAddress::RootObjAddress
RootObjAddress(long svc, const CLID &clid, std::string_view p1={}, std::string_view p2={}, unsigned long ip1=0, unsigned long ip2=0, TObject *tObj=nullptr)
Standard Constructor.
Definition: RootObjAddress.h:46
RootHistCnv
Definition: DirectoryCnv.h:17
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
RootHistCnv::RootObjAddress::registry
IRegistry * registry() const override
Pointer to directory.
Definition: RootObjAddress.h:64
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
IOpaqueAddress.h
RootHistCnv::RootObjAddress::m_tObj
TObject * m_tObj
Pointer to TObject.
Definition: RootObjAddress.h:26
RootHistCnv::RootObjAddress::m_refCount
unsigned long m_refCount
Definition: RootObjAddress.h:14
RootHistCnv::RootObjAddress::m_svcType
long m_svcType
Storage type.
Definition: RootObjAddress.h:16
RootHistCnv::RootObjAddress::addRef
unsigned long addRef() override
Add reference to object.
Definition: RootObjAddress.h:56
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
RootHistCnv::RootObjAddress::svcType
long svcType() const override
Access : retrieve the storage type of the class id.
Definition: RootObjAddress.h:72