| The Gaudi Framework v32r1 (f65d50dc)

GenericAddress.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_GENERICADDRESS_H
2 #define GAUDIKERNEL_GENERICADDRESS_H
3
4 // Framework include files
5 #include "GaudiKernel/IOpaqueAddress.h"
6 #include "GaudiKernel/Kernel.h"
7
8 // Forward declarations
9 class IRegistry;
10
20 class GAUDI_API GenericAddress : public IOpaqueAddress {
21 protected:
23 unsigned long m_refCount = 0;
25 long m_svcType = 0;
27 CLID m_clID = 0;
29 std::string m_par[3];
31 unsigned long m_ipar[2] = {0xFFFFFFFF, 0xFFFFFFFF};
33 IRegistry* m_pRegistry = nullptr;
34
35 public:
37 GenericAddress() = default;
39 GenericAddress( const GenericAddress& copy )
40 : IOpaqueAddress( copy ), m_svcType( copy.m_svcType ), m_clID( copy.m_clID ), m_pRegistry( copy.m_pRegistry ) {
41 m_par[0] = copy.m_par[0];
42 m_par[1] = copy.m_par[1];
43 m_ipar[0] = copy.m_ipar[0];
44 m_ipar[1] = copy.m_ipar[1];
45 }
47 GenericAddress( long svc, const CLID& clid, std::string p1 = "", std::string p2 = "", unsigned long ip1 = 0,
48 unsigned long ip2 = 0 )
49 : m_svcType( svc ), m_clID( clid ) {
50 m_par[0] = std::move( p1 );
51 m_par[1] = std::move( p2 );
52 m_ipar[0] = ip1;
53 m_ipar[1] = ip2;
54 }
55
57 unsigned long addRef() override { return ++m_refCount; }
59 unsigned long release() override {
60 int cnt = --m_refCount;
61 if ( 0 == cnt ) delete this;
62 return cnt;
63 }
65 IRegistry* registry() const override { return m_pRegistry; }
67 void setRegistry( IRegistry* pRegistry ) override { m_pRegistry = pRegistry; }
69 const CLID& clID() const override { return m_clID; }
71 void setClID( const CLID& clid ) { m_clID = clid; }
73 long svcType() const override { return m_svcType; }
75 void setSvcType( long typ ) { m_svcType = typ; }
77 const std::string* par() const override { return m_par; }
79 const unsigned long* ipar() const override { return m_ipar; }
80 };
81 #endif // GAUDIKERNEL_GENERICADDRESS_H
GenericAddress::GenericAddress
GenericAddress(const GenericAddress &copy)
Standard Copy Constructor (note: m_refCount is NOT copied)
Definition: GenericAddress.h:39
Kernel.h
GenericAddress::par
const std::string * par() const override
Retrieve string parameters.
Definition: GenericAddress.h:77
GenericAddress::setSvcType
void setSvcType(long typ)
Access : set the storage type of the class id.
Definition: GenericAddress.h:75
GenericAddress::addRef
unsigned long addRef() override
Add reference to object.
Definition: GenericAddress.h:57
GenericAddress::release
unsigned long release() override
release reference to object
Definition: GenericAddress.h:59
GenericAddress::registry
IRegistry * registry() const override
Pointer to directory.
Definition: GenericAddress.h:65
GenericAddress::clID
const CLID & clID() const override
Access : Retrieve class ID of the link.
Definition: GenericAddress.h:69
GenericAddress
Generic Transient Address.
Definition: GenericAddress.h:20
GenericAddress::svcType
long svcType() const override
Access : retrieve the storage type of the class id.
Definition: GenericAddress.h:73
std::string
STL class.
GenericAddress::setClID
void setClID(const CLID &clid)
Access : Set class ID of the link.
Definition: GenericAddress.h:71
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
GenericAddress::setRegistry
void setRegistry(IRegistry *pRegistry) override
Set pointer to directory.
Definition: GenericAddress.h:67
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
std::move
T move(T... args)
IOpaqueAddress.h
GenericAddress::GenericAddress
GenericAddress(long svc, const CLID &clid, std::string p1="", std::string p2="", unsigned long ip1=0, unsigned long ip2=0)
Standard Constructor.
Definition: GenericAddress.h:47
GenericAddress::ipar
const unsigned long * ipar() const override
Retrieve integer parameters.
Definition: GenericAddress.h:79
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:71