ATLAS Offline Software
xAODRootAccess/xAODRootAccess/tools/IProxyDict.h
Go to the documentation of this file.
1 // Dear emacs, this is -*- c++ -*-
2 //
3 // Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
4 //
5 #ifndef XAODROOTACCESS_TOOLS_IPROXYDICT_H
6 #define XAODROOTACCESS_TOOLS_IPROXYDICT_H
7 
8 #ifdef XAOD_STANDALONE
9 
12 #include "CxxUtils/sgkey_t.h"
13 #include "xAODCore/CLASS_DEF.h"
14 
15 // System include(s).
16 #include <string>
17 #include <vector>
18 #include <memory>
19 #include <cstdint>
20 
21 namespace SG {
22 
24  struct DataProxy {};
25 
27  template< class T >
28  using DataObjectSharedPtr = std::shared_ptr< T >;
29 
30 } // namespace SG
31 
33 struct DataObject {};
35 struct InterfaceID {};
36 
44 class IProxyDict {
45 
46 public:
48  virtual ~IProxyDict() {}
49 
51  virtual SG::DataProxy* proxy( const void* const pTransient ) const = 0;
52 
54  virtual SG::DataProxy* proxy( const CLID& id,
55  const std::string& key ) const = 0;
56 
58  virtual SG::DataProxy* proxy_exact( SG::sgkey_t sgkey ) const = 0;
59 
61  virtual StatusCode addToStore( CLID id, SG::DataProxy* proxy ) = 0;
62 
64  virtual std::vector< const SG::DataProxy* > proxies() const = 0;
65 
67  virtual SG::sgkey_t stringToKey( const std::string& str, CLID clid ) = 0;
68 
70  virtual const std::string* keyToString( SG::sgkey_t key ) const = 0;
71 
73  virtual const std::string* keyToString( SG::sgkey_t key,
74  CLID& clid ) const = 0;
75 
77  virtual void registerKey( SG::sgkey_t key,
78  const std::string& str,
79  CLID clid ) = 0;
80 
82  virtual SG::DataProxy*
84  const std::string& key,
85  bool allowMods,
86  bool returnExisting ) = 0;
87 
89  virtual const std::string& name() const = 0;
90 
91 }; // class IProxyDict
92 
93 #else
94 
95 // If we're in an offline build, just take the declaration from AthenaKernel.
97 #include "SGTools/DataProxy.h"
98 
99 #endif // XAOD_STANDALONE
100 #endif // XAODROOTACCESS_TOOLS_IPROXYDICT_H
common.sgkey
def sgkey(tool)
Definition: common.py:1027
IProxyDict::proxy
virtual SG::DataProxy * proxy(const CLID &id, const std::string &key) const =0
Get proxy with given id and key.
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
IStringPool::stringToKey
virtual sgkey_t stringToKey(const std::string &str, CLID clid)=0
Find the key for a string/CLID pair.
IProxyDict::addToStore
virtual StatusCode addToStore(CLID id, SG::DataProxy *proxy)=0
Add a new proxy to the store.
IProxyDict
A proxy dictionary.
Definition: AthenaKernel/AthenaKernel/IProxyDict.h:47
IStringPool::registerKey
virtual void registerKey(sgkey_t key, const std::string &str, CLID clid)=0
Remember an additional mapping from key to string/CLID.
IProxyDict::proxy_exact
virtual SG::DataProxy * proxy_exact(SG::sgkey_t sgkey) const =0
Get proxy given a hashed key+clid.
IProxyDict::proxies
virtual std::vector< const SG::DataProxy * > proxies() const =0
Return the list of all current proxies in store.
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
DataProxy
DataProxy provides the registry services for StoreGate.
Definition: DataProxy.h:32
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
StatusCode.h
IProxyDict.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
SG::sgkey_t
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
Definition: CxxUtils/CxxUtils/sgkey_t.h:32
IProxyDict::~IProxyDict
virtual ~IProxyDict() override
Definition: AthenaKernel/AthenaKernel/IProxyDict.h:50
CLASS_DEF.h
File providing the different SG_BASE macros.
sgkey_t.h
Define the type used for hashed StoreGate key+CLID pairs.
IStringPool::keyToString
virtual const std::string * keyToString(sgkey_t key) const =0
Find the string corresponding to a given key.
IProxyDict::recordObject
virtual SG::DataProxy * recordObject(SG::DataObjectSharedPtr< DataObject > obj, const std::string &key, bool allowMods, bool returnExisting)=0
Record an object in the store.
str
Definition: BTagTrackIpAccessor.cxx:11
SG::DataObjectSharedPtr
Smart pointer to manage DataObject reference counts.
Definition: DataObjectSharedPtr.h:45
python.PyAthena.obj
obj
Definition: PyAthena.py:132
SG::DataProxy
Definition: DataProxy.h:45
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
DataProxy.h