All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GenericAddress.h
Go to the documentation of this file.
1 // $Id: GenericAddress.h,v 1.7 2003/08/05 13:49:15 mato Exp $
2 #ifndef GAUDIKERNEL_GENERICADDRESS_H
3 #define GAUDIKERNEL_GENERICADDRESS_H
4 
5 // Framework include files
6 #include "GaudiKernel/Kernel.h"
8 
9 // Forward declarations
10 class IRegistry;
11 
22 protected:
24  unsigned long m_refCount;
26  long m_svcType;
30  std::string m_par[3];
32  unsigned long m_ipar[2];
35 
36 public:
39  : m_refCount(0),
40  m_svcType(0),
41  m_clID(0),
42  m_pRegistry(0)
43  {
44  m_ipar[0]=m_ipar[1]=0xFFFFFFFF;
45  }
48  : IOpaqueAddress(copy),
49  m_refCount(0),
50  m_svcType(copy.m_svcType),
51  m_clID(copy.m_clID),
52  m_pRegistry(copy.m_pRegistry)
53  {
54  m_par[0] = copy.m_par[0];
55  m_par[1] = copy.m_par[1];
56  m_ipar[0] = copy.m_ipar[0];
57  m_ipar[1] = copy.m_ipar[1];
58  }
60  GenericAddress( long svc,
61  const CLID& clid,
62  const std::string& p1="",
63  const std::string& p2="",
64  unsigned long ip1=0,
65  unsigned long ip2=0)
66  : m_refCount(0),
67  m_svcType(svc),
68  m_clID(clid),
69  m_pRegistry(0)
70  {
71  m_par[0] = p1;
72  m_par[1] = p2;
73  m_ipar[0] = ip1;
74  m_ipar[1] = ip2;
75  }
76 
78  virtual ~GenericAddress() {
79  }
80 
82  virtual unsigned long addRef () {
83  return ++m_refCount;
84  }
86  virtual unsigned long release () {
87  int cnt = --m_refCount;
88  if ( 0 == cnt ) {
89  delete this;
90  }
91  return cnt;
92  }
94  virtual IRegistry* registry() const {
95  return m_pRegistry;
96  }
98  virtual void setRegistry(IRegistry* pRegistry) {
99  m_pRegistry = pRegistry;
100  }
102  const CLID& clID() const {
103  return m_clID;
104  }
106  void setClID(const CLID& clid) {
107  m_clID = clid;
108  }
110  long svcType() const {
111  return m_svcType;
112  }
114  void setSvcType(long typ) {
115  m_svcType = typ;
116  }
118  virtual const std::string* par() const {
119  return m_par;
120  }
122  virtual const unsigned long* ipar() const {
123  return m_ipar;
124  }
125 };
126 #endif // GAUDIKERNEL_GENERICADDRESS_H
127 
GenericAddress(const GenericAddress &copy)
Standard Constructor.
unsigned long m_ipar[2]
Integer parameters to be accessed.
long m_svcType
Storage type.
IRegistry * m_pRegistry
Pointer to corresponding directory.
std::string m_par[3]
String parameters to be accessed.
GenericAddress()
Dummy constructor.
void setSvcType(long typ)
Access : set the storage type of the class id.
virtual IRegistry * registry() const
Pointer to directory.
virtual unsigned long addRef()
Add reference to object.
GenericAddress(long svc, const CLID &clid, const std::string &p1="", const std::string &p2="", unsigned long ip1=0, unsigned long ip2=0)
Standard Constructor.
Generic Transient Address.
const CLID & clID() const
Access : Retrieve class ID of the link.
long svcType() const
Access : retrieve the storage type of the class id.
virtual unsigned long release()
release reference to object
virtual const std::string * par() const
Retrieve string parameters.
void setClID(const CLID &clid)
Access : Set class ID of the link.
virtual const unsigned long * ipar() const
Retrieve integer parameters.
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
unsigned int CLID
Class ID definition.
Definition: ClassID.h:9
CLID m_clID
Class id.
virtual ~GenericAddress()
Standard Destructor.
unsigned long m_refCount
Reference count.
Opaque address interface definition.
virtual void setRegistry(IRegistry *pRegistry)
Set pointer to directory.
#define GAUDI_API
Definition: Kernel.h:108