The Gaudi Framework  master (d98a2936)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
GenericAddress.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2025 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 #pragma once
12 
14 #include <GaudiKernel/Kernel.h>
15 
16 class IRegistry;
17 
28 protected:
30  unsigned long m_refCount = 0;
32  long m_svcType = 0;
34  CLID m_clID = 0;
36  std::string m_par[3];
38  unsigned long m_ipar[2] = { 0xFFFFFFFF, 0xFFFFFFFF };
40  IRegistry* m_pRegistry = nullptr;
41 
42 public:
44  GenericAddress() = default;
47  : IOpaqueAddress( copy ), m_svcType( copy.m_svcType ), m_clID( copy.m_clID ), m_pRegistry( copy.m_pRegistry ) {
48  m_par[0] = copy.m_par[0];
49  m_par[1] = copy.m_par[1];
50  m_ipar[0] = copy.m_ipar[0];
51  m_ipar[1] = copy.m_ipar[1];
52  }
54  GenericAddress( long svc, const CLID& clid, std::string p1 = "", std::string p2 = "", unsigned long ip1 = 0,
55  unsigned long ip2 = 0 )
56  : m_svcType( svc ), m_clID( clid ) {
57  m_par[0] = std::move( p1 );
58  m_par[1] = std::move( p2 );
59  m_ipar[0] = ip1;
60  m_ipar[1] = ip2;
61  }
62 
63  GenericAddress& operator=( const GenericAddress& copy ) = default;
64 
66  unsigned long addRef() override { return ++m_refCount; }
68  unsigned long release() override {
69  unsigned long cnt = --m_refCount;
70  if ( 0 == cnt ) delete this;
71  return cnt;
72  }
74  IRegistry* registry() const override { return m_pRegistry; }
76  void setRegistry( IRegistry* pRegistry ) override { m_pRegistry = pRegistry; }
78  const CLID& clID() const override { return m_clID; }
80  void setClID( const CLID& clid ) { m_clID = clid; }
82  long svcType() const override { return m_svcType; }
84  void setSvcType( long typ ) { m_svcType = typ; }
86  const std::string* par() const override { return m_par; }
88  const unsigned long* ipar() const override { return m_ipar; }
89 };
GenericAddress::m_par
std::string m_par[3]
String parameters to be accessed.
Definition: GenericAddress.h:36
AlgSequencer.p2
p2
Definition: AlgSequencer.py:30
IOpaqueAddress
Definition: IOpaqueAddress.h:28
GenericAddress::m_ipar
unsigned long m_ipar[2]
Integer parameters to be accessed.
Definition: GenericAddress.h:38
GenericAddress::setSvcType
void setSvcType(long typ)
Access : set the storage type of the class id.
Definition: GenericAddress.h:84
GenericAddress::clID
const CLID & clID() const override
Access : Retrieve class ID of the link.
Definition: GenericAddress.h:78
IRegistry
Definition: IRegistry.h:29
GenericAddress::svcType
long svcType() const override
Access : retrieve the storage type of the class id.
Definition: GenericAddress.h:82
GenericAddress::setRegistry
void setRegistry(IRegistry *pRegistry) override
Set pointer to directory.
Definition: GenericAddress.h:76
GenericAddress::setClID
void setClID(const CLID &clid)
Access : Set class ID of the link.
Definition: GenericAddress.h:80
GenericAddress
Definition: GenericAddress.h:27
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:54
GenericAddress::GenericAddress
GenericAddress(const GenericAddress &copy)
Standard Copy Constructor (note: m_refCount is NOT copied)
Definition: GenericAddress.h:46
IOpaqueAddress.h
AlgSequencer.p1
p1
Definition: AlgSequencer.py:29
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:16
GenericAddress::release
unsigned long release() override
release reference to object
Definition: GenericAddress.h:68
Kernel.h
GenericAddress::par
const std::string * par() const override
Retrieve string parameters.
Definition: GenericAddress.h:86
GenericAddress::addRef
unsigned long addRef() override
Add reference to object.
Definition: GenericAddress.h:66
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:88
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:49
GenericAddress::registry
IRegistry * registry() const override
Pointer to directory.
Definition: GenericAddress.h:74