The Gaudi Framework  master (37c0b60a)
GenericAddress.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2024 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #ifndef GAUDIKERNEL_GENERICADDRESS_H
12 #define GAUDIKERNEL_GENERICADDRESS_H
13 
14 // Framework include files
16 #include <GaudiKernel/Kernel.h>
17 
18 // Forward declarations
19 class IRegistry;
20 
31 protected:
33  unsigned long m_refCount = 0;
35  long m_svcType = 0;
37  CLID m_clID = 0;
39  std::string m_par[3];
41  unsigned long m_ipar[2] = { 0xFFFFFFFF, 0xFFFFFFFF };
43  IRegistry* m_pRegistry = nullptr;
44 
45 public:
47  GenericAddress() = default;
50  : IOpaqueAddress( copy ), m_svcType( copy.m_svcType ), m_clID( copy.m_clID ), m_pRegistry( copy.m_pRegistry ) {
51  m_par[0] = copy.m_par[0];
52  m_par[1] = copy.m_par[1];
53  m_ipar[0] = copy.m_ipar[0];
54  m_ipar[1] = copy.m_ipar[1];
55  }
57  GenericAddress( long svc, const CLID& clid, std::string p1 = "", std::string p2 = "", unsigned long ip1 = 0,
58  unsigned long ip2 = 0 )
59  : m_svcType( svc ), m_clID( clid ) {
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 
66  GenericAddress& operator=( const GenericAddress& copy ) = default;
67 
69  unsigned long addRef() override { return ++m_refCount; }
71  unsigned long release() override {
72  unsigned long cnt = --m_refCount;
73  if ( 0 == cnt ) delete this;
74  return cnt;
75  }
77  IRegistry* registry() const override { return m_pRegistry; }
79  void setRegistry( IRegistry* pRegistry ) override { m_pRegistry = pRegistry; }
81  const CLID& clID() const override { return m_clID; }
83  void setClID( const CLID& clid ) { m_clID = clid; }
85  long svcType() const override { return m_svcType; }
87  void setSvcType( long typ ) { m_svcType = typ; }
89  const std::string* par() const override { return m_par; }
91  const unsigned long* ipar() const override { return m_ipar; }
92 };
93 #endif // GAUDIKERNEL_GENERICADDRESS_H
std::string
STL class.
std::move
T move(T... args)
AlgSequencer.p2
p2
Definition: AlgSequencer.py:30
IOpaqueAddress
Definition: IOpaqueAddress.h:33
GenericAddress::setSvcType
void setSvcType(long typ)
Access : set the storage type of the class id.
Definition: GenericAddress.h:87
GenericAddress::clID
const CLID & clID() const override
Access : Retrieve class ID of the link.
Definition: GenericAddress.h:81
IRegistry
Definition: IRegistry.h:32
GenericAddress::svcType
long svcType() const override
Access : retrieve the storage type of the class id.
Definition: GenericAddress.h:85
GenericAddress::setRegistry
void setRegistry(IRegistry *pRegistry) override
Set pointer to directory.
Definition: GenericAddress.h:79
GenericAddress::setClID
void setClID(const CLID &clid)
Access : Set class ID of the link.
Definition: GenericAddress.h:83
GenericAddress
Definition: GenericAddress.h:30
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:57
GenericAddress::GenericAddress
GenericAddress(const GenericAddress &copy)
Standard Copy Constructor (note: m_refCount is NOT copied)
Definition: GenericAddress.h:49
IOpaqueAddress.h
AlgSequencer.p1
p1
Definition: AlgSequencer.py:29
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:18
GenericAddress::release
unsigned long release() override
release reference to object
Definition: GenericAddress.h:71
Kernel.h
GenericAddress::par
const std::string * par() const override
Retrieve string parameters.
Definition: GenericAddress.h:89
GenericAddress::addRef
unsigned long addRef() override
Add reference to object.
Definition: GenericAddress.h:69
GenericAddress::operator=
GenericAddress & operator=(const GenericAddress &copy)=default
GenericAddress::GenericAddress
GenericAddress()=default
Dummy constructor.
GenericAddress::ipar
const unsigned long * ipar() const override
Retrieve integer parameters.
Definition: GenericAddress.h:91
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:81
GenericAddress::registry
IRegistry * registry() const override
Pointer to directory.
Definition: GenericAddress.h:77