00001
00002 #ifndef GAUDIKERNEL_GENERICADDRESS_H
00003 #define GAUDIKERNEL_GENERICADDRESS_H
00004
00005
00006 #include "GaudiKernel/Kernel.h"
00007 #include "GaudiKernel/IOpaqueAddress.h"
00008
00009
00010 class IRegistry;
00011
00021 class GenericAddress : public IOpaqueAddress {
00022 protected:
00024 unsigned long m_refCount;
00026 long m_svcType;
00028 CLID m_clID;
00030 std::string m_par[3];
00032 unsigned long m_ipar[2];
00034 IRegistry* m_pRegistry;
00035
00036 public:
00038 GenericAddress()
00039 : m_refCount(0),
00040 m_svcType(0),
00041 m_clID(0),
00042 m_pRegistry(0)
00043 {
00044 m_ipar[0]=m_ipar[1]=0xFFFFFFFF;
00045 }
00047 GenericAddress(const GenericAddress& copy)
00048 : IOpaqueAddress(copy),
00049 m_refCount(0),
00050 m_svcType(copy.m_svcType),
00051 m_clID(copy.m_clID),
00052 m_pRegistry(copy.m_pRegistry)
00053 {
00054 m_par[0] = copy.m_par[0];
00055 m_par[1] = copy.m_par[1];
00056 m_ipar[0] = copy.m_ipar[0];
00057 m_ipar[1] = copy.m_ipar[1];
00058 }
00060 GenericAddress( long svc,
00061 const CLID& clid,
00062 const std::string& p1="",
00063 const std::string& p2="",
00064 unsigned long ip1=0,
00065 unsigned long ip2=0)
00066 : m_refCount(0),
00067 m_svcType(svc),
00068 m_clID(clid),
00069 m_pRegistry(0)
00070 {
00071 m_par[0] = p1;
00072 m_par[1] = p2;
00073 m_ipar[0] = ip1;
00074 m_ipar[1] = ip2;
00075 }
00076
00078 virtual ~GenericAddress() {
00079 }
00080
00082 virtual unsigned long addRef () {
00083 return ++m_refCount;
00084 }
00086 virtual unsigned long release () {
00087 int cnt = --m_refCount;
00088 if ( 0 == cnt ) {
00089 delete this;
00090 }
00091 return cnt;
00092 }
00094 virtual IRegistry* registry() const {
00095 return m_pRegistry;
00096 }
00098 virtual void setRegistry(IRegistry* pRegistry) {
00099 m_pRegistry = pRegistry;
00100 }
00102 const CLID& clID() const {
00103 return m_clID;
00104 }
00106 void setClID(const CLID& clid) {
00107 m_clID = clid;
00108 }
00110 long svcType() const {
00111 return m_svcType;
00112 }
00114 void setSvcType(long typ) {
00115 m_svcType = typ;
00116 }
00118 virtual const std::string* par() const {
00119 return m_par;
00120 }
00122 virtual const unsigned long* ipar() const {
00123 return m_ipar;
00124 }
00125 };
00126 #endif // GAUDIKERNEL_GENERICADDRESS_H
00127