ATLAS Offline Software
AthenaKernel/AthenaKernel/IProxyDict.h
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 #ifndef ATHENAKERNEL_IPROXYDICT_H
8 # define ATHENAKERNEL_IPROXYDICT_H
9 
10 // INCLUDES
11 #include "CxxUtils/sgkey_t.h"
15 #include "AthenaKernel/SourceID.h"
16 #include "GaudiKernel/INamedInterface.h"
17 #include "GaudiKernel/ClassID.h"
18 #include <string>
19 #include <vector>
20 #include <memory>
21 
22 // DECLARATIONS
23 namespace SG {
24  class DataProxy;
25 }
26 class DataObject;
27 class IResetable;
28 class IConverter;
29 
30 
45 class IProxyDict : virtual public IStringPool, // not a Gaudi interface
46  virtual public extend_interfaces<IHiveStore, INamedInterface>
47 {
48 public:
50  virtual ~IProxyDict() override {}
51 
60 
61 
75  virtual SG::DataProxy* proxy(const CLID& id,
76  const std::string& key) const = 0;
77 
78 
85  virtual SG::DataProxy* proxy(const void* const pTransient) const=0;
86 
87 
91  virtual std::vector<const SG::DataProxy*> proxies() const = 0;
92 
93 
105 
106 
128  const std::string& key,
129  bool allowMods,
130  bool returnExisting) = 0;
131 
132 
138  virtual void boundHandle (IResetable* handle);
139 
140 
146  virtual void unboundHandle (IResetable* handle);
147 
148 
159  virtual bool tryELRemap (sgkey_t sgkey_in, size_t index_in,
160  sgkey_t& sgkey_out, size_t& index_out);
161 
162 
178  virtual StatusCode createObj (IConverter* cvt,
179  IOpaqueAddress* addr,
180  DataObject*& refpObject);
181 
182 
188  virtual IProxyDict* hiveProxyDict() override;
189 
190 
198  virtual SG::SourceID sourceID (const std::string& key = "EventSelector") const;
199 };
200 
201 
202 #endif // ATHENAKERNEL_IPROXYDICT_H
common.sgkey
def sgkey(tool)
Definition: common.py:1028
IStringPool
Abstract interface for looking up strings/CLIDs in a pool.
Definition: IStringPool.h:28
IProxyDict::proxy
virtual SG::DataProxy * proxy(const CLID &id, const std::string &key) const =0
Get proxy with given id and key.
IHiveStore.h
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
IProxyDict::addToStore
virtual StatusCode addToStore(CLID id, SG::DataProxy *proxy)=0
Add a new proxy to the store.
IStringPool::sgkey_t
SG::sgkey_t sgkey_t
Type of the keys.
Definition: IStringPool.h:34
IProxyDict::createObj
virtual StatusCode createObj(IConverter *cvt, IOpaqueAddress *addr, DataObject *&refpObject)
Call converter to create an object, possibly with locking.
Definition: IProxyDict.cxx:70
IProxyDict
A proxy dictionary.
Definition: AthenaKernel/AthenaKernel/IProxyDict.h:47
IProxyDict::sourceID
virtual SG::SourceID sourceID(const std::string &key="EventSelector") const
Return the metadata source ID for the current event slot.
Definition: IProxyDict.cxx:97
IProxyDict::proxy_exact
virtual SG::DataProxy * proxy_exact(SG::sgkey_t sgkey) const =0
Get proxy given a hashed key+clid.
IResetable
a resetable object (e.g. a SG DataHandle)
Definition: IResetable.h:15
IStringPool.h
Abstract interface for looking up strings/CLIDs in a pool.
IProxyDict::boundHandle
virtual void boundHandle(IResetable *handle)
Tell the store that a handle has been bound to a proxy.
Definition: IProxyDict.cxx:23
IProxyDict::tryELRemap
virtual bool tryELRemap(sgkey_t sgkey_in, size_t index_in, sgkey_t &sgkey_out, size_t &index_out)
Test to see if the target of an ElementLink has moved.
Definition: IProxyDict.cxx:48
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
DataObjectSharedPtr.h
Smart pointer to manage DataObject reference counts.
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
IProxyDict::unboundHandle
virtual void unboundHandle(IResetable *handle)
Tell the store that a handle has been unbound from a proxy.
Definition: IProxyDict.cxx:33
SourceID.h
Type used to identify a metadata source.
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
sgkey_t.h
Define the type used for hashed StoreGate key+CLID pairs.
SG::SourceID
std::string SourceID
Definition: AthenaKernel/AthenaKernel/SourceID.h:25
IProxyDict::DeclareInterfaceID
DeclareInterfaceID(IProxyDict, 2, 0)
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.
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
IProxyDict::hiveProxyDict
virtual IProxyDict * hiveProxyDict() override
Return the current event-slot-specific store.
Definition: IProxyDict.cxx:83
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
IProxyDict::proxy
virtual SG::DataProxy * proxy(const void *const pTransient) const =0
Get a proxy referencing a given transient object.