| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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/Kernel.h"
6 #include "GaudiKernel/IOpaqueAddress.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),
41 m_svcType(copy.m_svcType),
42 m_clID(copy.m_clID),
43 m_pRegistry(copy.m_pRegistry)
44 {
45 m_par[0] = copy.m_par[0];
46 m_par[1] = copy.m_par[1];
47 m_ipar[0] = copy.m_ipar[0];
48 m_ipar[1] = copy.m_ipar[1];
49 }
51 GenericAddress( long svc,
52 const CLID& clid,
53 std::string p1="",
54 std::string p2="",
55 unsigned long ip1=0,
56 unsigned long ip2=0)
57 : m_svcType(svc),
58 m_clID(clid)
59 {
60 m_par[0] = std::move(p1);
61 m_par[1] = std::move(p2);
62 m_ipar[0] = ip1;
63 m_ipar[1] = ip2;
64 }
65
67 ~GenericAddress() override = default;
68
70 unsigned long addRef () override {
71 return ++m_refCount;
72 }
74 unsigned long release() override {
75 int cnt = --m_refCount;
76 if ( 0 == cnt ) delete this;
77 return cnt;
78 }
80 IRegistry* registry() const override {
81 return m_pRegistry;
82 }
84 void setRegistry(IRegistry* pRegistry) override {
85 m_pRegistry = pRegistry;
86 }
88 const CLID& clID() const override {
89 return m_clID;
90 }
92 void setClID(const CLID& clid) {
93 m_clID = clid;
94 }
96 long svcType() const override{
97 return m_svcType;
98 }
100 void setSvcType(long typ) {
101 m_svcType = typ;
102 }
104 const std::string* par() const override {
105 return m_par;
106 }
108 const unsigned long* ipar() const override {
109 return m_ipar;
110 }
111 };
112 #endif // GAUDIKERNEL_GENERICADDRESS_H
GenericAddress::GenericAddress
GenericAddress(const GenericAddress &copy)
Standard Copy Constructor (note: m_refCount is NOT copied)
Definition: GenericAddress.h:39
GenericAddress::m_ipar
unsigned long m_ipar[2]
Integer parameters to be accessed.
Definition: GenericAddress.h:31
Kernel.h
GenericAddress::m_par
std::string m_par[3]
String parameters to be accessed.
Definition: GenericAddress.h:29
GenericAddress::par
const std::string * par() const override
Retrieve string parameters.
Definition: GenericAddress.h:104
GenericAddress::setSvcType
void setSvcType(long typ)
Access : set the storage type of the class id.
Definition: GenericAddress.h:100
GenericAddress::addRef
unsigned long addRef() override
Add reference to object.
Definition: GenericAddress.h:70
GenericAddress::release
unsigned long release() override
release reference to object
Definition: GenericAddress.h:74
GenericAddress::registry
IRegistry * registry() const override
Pointer to directory.
Definition: GenericAddress.h:80
GenericAddress::clID
const CLID & clID() const override
Access : Retrieve class ID of the link.
Definition: GenericAddress.h:88
GenericAddress
Generic Transient Address.
Definition: GenericAddress.h:20
HiveAlgSequencer.p2
tuple p2
Definition: HiveAlgSequencer.py:23
GenericAddress::svcType
long svcType() const override
Access : retrieve the storage type of the class id.
Definition: GenericAddress.h:96
std::string
STL class.
GenericAddress::setClID
void setClID(const CLID &clid)
Access : Set class ID of the link.
Definition: GenericAddress.h:92
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:84
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:51
GenericAddress::ipar
const unsigned long * ipar() const override
Retrieve integer parameters.
Definition: GenericAddress.h:108
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
HiveAlgSequencer.p1
tuple p1
Definition: HiveAlgSequencer.py:22
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:107