ATLAS Offline Software
Loading...
Searching...
No Matches
ActiveStoreSvc.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
9
10#include "GaudiKernel/MsgStream.h"
11#include "GaudiKernel/ISvcLocator.h"
12
13using namespace SG;
14
15
19
20 CHECK( Service::initialize() );
21
22 SG_MSG_VERBOSE ("Initializing {}", name());
23
24 SmartIF<StoreGateSvc> storeGate{service(m_storeName, /*createIf*/true)};
25 CHECK( storeGate.isValid() );
26 storeGate->makeCurrent();
27
28 return StatusCode::SUCCESS;
29}
30
33 s->makeCurrent();
34}
35
38ActiveStoreSvc::proxy(const void* const pTransient) const {
39 return activeStore()->proxy(pTransient);
40}
41
44ActiveStoreSvc::proxy(const CLID& id, const std::string& key) const {
45 return activeStore()->proxy(id,key);
46}
47
52
54std::vector<const SG::DataProxy*>
56 return activeStore()->proxies();
57}
58
59
62{
63 return activeStore()->addToStore (id, proxy);
64}
65
66
85 const std::string& key,
86 bool allowMods,
87 bool returnExisting)
88{
89 return activeStore()->recordObject (obj, key, allowMods, returnExisting);
90}
91
92
101sgkey_t ActiveStoreSvc::stringToKey (const std::string& str, CLID clid)
102{
103 return activeStore()->stringToKey (str, clid);
104}
105
106
114const std::string* ActiveStoreSvc::keyToString (sgkey_t key) const
115{
116 return activeStore()->keyToString (key);
117}
118
119
128const std::string* ActiveStoreSvc::keyToString (sgkey_t key,
129 CLID& clid) const
130{
131 return activeStore()->keyToString (key, clid);
132}
133
134
148 const std::string& str,
149 CLID clid)
150{
151 return activeStore()->registerKey (key, str, clid);
152}
153
154
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.
#define SG_MSG_VERBOSE(x,...)
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