ATLAS Offline Software
Loading...
Searching...
No Matches
ActiveStoreSvc.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
8
9#include "GaudiKernel/MsgStream.h"
10#include "GaudiKernel/ISvcLocator.h"
11
12using namespace SG;
13
14
18
19 CHECK( Service::initialize() );
20
21 msg() << MSG::VERBOSE << "Initializing " << name() << endmsg;
22
23 SmartIF<StoreGateSvc> storeGate{service(m_storeName, /*createIf*/true)};
24 CHECK( storeGate.isValid() );
25 storeGate->makeCurrent();
26
27 return StatusCode::SUCCESS;
28}
29
32 s->makeCurrent();
33}
34
37ActiveStoreSvc::proxy(const void* const pTransient) const {
38 return activeStore()->proxy(pTransient);
39}
40
43ActiveStoreSvc::proxy(const CLID& id, const std::string& key) const {
44 return activeStore()->proxy(id,key);
45}
46
51
53std::vector<const SG::DataProxy*>
55 return activeStore()->proxies();
56}
57
58
61{
62 return activeStore()->addToStore (id, proxy);
63}
64
65
84 const std::string& key,
85 bool allowMods,
86 bool returnExisting)
87{
88 return activeStore()->recordObject (obj, key, allowMods, returnExisting);
89}
90
91
100sgkey_t ActiveStoreSvc::stringToKey (const std::string& str, CLID clid)
101{
102 return activeStore()->stringToKey (str, clid);
103}
104
105
113const std::string* ActiveStoreSvc::keyToString (sgkey_t key) const
114{
115 return activeStore()->keyToString (key);
116}
117
118
127const std::string* ActiveStoreSvc::keyToString (sgkey_t key,
128 CLID& clid) const
129{
130 return activeStore()->keyToString (key, clid);
131}
132
133
147 const std::string& str,
148 CLID clid)
149{
150 return activeStore()->registerKey (key, str, clid);
151}
152
153
#define endmsg
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
uint32_t CLID
The Class ID type.
virtual SG::DataProxy * proxy_exact(SG::sgkey_t sgkey) const override
Get proxy given a hashed key+clid.
virtual SG::DataProxy * recordObject(SG::DataObjectSharedPtr< DataObject > obj, const std::string &key, bool allowMods, bool returnExisting) override
Record an object in the store.
Gaudi::Property< std::string > m_storeName
virtual SG::DataProxy * proxy(const void *const pTransient) const override
get proxy for a given data object address in memory
virtual std::vector< const SG::DataProxy * > proxies() const override
return the list of all current proxies in store
StatusCode addToStore(CLID id, SG::DataProxy *proxy) override
Raw addition of a proxy to the store.
void setStore(StoreGateSvc *s)
set the active store pointer: used by the event loop mgrs
virtual StatusCode initialize() override
Service initialization.
virtual void registerKey(sgkey_t key, const std::string &str, CLID clid) override
Remember an additional mapping from key to string/CLID.
virtual const std::string * keyToString(sgkey_t key) const override
Find the string corresponding to a given key.
StoreGateSvc * activeStore() const
returns pointer to the active store as StoreGateSvc
StoreGateSvc * activeStoreOOL() const
virtual sgkey_t stringToKey(const std::string &str, CLID clid) override
Find the key for a string/CLID pair.
The Athena Transient Store API.
virtual SG::DataProxy * recordObject(SG::DataObjectSharedPtr< DataObject > obj, const std::string &key, bool allowMods, bool returnExisting) override final
Record an object in the store.
virtual void registerKey(sgkey_t key, const std::string &str, CLID clidid) override final
Remember an additional mapping from key to string/CLID.
static StoreGateSvc * currentStoreGate()
get current StoreGate
virtual StatusCode addToStore(CLID id, SG::DataProxy *proxy) override final
Raw addition of a proxy to the store.
virtual const std::string * keyToString(sgkey_t key) const override final
Find the string corresponding to a given key.
virtual sgkey_t stringToKey(const std::string &str, CLID clid) override final
Find the key for a string/CLID pair.
virtual std::vector< const SG::DataProxy * > proxies() const override final
return the list of all current proxies in store
virtual SG::DataProxy * proxy(const void *const pTransient) const override final
get proxy for a given data object address in memory
virtual SG::DataProxy * proxy_exact(SG::sgkey_t sgkey) const override final
Get proxy given a hashed key+clid.
Forward declaration.
CxxUtils::RefCountedPtr< T > DataObjectSharedPtr
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
Definition sgkey_t.h:32
MsgStream & msg
Definition testRead.cxx:32