Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v28r2p1 (f1a77ff4)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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"
7 
8 // Forward declarations
9 class IRegistry;
10 
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;
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(const GenericAddress &copy)
Standard Copy Constructor (note: m_refCount is NOT copied)
unsigned long m_ipar[2]
Integer parameters to be accessed.
std::string m_par[3]
String parameters to be accessed.
void setSvcType(long typ)
Access : set the storage type of the class id.
unsigned long addRef() override
Add reference to object.
unsigned long release() override
release reference to object
IRegistry * registry() const override
Pointer to directory.
Generic Transient Address.
STL class.
void setClID(const CLID &clid)
Access : Set class ID of the link.
const unsigned long * ipar() const override
Retrieve integer parameters.
const std::string * par() const override
Retrieve string parameters.
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
void setRegistry(IRegistry *pRegistry) override
Set pointer to directory.
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
long svcType() const override
Access : retrieve the storage type of the class id.
T move(T...args)
GenericAddress(long svc, const CLID &clid, std::string p1="", std::string p2="", unsigned long ip1=0, unsigned long ip2=0)
Standard Constructor.
Opaque address interface definition.
const CLID & clID() const override
Access : Retrieve class ID of the link.
#define GAUDI_API
Definition: Kernel.h:107