The Gaudi Framework  master (b9786168)
Loading...
Searching...
No Matches
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
16class IRegistry;
17
28protected:
30 unsigned long m_refCount = 0;
32 long m_svcType = 0;
36 std::string m_par[3];
38 unsigned long m_ipar[2] = { 0xFFFFFFFF, 0xFFFFFFFF };
41
42public:
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 }
53
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 }
73
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};
unsigned int CLID
Class ID definition.
Definition ClassID.h:16
#define GAUDI_API
Definition Kernel.h:49
long svcType() const override
Access : retrieve the storage type of the class id.
unsigned long addRef() override
Add reference to object.
std::string m_par[3]
String parameters to be accessed.
void setClID(const CLID &clid)
Access : Set class ID of the link.
GenericAddress & operator=(const GenericAddress &copy)=default
void setRegistry(IRegistry *pRegistry) override
Set pointer to directory.
IRegistry * m_pRegistry
Pointer to corresponding directory.
GenericAddress()=default
Dummy constructor.
unsigned long m_refCount
Reference count.
const CLID & clID() const override
Access : Retrieve class ID of the link.
GenericAddress(const GenericAddress &copy)
Standard Copy Constructor (note: m_refCount is NOT copied)
const std::string * par() const override
Retrieve string parameters.
CLID m_clID
Class id.
IRegistry * registry() const override
Pointer to directory.
GenericAddress(long svc, const CLID &clid, std::string p1="", std::string p2="", unsigned long ip1=0, unsigned long ip2=0)
Standard Constructor.
unsigned long release() override
release reference to object
const unsigned long * ipar() const override
Retrieve integer parameters.
long m_svcType
Storage type.
void setSvcType(long typ)
Access : set the storage type of the class id.
unsigned long m_ipar[2]
Integer parameters to be accessed.
Opaque address interface definition.
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition IRegistry.h:29