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-2024 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 
10 // System include(s):
11 #include <string>
12 #include <vector>
13 #include <memory>
14 #include <cstdint>
15 
17 #include "xAODCore/CLASS_DEF.h"
18 #include "CxxUtils/sgkey_t.h"
19 
20 namespace SG {
21 
23  struct DataProxy {};
24 
26  template< class T >
27  using DataObjectSharedPtr = std::shared_ptr< T >;
28 
29 } // namespace SG
30 
32 struct DataObject {};
34 struct InterfaceID {};
35 
43 class IProxyDict {
44 
45 public:
47  virtual ~IProxyDict() {}
48 
50  virtual SG::DataProxy* proxy( const void* const pTransient ) const = 0;
51 
53  virtual SG::DataProxy* proxy( const CLID& id,
54  const std::string& key ) const = 0;
55 
57  virtual SG::DataProxy* proxy_exact( SG::sgkey_t sgkey ) const = 0;
58 
60  virtual StatusCode addToStore( CLID id, SG::DataProxy* proxy ) = 0;
61 
63  virtual std::vector< const SG::DataProxy* > proxies() const = 0;
64 
66  virtual SG::sgkey_t stringToKey( const std::string& str, CLID clid ) = 0;
67 
69  virtual const std::string* keyToString( SG::sgkey_t key ) const = 0;
70 
72  virtual const std::string* keyToString( SG::sgkey_t key,
73  CLID& clid ) const = 0;
74 
76  virtual void registerKey( SG::sgkey_t key,
77  const std::string& str,
78  CLID clid ) = 0;
79 
81  virtual SG::DataProxy*
83  const std::string& key,
84  bool allowMods,
85  bool returnExisting ) = 0;
86 
88  virtual const std::string& name() const = 0;
89 
90 }; // class IProxyDict
91 
92 #else
93 
94 // If we're in an offline build, just take the declaration from AthenaKernel.
96 
97 #endif // XAOD_STANDALONE
98 #endif // XAODROOTACCESS_TOOLS_IPROXYDICT_H
common.sgkey
def sgkey(tool)
Definition: common.py:1028
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:31
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
IProxyDict.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
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:46
python.PyAthena.obj
obj
Definition: PyAthena.py:132
SG::DataProxy
Definition: DataProxy.h:44
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37