The Gaudi Framework  v30r3 (a5ef0a68)
GenericAddress.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_GENERICADDRESS_H
2 #define GAUDIKERNEL_GENERICADDRESS_H
3 
4 // Framework include files
6 #include "GaudiKernel/Kernel.h"
7 
8 // Forward declarations
9 class IRegistry;
10 
21 {
22 protected:
24  unsigned long m_refCount = 0;
26  long m_svcType = 0;
28  CLID m_clID = 0;
30  std::string m_par[3];
32  unsigned long m_ipar[2] = {0xFFFFFFFF, 0xFFFFFFFF};
34  IRegistry* m_pRegistry = nullptr;
35 
36 public:
38  GenericAddress() = default;
41  : IOpaqueAddress( copy ), m_svcType( copy.m_svcType ), m_clID( copy.m_clID ), m_pRegistry( copy.m_pRegistry )
42  {
43  m_par[0] = copy.m_par[0];
44  m_par[1] = copy.m_par[1];
45  m_ipar[0] = copy.m_ipar[0];
46  m_ipar[1] = copy.m_ipar[1];
47  }
49  GenericAddress( long svc, const CLID& clid, std::string p1 = "", std::string p2 = "", unsigned long ip1 = 0,
50  unsigned long ip2 = 0 )
51  : m_svcType( svc ), m_clID( clid )
52  {
53  m_par[0] = std::move( p1 );
54  m_par[1] = std::move( p2 );
55  m_ipar[0] = ip1;
56  m_ipar[1] = ip2;
57  }
58 
60  unsigned long addRef() override { return ++m_refCount; }
62  unsigned long release() override
63  {
64  int cnt = --m_refCount;
65  if ( 0 == cnt ) delete this;
66  return cnt;
67  }
69  IRegistry* registry() const override { return m_pRegistry; }
71  void setRegistry( IRegistry* pRegistry ) override { m_pRegistry = pRegistry; }
73  const CLID& clID() const override { return m_clID; }
75  void setClID( const CLID& clid ) { m_clID = clid; }
77  long svcType() const override { return m_svcType; }
79  void setSvcType( long typ ) { m_svcType = typ; }
81  const std::string* par() const override { return m_par; }
83  const unsigned long* ipar() const override { return m_ipar; }
84 };
85 #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:104