ATLAS Offline Software
Loading...
Searching...
No Matches
StoreGateSvc Class Reference

The Athena Transient Store API. More...

#include <StoreGateSvc.h>

Inheritance diagram for StoreGateSvc:
Collaboration diagram for StoreGateSvc:

Classes

struct  BadListItem

Public Member Functions

Basic Client Interface: data object creation
template<typename T, typename TKEY, typename... ARGS>
SG::WPtr< T > create (const TKEY &key, ARGS... constructorArgs)
 Create an object with one of its constructors and record it with a key.
Basic Client Interface: data object registration
template<typename T, typename TKEY>
StatusCode record (T *p2BRegistered, const TKEY &key)
 Record an object with a key.
template<typename T, typename TKEY>
StatusCode record (const T *p2BRegistered, const TKEY &key)
 Record a const object with a key.
template<typename T, typename TKEY>
StatusCode record (T *p2BRegistered, const TKEY &key, bool allowMods, bool resetOnly=true, bool noHist=false)
 Record an object with a key, allow possibility of specifying const-access.
template<typename T, typename TKEY>
StatusCode record (std::unique_ptr< T > pUnique, const TKEY &key)
 Record an object with a key, take ownership of the unique_ptr obj.
template<typename T, typename TKEY>
StatusCode record (std::unique_ptr< const T > pUnique, const TKEY &key)
 Record a const object with a key.
template<typename T, typename TKEY>
StatusCode record (std::unique_ptr< T > pUnique, const TKEY &key, bool allowMods, bool resetOnly=true, bool noHist=false)
 Record an object with a key, allow possibility of specifying const-access.
Basic Client Interface: data object access
template<typename T>
StatusCode retrieve (const T *&ptr) const
 Retrieve the default object into a const T*.
template<typename T>
StatusCode retrieve (T *&ptr) const
 Retrieve the default object into a T*.
template<typename T>
T * retrieve () const
 Variant of the above which doesn't return a status code.
template<typename T>
T * tryRetrieve () const
 Variant of the above which doesn't print a warning message.
template<typename T>
const T * tryConstRetrieve () const
template<typename T, typename TKEY>
requires KeyConcept<TKEY>
StatusCode retrieve (const T *&ptr, const TKEY &key) const
 Retrieve an object with "key", into a const T*.
template<typename T>
StatusCode retrieve (const T *&ptr, const std::string &key) const
 Retrieve an object with "key", into a const T*.
template<typename T, typename TKEY>
requires KeyConcept<TKEY>
StatusCode retrieve (T *&ptr, const TKEY &key) const
 Retrieve an object with "key", into a T*.
template<typename T>
StatusCode retrieve (T *&ptr, const std::string &key) const
 Retrieve an object with "key", into a T*.
template<typename T, class TKEY>
T * retrieve (const TKEY &key) const
 Variant of the above which doesn't return a status code.
template<typename T, class TKEY>
requires KeyConcept<TKEY>
T * tryRetrieve (const TKEY &key) const
 Variant of the above which doesn't print a warning message.
template<typename T, class TKEY>
requires KeyConcept<TKEY>
const T * tryConstRetrieve (const TKEY &key) const
template<typename T>
StatusCode retrieve (SG::ConstIterator< T > &begin, SG::ConstIterator< T > &end) const
 Retrieve all objects of type T: returns an SG::ConstIterator range.
StatusCode retrieve (CLID id, SG::TypelessIterator &begin, SG::TypelessIterator &end) const
 Retrieve all objects of type CLID: returns an SG::ConstIterator range.
template<typename T, typename TKEY>
bool contains (const TKEY &key) const
 Look up a keyed object in TDS (compare also tryRetrieve) returns false if object not available in TDS or persistent stores Usage: if (!p_store->contains<Foo>("fooKey")) { ... }.
Advanced Client Interface: data object registration
template<typename T, KeyConcept TKEY>
StatusCode overwrite (std::unique_ptr< T > pUnique, const TKEY &key, bool allowMods, bool noHist=false)
 Record an object with a key, overwriting any existing object with same key.
StatusCode recordAddress (const std::string &skey, CxxUtils::RefCountedPtr< IOpaqueAddress > pAddress, bool clearAddressFlag=true, const std::vector< CLID > &bases={})
 Create a proxy object using an IOpaqueAddress and a transient key.
StatusCode recordAddress (CxxUtils::RefCountedPtr< IOpaqueAddress > pAddress, bool clearAddressFlag=true, const std::vector< CLID > &bases={})
 Create a proxy object using an IOpaqueAddress.
template<KeyConcept TKEY>
StatusCode symLink (const CLID id, const TKEY &key, const CLID linkid)
 make a soft link to the object pointed by id/key
template<typename T, typename AKEY>
requires KeyConcept<AKEY>
StatusCode setAlias (const T *p2BAliased, const AKEY &aliasKey)
 make an alias to a DataObject (provide only valid pointer)
StatusCode setConst (const void *pointer)
 prevent downstream clients from modifying the pointed-at dobj
template<typename T>
StatusCode remove (const T *pObject)
 Remove pObject, will remove its proxy if not reset only.
template<typename T>
StatusCode removeDataAndProxy (const T *pObject)
 Remove pObject and its proxy no matter what.
more proxy dictionary functionality
virtual SG::DataProxy * proxy (const CLID &id, bool checkValid) const final
 get default proxy with given id, optionally checking validity.
virtual SG::DataProxy * proxy (const CLID &id, const std::string &key, bool checkValid) const final
 get proxy with given id and key, optionally checking validity.
virtual SG::DataProxy * proxy (const CLID &id, const char *key, bool checkValid) const final
 get proxy with given id and key, optionally checking validity.
virtual std::vector< const SG::DataProxy * > proxies () const override final
 return the list of all current proxies in store
std::vector< CLID > clids () const
 Return all CLIDs in the store.
SG::DataProxy * transientProxy (const CLID &id, const std::string &key) const
 get proxy with given id and key.
DataObject * accessData (const CLID &id) const
 find proxy and access its data. Returns 0 to flag failure
DataObject * accessData (const CLID &id, const std::string &key) const
 find proxy and access its data. Returns 0 to flag failure
void setProxyProviderSvc (IProxyProviderSvc *pPPSvc)
 associate ProxyProviderSvc to this store
IProxyProviderSvc * proxyProviderSvc ()
 Return current ProxyProviderSvc.
virtual SG::SourceID sourceID (const std::string &key="EventSelector") const override
 Return the metadata source ID for the current event slot.
ElementLink remapping
template<class TKEY>
void remap (CLID clid, const TKEY &source, const TKEY &target, off_t index_offset)
 Declare a remapping.
void remap_impl (sgkey_t source, sgkey_t target, off_t index_offset)
 Declare a remapping.
virtual bool tryELRemap (sgkey_t sgkey_in, size_t index_in, sgkey_t &sgkey_out, size_t &index_out) override final
 Test to see if the target of an ElementLink has moved.
Gaudi Standard Service constructors/destructors
 StoreGateSvc (const std::string &name, ISvcLocator *svc)
 Standard Constructor.
virtual ~StoreGateSvc () override
 Standard Destructor.
Gaudi IService implementation
virtual StatusCode initialize () override
 Service initialization.
virtual StatusCode stop () override
 Service start.
virtual StatusCode finalize () override

Gaudi IIncidentListener implementation

enum  ListenerState { UNCHECKED , HAVE_LISTENERS , NO_LISTENERS }
typedef std::unordered_set< BadListItem, DataObjID_Hasher > BadItemList
typedef std::mutex mutex_t
 Protect access to m_bad* members.
typedef std::lock_guard< mutex_t > lock_t
ServiceHandle< IProxyProviderSvc > m_pPPSHandle {this, "ProxyProviderSvc", "ProxyProviderSvc"}
 Properties.
ServiceHandle< IIncidentSvc > m_incSvc {this, "IncidentSvc", "IncidentSvc"}
ServiceHandle< IAlgContextSvc > m_algContextSvc {this, "AlgContextSvc", "AlgContextSvc"}
Gaudi::Property< bool > m_DumpStore {this, "Dump", false, "Dump contents at EndEvent"}
Gaudi::Property< bool > m_ActivateHistory {this, "ActivateHistory", false, "record DataObjects history"}
Gaudi::Property< bool > m_DumpArena {this, "DumpArena", false, "Dump Arena usage stats"}
Gaudi::Property< bool > m_pruneIncidents {this, "PruneIncidents", false, "Don't send StoreCleared incidents if there are no registered listeners on the first event."}
StoreID::type m_storeID
 Cache store type in the facade class.
SmartIF< SGImplSvc > m_defaultStore
BadItemList m_badRetrieves ATLAS_THREAD_SAFE
 Remember calls to retrieve and record for a MT store, so we can warn about them during finalize().
BadItemList m_badRecords ATLAS_THREAD_SAFE
mutex_t m_badMutex
std::atomic< ListenerState > m_listenerState { UNCHECKED }
class SG::TestHiveStoreSvc
class SG::HiveMgrSvc
class xAODMaker::AuxStoreWrapper
 FIXME: access releaseObject.
class PileUpMergeSvc
 access emptyTrash
class IOVDbSvc
 access clearProxyPayload
class IOVSvcTool
class SG::VarHandleBase
 access typeless_record
void AthenaInternal::py_sg_clearProxyPayload (StoreGateSvc *, SG::DataProxy *)
PyObject * AthenaInternal::recordObjectToStore (StoreGateSvc *, PyObject *, PyObject *, bool, bool, bool)
virtual void handle (const Incident &) override final
StatusCode loadEventProxies ()
 load proxies at begin event
virtual StatusCode createObj (IConverter *cvt, IOpaqueAddress *addr, DataObject *&refpObject) override
 Call converter to create an object, with locking.
void makeCurrent ()
 The current store is becoming the active store.
static SG::HiveEventSlot * currentSlot ()
SGImplSvc * currentStore () const
 returns pointer to the current SGImplSvc
void releaseObject (const CLID &id, const std::string &key)
 release object held by proxy, if any.
void clearProxyPayload (SG::DataProxy *)
 use to reset a proxy (clearing the data object it contains) Unlike DataProxy::reset this method correctly updates SGSvc internals
StatusCode typeless_record (DataObject *obj, const std::string &key, const void *const raw_ptr, bool allowMods, bool resetOnly=true, bool noHist=false)
 type-less recording of an object with a key, allow possibility of specifying const-access and history record
StatusCode typeless_overwrite (const CLID &id, DataObject *obj, const std::string &key, const void *const raw_ptr, bool allowMods, bool noHist=false, const std::type_info *tinfo=0)
 same as typeless_record, allows to overwrite an object in memory or on disk
template<typename T, typename TKEY>
requires KeyConcept<TKEY>
StatusCode record1 (DataObject *obj, T *pObject, const TKEY &key, bool allowMods, bool resetOnly=true, bool noHist=false)
bool isSymLinked (const CLID &linkID, SG::DataProxy *dp)
StatusCode addSymLink (const CLID &linkid, SG::DataProxy *dp)
StatusCode addAlias (const std::string &aliasKey, SG::DataProxy *dp)
std::string createKey (const CLID &dataID)
 creates a key internally if none specified by client
SG::DataProxy * setupProxy (const CLID &dataID, const std::string &gK, DataObject *pDObj, bool allowMods, bool resetOnly)
 try to locate a proxy or create it if needed
void recycle (DataObject *pBadDObj)
 put a bad (unrecordable) dobj away
void emptyTrash ()
 throw away bad objects
StatusCode removeProxy (SG::DataProxy *proxy, const void *pTrans, bool forceRemove=false)
 remove proxy from store, unless it is reset only.
StatusCode t2pRegister (const void *const pTrans, SG::DataProxy *const pPers)
 forwarded to DataStore
void t2pRemove (const void *const pTrans)
 forwarded to DataStore
void msg_update_handler (Gaudi::Details::PropertyBase &outputLevel)
 callback for output level property
void addAutoSymLinks (const std::string &key, CLID clid, SG::DataProxy *dp, const std::type_info *tinfo, bool warn_nobib=true)
 Add automatically-made symlinks for DP.
void rememberBadRetrieve (CLID clid, const std::string &key) const
 Remember that retrieve() was called for a MT store.
void rememberBadRecord (CLID clid, const std::string &key) const
 Remember that retrieve() was called for a MT store.
void rememberBad (BadItemList &bad, CLID clid, const std::string &key) const
 Remember that retrieve or record was called for a MT store.
void printBadList (const BadItemList &bad, const std::string &what) const
 Print out a list of bad calls during finalization.
template<class DOBJ>
bool associateAux (DOBJ *, const std::string &key, bool ignoreMissing=true) const
 try to associate a data object to its auxiliary store if ignoreMissing=false
template<class DOBJ>
bool associateAux (const DOBJ *, const std::string &key, bool ignoreMissing=true) const
template<class DOBJ, class AUXSTORE>
bool associateAux_impl (DOBJ *ptr, const std::string &key, const AUXSTORE *) const
template<class DOBJ>
bool associateAux_impl (DOBJ *, const std::string &, const SG::NoAuxStore *) const
 StoreGateSvc (const StoreGateSvc &)
StoreGateSvc & operator= (const StoreGateSvc &)

String <-> int key conversions.

typedef IStringPool::sgkey_t sgkey_t
virtual sgkey_t stringToKey (const std::string &str, CLID clid) override final
 Find the key for a string/CLID pair.
virtual const std::string * keyToString (sgkey_t key) const override final
 Find the string corresponding to a given key.
virtual const std::string * keyToString (sgkey_t key, CLID &clid) const override final
 Find the string and CLID corresponding to a given key.
virtual void registerKey (sgkey_t key, const std::string &str, CLID clidid) override final
 Remember an additional mapping from key to string/CLID.

Advanced Client Interface: data object access

template<typename TKEY>
CLID clid (const TKEY &key) const
 Retrieve the main CLID of the object recorded in StoreGate with the given "key" WARNING: slow!
template<typename TKEY>
bool contains (const CLID &id, const TKEY &key) const
 Look up a keyed object in TDS by CLID.
template<typename T, typename TKEY>
bool transientContains (const TKEY &key) const
 Look up a transient data object in TDS only (no Proxy lookup) returns false if object not available in TDS Usage: if (!p_store->contains<Foo>("fooKey")) { ... }.
template<typename TKEY>
bool transientContains (const CLID &id, const TKEY &key) const
 Look up a transient data object in TDS only by CLID.
std::string dump () const
 dump objects in store.
void setStoreID (StoreID::type id)
 set store ID. request forwarded to DataStore:
virtual StoreID::type storeID () const override
 get store ID. request forwarded to DataStore:
template<typename T>
void keys (std::vector< std::string > &vkeys, bool includeAlias=false, bool onlyValid=true) const
 provide list of all StoreGate keys associated with an object.
void keys (const CLID &id, std::vector< std::string > &vkeys, bool includeAlias=false, bool onlyValid=true) const
 provide list of all StoreGate keys associated with an object.
virtual::IProxyDict * hiveProxyDict () override final
 implements IHiveStore interface
static StoreGateSvc * currentStoreGate ()
 get current StoreGate

IHiveStoreMgr implementation

virtual StatusCode clearStore (bool forceRemove=false) override final
 clear DataStore contents: called by the event loop mgrs
virtual void commitNewDataObjects () override final
 Reset handles added since the last call to commit.
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 (const CLID &id) const final
 get default proxy with given id. Returns 0 to flag failure
virtual SG::DataProxy * proxy (const CLID &id, const std::string &key) const override final
 get proxy with given id and key. Returns 0 to flag failure
SG::DataProxy * proxy (const CLID &id, const char *key) const
 get proxy with given id and key.
virtual StatusCode addToStore (CLID id, SG::DataProxy *proxy) override final
 Raw addition of a proxy to the store.
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 SG::DataProxy * proxy_exact (SG::sgkey_t sgkey) const override final
 Get proxy given a hashed key+clid.
static void setSlot (SG::HiveEventSlot *pSlot)
 set the hive event slot pointer: used by the event loop mgrs

Detailed Description

The Athena Transient Store API.

Parameters
Dumpproperty (default false): set to call dump() at EndEvent
FolderNameListproperty (default ""): data folders to be created in this store Caches a pointer to the currently hive store. In most jobs the hive store is simply the default event store (named "StoreGateSvc"). When doing pile-up (and perhaps later on in multi-threaded jobs, the hive store changes during the event loop execution. It is important, for example, that converters always refer to the hive store rather than to the default one.
Author
ATLAS Collaboration

Definition at line 108 of file StoreGateSvc.h.

Member Typedef Documentation

◆ BadItemList

typedef std::unordered_set<BadListItem, DataObjID_Hasher> StoreGateSvc::BadItemList
private

Definition at line 769 of file StoreGateSvc.h.

◆ lock_t

typedef std::lock_guard<mutex_t> StoreGateSvc::lock_t
private

Definition at line 779 of file StoreGateSvc.h.

◆ mutex_t

typedef std::mutex StoreGateSvc::mutex_t
private

Protect access to m_bad* members.

Definition at line 778 of file StoreGateSvc.h.

◆ sgkey_t

Definition at line 493 of file StoreGateSvc.h.

Member Enumeration Documentation

◆ ListenerState

Enumerator
UNCHECKED 
HAVE_LISTENERS 
NO_LISTENERS 

Definition at line 787 of file StoreGateSvc.h.

Constructor & Destructor Documentation

◆ StoreGateSvc() [1/2]

StoreGateSvc::StoreGateSvc ( const std::string & name,
ISvcLocator * svc )

Standard Constructor.

Definition at line 29 of file StoreGateSvc.cxx.

29 :
30 base_class(name,svc),
32{
33}
StoreID::type m_storeID
Cache store type in the facade class.
static StoreID::type findStoreID(const std::string &storeName)
Definition StoreID.cxx:21

◆ ~StoreGateSvc()

StoreGateSvc::~StoreGateSvc ( )
overridevirtual

Standard Destructor.

Definition at line 36 of file StoreGateSvc.cxx.

37{}

◆ StoreGateSvc() [2/2]

StoreGateSvc::StoreGateSvc ( const StoreGateSvc & )
private

Member Function Documentation

◆ accessData() [1/2]

DataObject * StoreGateSvc::accessData ( const CLID & id) const

find proxy and access its data. Returns 0 to flag failure

Definition at line 307 of file StoreGateSvc.cxx.

307 {
308 _SGXCALL(accessData, (id), 0);
309}
DataObject * accessData(const CLID &id) const
find proxy and access its data. Returns 0 to flag failure

◆ accessData() [2/2]

DataObject * StoreGateSvc::accessData ( const CLID & id,
const std::string & key ) const

find proxy and access its data. Returns 0 to flag failure

Definition at line 313 of file StoreGateSvc.cxx.

313 {
314 _SGXCALL(accessData, (id, key), 0);
315}

◆ addAlias()

StatusCode StoreGateSvc::addAlias ( const std::string & aliasKey,
SG::DataProxy * dp )
private

◆ addAutoSymLinks()

void StoreGateSvc::addAutoSymLinks ( const std::string & key,
CLID clid,
SG::DataProxy * dp,
const std::type_info * tinfo,
bool warn_nobib = true )
private

Add automatically-made symlinks for DP.

◆ addSymLink()

StatusCode StoreGateSvc::addSymLink ( const CLID & linkid,
SG::DataProxy * dp )
private

◆ addToStore()

StatusCode StoreGateSvc::addToStore ( CLID id,
SG::DataProxy * proxy )
finaloverridevirtual

Raw addition of a proxy to the store.

Parameters
idCLID of object being added.
proxyproxy to add.

Definition at line 246 of file StoreGateSvc.cxx.

247{
248 _SGXCALL(addToStore, (id, proxy), StatusCode::FAILURE);
249}
virtual StatusCode addToStore(CLID id, SG::DataProxy *proxy) override final
Raw addition of a proxy to the store.
virtual SG::DataProxy * proxy(const void *const pTransient) const override final
get proxy for a given data object address in memory

◆ associateAux() [1/2]

template<class DOBJ>
bool StoreGateSvc::associateAux ( const DOBJ * ,
const std::string & key,
bool ignoreMissing = true ) const
private

◆ associateAux() [2/2]

template<class DOBJ>
bool StoreGateSvc::associateAux ( DOBJ * ,
const std::string & key,
bool ignoreMissing = true ) const
private

try to associate a data object to its auxiliary store if ignoreMissing=false

Returns
false if the aux store is not found.
Parameters
keyThe key to use for the lookup.

◆ associateAux_impl() [1/2]

template<class DOBJ>
bool StoreGateSvc::associateAux_impl ( DOBJ * ,
const std::string & ,
const SG::NoAuxStore *  ) const
private

◆ associateAux_impl() [2/2]

template<class DOBJ, class AUXSTORE>
bool StoreGateSvc::associateAux_impl ( DOBJ * ptr,
const std::string & key,
const AUXSTORE *  ) const
private

◆ clearProxyPayload()

void StoreGateSvc::clearProxyPayload ( SG::DataProxy * proxy)
private

use to reset a proxy (clearing the data object it contains) Unlike DataProxy::reset this method correctly updates SGSvc internals

Definition at line 402 of file StoreGateSvc.cxx.

402 {
403 _SGVOIDCALL( clearProxyPayload, (proxy) );
404}
void clearProxyPayload(SG::DataProxy *)
use to reset a proxy (clearing the data object it contains) Unlike DataProxy::reset this method corre...

◆ clearStore()

StatusCode StoreGateSvc::clearStore ( bool forceRemove = false)
finaloverridevirtual

clear DataStore contents: called by the event loop mgrs

Parameters
forceRemoveif true remove proxies ignoring their resetOnly flag

Definition at line 416 of file StoreGateSvc.cxx.

417{
418 StatusCode sc = currentStore()->clearStore(forceRemove);
419
420 // See if we want to send a ClearStore incident.
421 // If m_pruneIncidents is true then we check the first time
422 // to see if there are any listeners. If not, then we avoid
423 // sending these incidents for the rest of the job.
424 if (m_pruneIncidents) {
425 if (m_listenerState == UNCHECKED) {
426 std::vector<IIncidentListener*> l;
427 m_incSvc->getListeners (l, "StoreCleared");
429 }
431 return sc;
432 }
433 }
434
435 // Send a notification that the store was cleared.
436 if (sc.isSuccess()) {
437 m_incSvc->fireIncident(StoreClearedIncident (this, name()));
438 }
439 return sc;
440}
static Double_t sc
virtual StatusCode clearStore(bool forceRemove=false) override final
clear DataStore contents: called by the event loop mgrs
Gaudi::Property< bool > m_pruneIncidents
SGImplSvc * currentStore() const
returns pointer to the current SGImplSvc
std::atomic< ListenerState > m_listenerState
ServiceHandle< IIncidentSvc > m_incSvc
::StatusCode StatusCode
StatusCode definition for legacy code.
l
Printing final latex table to .tex output file.

◆ clid()

template<typename TKEY>
CLID StoreGateSvc::clid ( const TKEY & key) const

Retrieve the main CLID of the object recorded in StoreGate with the given "key" WARNING: slow!

◆ clids()

vector< CLID > StoreGateSvc::clids ( ) const

Return all CLIDs in the store.

Definition at line 291 of file StoreGateSvc.cxx.

292{
293 vector<CLID> nullV;
294 _SGXCALL(clids, (), nullV);
295}
std::vector< CLID > clids() const
Return all CLIDs in the store.

◆ commitNewDataObjects()

void StoreGateSvc::commitNewDataObjects ( )
finaloverridevirtual

Reset handles added since the last call to commit.

Definition at line 83 of file StoreGateSvc.cxx.

83 {
84 _SGVOIDCALL(commitNewDataObjects, ());
85}
virtual void commitNewDataObjects() override final
Reset handles added since the last call to commit.

◆ contains() [1/2]

template<typename TKEY>
bool StoreGateSvc::contains ( const CLID & id,
const TKEY & key ) const

Look up a keyed object in TDS by CLID.

returns false if object not available in TDS or persistent stores Usage: if (!p_store->contains(FooID, "fooKey")) { ... }

◆ contains() [2/2]

template<typename T, typename TKEY>
bool StoreGateSvc::contains ( const TKEY & key) const

Look up a keyed object in TDS (compare also tryRetrieve) returns false if object not available in TDS or persistent stores Usage: if (!p_store->contains<Foo>("fooKey")) { ... }.

◆ create()

template<typename T, typename TKEY, typename... ARGS>
SG::WPtr< T > StoreGateSvc::create ( const TKEY & key,
ARGS... constructorArgs )

Create an object with one of its constructors and record it with a key.

Parameters
keya string (or an object convertible to a string) identifying the object within the event
constructorArgsa variable list of args passed to the constructor
Returns
a "pointer" to the created object (set to 0 if creation failed) Example: struct Foo { int m_i; int i() const { return m_i; } Foo(int i) : m_i(i) {} }; CLASS_DEF(Foo, 123456, 1); .... auto pFoo = pSG.create<Foo>("aFoo", 23); assert(pFoo->i()==23); assert(pSG.transientContains<Foo>("aFoo"));

◆ createKey()

std::string StoreGateSvc::createKey ( const CLID & dataID)
private

creates a key internally if none specified by client

◆ createObj()

StatusCode StoreGateSvc::createObj ( IConverter * cvt,
IOpaqueAddress * addr,
DataObject *& refpObject )
overridevirtual

Call converter to create an object, with locking.

Parameters
cvtThe converter to call.
addrOpaque address information for the object to create.
refpObjectReference to location of the pointer of the created object.

This calls the createObj method on cvt to create the referenced transient object, locking the store during the call.

Definition at line 472 of file StoreGateSvc.cxx.

475{
476 _SGXCALL( createObj, (cvt, addr, refpObject), StatusCode::FAILURE );
477}
virtual StatusCode createObj(IConverter *cvt, IOpaqueAddress *addr, DataObject *&refpObject) override
Call converter to create an object, with locking.

◆ currentSlot()

SG::HiveEventSlot * StoreGateSvc::currentSlot ( )
staticprivate

Definition at line 75 of file StoreGateSvc.cxx.

75 {
76 return currentHiveEventSlot;
77}

◆ currentStore()

SGImplSvc * StoreGateSvc::currentStore ( ) const
private

returns pointer to the current SGImplSvc

◆ currentStoreGate()

StoreGateSvc * StoreGateSvc::currentStoreGate ( )
static

get current StoreGate

Definition at line 58 of file StoreGateSvc.cxx.

58 {
59 if (!::currentStoreGate) {
60 // this is a static function so we don't have many conveniences
61 ISvcLocator *svcLocator = Gaudi::svcLocator();
62 SmartIF<StoreGateSvc> sg{svcLocator->service("StoreGateSvc/StoreGateSvc")};
63 if ( !sg.isValid() ) {
64 throw GaudiException(
65 "Could not get \"StoreGateSvc\" to initialize currentStoreGate",
66 "StoreGateSvc", StatusCode::FAILURE);
67 }
68 sg->makeCurrent();
69 return sg;
70 }
71 return ::currentStoreGate;
72}
static StoreGateSvc * currentStoreGate()
get current StoreGate

◆ dump()

std::string StoreGateSvc::dump ( ) const

dump objects in store.

request forwarded to DataStore this is triggered at EndEvent setting the Dump property to true

Definition at line 356 of file StoreGateSvc.cxx.

356 {
357 std::string nullS = "\n>>>>>>>NO CURRENT STORE<<<<<<<\n";
358 _SGXCALL(dump, (), nullS);
359}
std::string dump() const
dump objects in store.

◆ emptyTrash()

void StoreGateSvc::emptyTrash ( )
private

throw away bad objects

Definition at line 443 of file StoreGateSvc.cxx.

443 {
444 _SGVOIDCALL( emptyTrash, () );
445}
void emptyTrash()
throw away bad objects

◆ finalize()

StatusCode StoreGateSvc::finalize ( )
overridevirtual

Definition at line 193 of file StoreGateSvc.cxx.

193 {
194 CHECK( Service::finalize() );
195 SG_MSG_VERBOSE ("Finalizing {}", name());
196 if (m_defaultStore) {
197 // m_defaultStore is not active, so ServiceManager won't finalize it!
198 CHECK( m_defaultStore->finalize());
199 }
200
201 printBadList (m_badRetrieves, "retrieve()");
202 printBadList (m_badRecords, "record()");
203 return StatusCode::SUCCESS;
204}
#define CHECK(...)
Evaluate an expression and check for errors.
#define SG_MSG_VERBOSE(x,...)
SmartIF< SGImplSvc > m_defaultStore
void printBadList(const BadItemList &bad, const std::string &what) const
Print out a list of bad calls during finalization.

◆ handle()

void StoreGateSvc::handle ( const Incident & inc)
finaloverridevirtual

Definition at line 186 of file StoreGateSvc.cxx.

186 {
187 currentStore()->handle(inc);
188}
virtual void handle(const Incident &) override final
triggered by Incident service

◆ hiveProxyDict()

virtual::IProxyDict * StoreGateSvc::hiveProxyDict ( )
inlinefinaloverride

implements IHiveStore interface

Definition at line 367 of file StoreGateSvc.h.

367 {
369 }

◆ initialize()

StatusCode StoreGateSvc::initialize ( )
overridevirtual

Service initialization.

Definition at line 114 of file StoreGateSvc.cxx.

114 {
115
116 // Initialize service:
117 CHECK( Service::initialize() );
118
119 SG_MSG_VERBOSE ("Initializing {}", name());
120
121 SmartIF<Gaudi::Interfaces::IOptionsSvc> pJOSvc{serviceLocator()->service("JobOptionsSvc")};
122 if ( !pJOSvc.isValid() ) {
123 SG_MSG_ERROR ("Failed to retrieve JobOptionsSvc");
124 }
125 //copy our properties to the prototype (default) SGImplSvc
126 const std::string implStoreName = name() + "_Impl";
127 for (const Gaudi::Details::PropertyBase* p : getProperties()) {
128 pJOSvc->set( implStoreName + "." + p->name(), p->toString() );
129 }
130
131 //HACK ALERT: using createService rather then the customary service(...,CREATEIF=true) we set our pointer
132 // to SGImplSvc early (even before it is initialized). This should help take care of some initialize loops
133 // for example when we try to record an address from one of the address providers initialize methods
134
135 std::string implStoreFullName = "SGImplSvc/" + implStoreName;
136 SG_MSG_DEBUG ("trying to create store {}", implStoreFullName);
137
138 m_defaultStore = serviceLocator().as<ISvcManager>()->createService(implStoreFullName);
139
140 if (!m_defaultStore) {
141 SG_MSG_ERROR ("Could not create store {}", implStoreFullName);
142 return StatusCode::FAILURE;
143 }
144
145 if ( m_defaultStore->sysInitialize().isSuccess() ) {
146 // If this is the default event store (StoreGateSvc), then declare
147 // our arena as the default for memory allocations.
148 if (name() == "StoreGateSvc") {
149 m_defaultStore->makeCurrent();
150 }
151 } else {
152 SG_MSG_ERROR ("Could not initialize default store {}", implStoreFullName);
153 return StatusCode::FAILURE;
154 }
155 if ( !m_incSvc.retrieve().isSuccess() ) {
156 SG_MSG_ERROR ("Could not locate IncidentSvc");
157 return StatusCode::FAILURE;
158 }
159
160 // Don't retrieve m_activeStoreSvc here to prevent a possible
161 // initialization loop.
162
163 if (m_DumpStore) {
164 const int PRIORITY=100;
165 m_incSvc->addListener(this, "EndEvent",PRIORITY);
166 }
167
168 return StatusCode::SUCCESS;
169}
#define SG_MSG_DEBUG(x,...)
#define SG_MSG_ERROR(x,...)
Gaudi::Property< bool > m_DumpStore
createService(typeName, serviceName, sequence=None)

◆ isSymLinked()

bool StoreGateSvc::isSymLinked ( const CLID & linkID,
SG::DataProxy * dp )
private

◆ keys() [1/2]

void StoreGateSvc::keys ( const CLID & id,
std::vector< std::string > & vkeys,
bool includeAlias = false,
bool onlyValid = true ) const

provide list of all StoreGate keys associated with an object.

usage: p_store->keys(CLID, vkeys, optionalFlags);

Parameters
idCLID for which we are requesting list of keys
vkeyswill be filled with the (possibly empty) list of keys
includeAlias(default false) add alias keys as well
onlyValid(default true) add only keys of valid dobjs

Definition at line 347 of file StoreGateSvc.cxx.

349{
350 _SGVOIDCALL(keys,(id, vkeys, includeAlias, onlyValid));
351}
void keys(std::vector< std::string > &vkeys, bool includeAlias=false, bool onlyValid=true) const
provide list of all StoreGate keys associated with an object.

◆ keys() [2/2]

template<typename T>
void StoreGateSvc::keys ( std::vector< std::string > & vkeys,
bool includeAlias = false,
bool onlyValid = true ) const

provide list of all StoreGate keys associated with an object.

usage: p_store->keys<T>(vkeys, optional flags);

Parameters
vkeyswill be filled with the (possibly empty) list of keys
includeAlias(default false) add alias keys as well
onlyValid(default true) add only keys of valid dobjs

◆ keyToString() [1/2]

const std::string * StoreGateSvc::keyToString ( sgkey_t key) const
finaloverridevirtual

Find the string corresponding to a given key.

Parameters
keyThe key to look up.
Returns
Pointer to the string found, or null. We can find keys as long as the corresponding string was given to either stringToKey() or registerKey().

Definition at line 368 of file StoreGateSvc.cxx.

368 {
369 _SGXCALL( keyToString, (key), 0 );
370}
virtual const std::string * keyToString(sgkey_t key) const override final
Find the string corresponding to a given key.

◆ keyToString() [2/2]

const std::string * StoreGateSvc::keyToString ( sgkey_t key,
CLID & clid ) const
finaloverridevirtual

Find the string and CLID corresponding to a given key.

Parameters
keyThe key to look up.
clid[out]The found CLID.
Returns
Pointer to the string found, or null. We can find keys as long as the corresponding string was given to either stringToKey() or registerKey().

Definition at line 373 of file StoreGateSvc.cxx.

373 {
374 _SGXCALL( keyToString, (key, clid), 0 );
375}
CLID clid(const TKEY &key) const
Retrieve the main CLID of the object recorded in StoreGate with the given "key" WARNING: slow!

◆ loadEventProxies()

StatusCode StoreGateSvc::loadEventProxies ( )

load proxies at begin event

Definition at line 408 of file StoreGateSvc.cxx.

408 {
409 this->makeCurrent();
410 _SGXCALL(loadEventProxies, (), StatusCode::FAILURE);
411}
StatusCode loadEventProxies()
load proxies at begin event
void makeCurrent()
The current store is becoming the active store.

◆ makeCurrent()

void StoreGateSvc::makeCurrent ( )

The current store is becoming the active store.

Switch the allocation arena, and call SG::CurrentEventStore::setStore NOTE: No longer only intended to be called by ActiveStoreSvc.

Make this the current StoreGate, switch the allocation arena, and call sg::currenteventstore::setstore

Definition at line 450 of file StoreGateSvc.cxx.

450 {
451 ::currentStoreGate = this;
452 _SGVOIDCALL (makeCurrent, ());
453}

◆ msg_update_handler()

void StoreGateSvc::msg_update_handler ( Gaudi::Details::PropertyBase & outputLevel)
private

callback for output level property

◆ operator=()

StoreGateSvc & StoreGateSvc::operator= ( const StoreGateSvc & )
private

◆ overwrite()

template<typename T, KeyConcept TKEY>
StatusCode StoreGateSvc::overwrite ( std::unique_ptr< T > pUnique,
const TKEY & key,
bool allowMods,
bool noHist = false )

Record an object with a key, overwriting any existing object with same key.

◆ printBadList()

void StoreGateSvc::printBadList ( const BadItemList & bad,
const std::string & what ) const
private

Print out a list of bad calls during finalization.

Parameters
badList of bad calls.
whatDescription of the operation.

Definition at line 509 of file StoreGateSvc.cxx.

511{
512 if (bad.empty()) return;
513 std::vector<std::string> lines;
514 for (const BadListItem& id : bad) {
515 lines.push_back (id.fullKey() + " [" + id.m_algo + "]");
516 }
517 std::sort (lines.begin(), lines.end());
518 SG_MSG_WARNING ("Called {} on these objects in a MT store", what);
519 for (const std::string& s : lines) {
520 SG_MSG_WARNING (s);
521 }
522}
#define SG_MSG_WARNING(x,...)
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.

◆ proxies()

vector< const SG::DataProxy * > StoreGateSvc::proxies ( ) const
finaloverridevirtual

return the list of all current proxies in store

Definition at line 284 of file StoreGateSvc.cxx.

284 {
285 vector<const SG::DataProxy*> nullV;
286 _SGXCALL(proxies, (), nullV);
287}
virtual std::vector< const SG::DataProxy * > proxies() const override final
return the list of all current proxies in store

◆ proxy() [1/7]

DataProxy * StoreGateSvc::proxy ( const CLID & id) const
finalvirtual

get default proxy with given id. Returns 0 to flag failure

Definition at line 215 of file StoreGateSvc.cxx.

215 {
216 _SGXCALL(proxy, (id), 0);
217}

◆ proxy() [2/7]

SG::DataProxy * StoreGateSvc::proxy ( const CLID & id,
bool checkValid ) const
finalvirtual

get default proxy with given id, optionally checking validity.

Returns
0 to flag failure

Definition at line 229 of file StoreGateSvc.cxx.

229 {
230 _SGXCALL(proxy, (id, checkValid), 0);
231}

◆ proxy() [3/7]

SG::DataProxy * StoreGateSvc::proxy ( const CLID & id,
const char * key ) const

get proxy with given id and key.

Returns 0 to flag failure (overload to prevent a char* to be interpreted as a bool.)

◆ proxy() [4/7]

virtual SG::DataProxy * StoreGateSvc::proxy ( const CLID & id,
const char * key,
bool checkValid ) const
inlinefinalvirtual

get proxy with given id and key, optionally checking validity.

Returns
0 to flag failure (overload to prevent a char* to be interpreted as a bool.)

Definition at line 454 of file StoreGateSvc.h.

455 { return this->proxy(id, std::string(key), checkValid); }

◆ proxy() [5/7]

DataProxy * StoreGateSvc::proxy ( const CLID & id,
const std::string & key ) const
finaloverridevirtual

get proxy with given id and key. Returns 0 to flag failure

Definition at line 221 of file StoreGateSvc.cxx.

221 {
222 _SGXCALL(proxy, (id, key), 0);
223}

◆ proxy() [6/7]

SG::DataProxy * StoreGateSvc::proxy ( const CLID & id,
const std::string & key,
bool checkValid ) const
finalvirtual

get proxy with given id and key, optionally checking validity.

Returns
0 to flag failure

Definition at line 236 of file StoreGateSvc.cxx.

236 {
237 _SGXCALL(proxy, (id, key, checkValid), 0);
238}

◆ proxy() [7/7]

DataProxy * StoreGateSvc::proxy ( const void *const pTransient) const
finaloverridevirtual

get proxy for a given data object address in memory

Definition at line 209 of file StoreGateSvc.cxx.

209 {
210 _SGXCALL(proxy, (pTransient), 0);
211}

◆ proxy_exact()

virtual SG::DataProxy * StoreGateSvc::proxy_exact ( SG::sgkey_t sgkey) const
finaloverridevirtual

Get proxy given a hashed key+clid.

Find an exact match; no handling of aliases, etc. Returns 0 to flag failure.

◆ proxyProviderSvc()

IProxyProviderSvc * StoreGateSvc::proxyProviderSvc ( )

Return current ProxyProviderSvc.

◆ record() [1/6]

template<typename T, typename TKEY>
StatusCode StoreGateSvc::record ( const T * p2BRegistered,
const TKEY & key )

Record a const object with a key.

◆ record() [2/6]

template<typename T, typename TKEY>
StatusCode StoreGateSvc::record ( std::unique_ptr< const T > pUnique,
const TKEY & key )

Record a const object with a key.

◆ record() [3/6]

template<typename T, typename TKEY>
StatusCode StoreGateSvc::record ( std::unique_ptr< T > pUnique,
const TKEY & key )

Record an object with a key, take ownership of the unique_ptr obj.

◆ record() [4/6]

template<typename T, typename TKEY>
StatusCode StoreGateSvc::record ( std::unique_ptr< T > pUnique,
const TKEY & key,
bool allowMods,
bool resetOnly = true,
bool noHist = false )

Record an object with a key, allow possibility of specifying const-access.

◆ record() [5/6]

template<typename T, typename TKEY>
StatusCode StoreGateSvc::record ( T * p2BRegistered,
const TKEY & key )

Record an object with a key.

◆ record() [6/6]

template<typename T, typename TKEY>
StatusCode StoreGateSvc::record ( T * p2BRegistered,
const TKEY & key,
bool allowMods,
bool resetOnly = true,
bool noHist = false )

Record an object with a key, allow possibility of specifying const-access.

◆ record1()

template<typename T, typename TKEY>
requires KeyConcept<TKEY>
StatusCode StoreGateSvc::record1 ( DataObject * obj,
T * pObject,
const TKEY & key,
bool allowMods,
bool resetOnly = true,
bool noHist = false )
private

◆ recordAddress() [1/2]

StatusCode StoreGateSvc::recordAddress ( const std::string & skey,
CxxUtils::RefCountedPtr< IOpaqueAddress > pAddress,
bool clearAddressFlag = true,
const std::vector< CLID > & bases = {} )

Create a proxy object using an IOpaqueAddress and a transient key.

Definition at line 89 of file StoreGateSvc.cxx.

93{
94 _SGXCALL(recordAddress, (skey, std::move(pAddress), clearAddressFlag, bases), StatusCode::FAILURE);
95}
StatusCode recordAddress(const std::string &skey, CxxUtils::RefCountedPtr< IOpaqueAddress > pAddress, bool clearAddressFlag=true, const std::vector< CLID > &bases={})
Create a proxy object using an IOpaqueAddress and a transient key.

◆ recordAddress() [2/2]

StatusCode StoreGateSvc::recordAddress ( CxxUtils::RefCountedPtr< IOpaqueAddress > pAddress,
bool clearAddressFlag = true,
const std::vector< CLID > & bases = {} )

Create a proxy object using an IOpaqueAddress.

Definition at line 98 of file StoreGateSvc.cxx.

101{
102 _SGXCALL(recordAddress, (std::move(pAddress), clearAddressFlag, bases), StatusCode::FAILURE);
103}

◆ recordObject()

SG::DataProxy * StoreGateSvc::recordObject ( SG::DataObjectSharedPtr< DataObject > obj,
const std::string & key,
bool allowMods,
bool returnExisting )
finaloverridevirtual

Record an object in the store.

Parameters
objThe data object to store.
keyThe key as which it should be stored.
allowModsIf false, the object will be recorded as const.
returnExistingIf true, return proxy if this key already exists. If the object has been recorded under a different key, then make an alias. If the object has been recorded under a different clid, then make a link.

Full-blown record. obj should usually be something deriving from SG::DataBucket.

Returns the proxy for the recorded object; nullptr on failure. If the requested CLID/key combination already exists in the store, the behavior is controlled by returnExisting. If true, then the existing proxy is returned; otherwise, nullptr is returned. In either case, obj is destroyed.

Definition at line 273 of file StoreGateSvc.cxx.

277{
278 _SGXCALL(recordObject, (std::move(obj), key, allowMods, returnExisting), nullptr);
279}
virtual SG::DataProxy * recordObject(SG::DataObjectSharedPtr< DataObject > obj, const std::string &key, bool allowMods, bool returnExisting) override final
Record an object in the store.

◆ recycle()

void StoreGateSvc::recycle ( DataObject * pBadDObj)
private

put a bad (unrecordable) dobj away

◆ registerKey()

void StoreGateSvc::registerKey ( sgkey_t key,
const std::string & str,
CLID clidid )
finaloverridevirtual

Remember an additional mapping from key to string/CLID.

Parameters
keyThe key to enter.
strThe string to enter.
clidThe CLID associated with the string.
Returns
True if successful; false if the key already corresponds to a different string.

This registers an additional mapping from a key to a string; it can be found later through lookup() on the string. Logs an error if key already corresponds to a different string.

Definition at line 378 of file StoreGateSvc.cxx.

380 {
381 _SGVOIDCALL( registerKey, (key, str, clidid) );
382}
virtual void registerKey(sgkey_t key, const std::string &str, CLID clidid) override final
Remember an additional mapping from key to string/CLID.

◆ releaseObject()

void StoreGateSvc::releaseObject ( const CLID & id,
const std::string & key )
private

release object held by proxy, if any.

Gives up ownership (somebody else must take charge)

Definition at line 397 of file StoreGateSvc.cxx.

397 {
398 _SGVOIDCALL( releaseObject, (id, key) );
399}
void releaseObject(const CLID &id, const std::string &key)
release object held by proxy, if any.

◆ remap()

template<class TKEY>
void StoreGateSvc::remap ( CLID clid,
const TKEY & source,
const TKEY & target,
off_t index_offset )

Declare a remapping.

clid Class ID of the container being remapped.

source Key of the container being remapped.

target Key of the container being remapped to.

index_offset Amount by which the index should be adjusted between the two containers.

This can be used to change the container to which ElementLink's (and DataLink's) point on output.

For example, suppose you have two containers of type T, A and B. There possibly are ElementLink's pointing at elements contained in them. You want to change to a single container C, containing the contents of A and B concatenated. To get ElementLink's updated on output, you can do:

m_sg->remap (ClassID_traits<T>::ID(), "A", "C", 0);
m_sg->remap (ClassID_traits<T>::ID(), "B", "C", a.size());
static Double_t a

◆ remap_impl()

void StoreGateSvc::remap_impl ( sgkey_t source,
sgkey_t target,
off_t index_offset )

Declare a remapping.

source Key hash of the container being remapped.

target Key hash of the container being remapped to.

index_offset Amount by which the index should be adjusted between the two containers.

Definition at line 384 of file StoreGateSvc.cxx.

386 {
387 _SGVOIDCALL( remap_impl, (source, target, index_offset) );
388}
void remap_impl(sgkey_t source, sgkey_t target, off_t index_offset)
Declare a remapping.

◆ rememberBad()

void StoreGateSvc::rememberBad ( BadItemList & bad,
CLID clid,
const std::string & key ) const
private

Remember that retrieve or record was called for a MT store.

Parameters
badThe list on which to store the operation.
clidCLID of the operation.
keyKey of the operation.

Definition at line 486 of file StoreGateSvc.cxx.

488{
489 if (m_storeID == StoreID::EVENT_STORE && currentHiveEventSlot != nullptr) {
491 std::string algo;
492 if (m_algContextSvc.isValid()) {
493 if (IAlgorithm* alg = m_algContextSvc->currentAlg()) {
494 if (alg->type() == "AthenaOutputStream") return;
495 if (alg->type() == "AthIncFirerAlg") return;
496 algo = alg->type() + "/" + alg->name();
497 bad.insert (BadListItem (clid, key, algo));
498 }
499 }
500 }
501}
std::lock_guard< mutex_t > lock_t
ServiceHandle< IAlgContextSvc > m_algContextSvc
mutex_t m_badMutex
@ EVENT_STORE
Definition StoreID.h:26
virtual void lock() override
Lock the container.

◆ rememberBadRecord()

void StoreGateSvc::rememberBadRecord ( CLID clid,
const std::string & key ) const
private

Remember that retrieve() was called for a MT store.

Parameters
clidCLID of the operation.
keyKey of the operation.

◆ rememberBadRetrieve()

void StoreGateSvc::rememberBadRetrieve ( CLID clid,
const std::string & key ) const
private

Remember that retrieve() was called for a MT store.

Parameters
clidCLID of the operation.
keyKey of the operation.

◆ remove()

template<typename T>
StatusCode StoreGateSvc::remove ( const T * pObject)

Remove pObject, will remove its proxy if not reset only.

◆ removeDataAndProxy()

template<typename T>
StatusCode StoreGateSvc::removeDataAndProxy ( const T * pObject)

Remove pObject and its proxy no matter what.

◆ removeProxy()

StatusCode StoreGateSvc::removeProxy ( SG::DataProxy * proxy,
const void * pTrans,
bool forceRemove = false )
private

remove proxy from store, unless it is reset only.


provide pTrans!=0 (must match proxy...) to save time

Parameters
forceRemoveremove the proxy no matter what DO NOT USE THIS FUNCTION! IT IS UNSAFE AND IS LIKELY TO BE REMOVED!

Definition at line 455 of file StoreGateSvc.cxx.

456 {
457 _SGXCALL(removeProxy, (proxy, pTrans, forceRemove), StatusCode::FAILURE);
458}
StatusCode removeProxy(SG::DataProxy *proxy, const void *pTrans, bool forceRemove=false)
remove proxy from store, unless it is reset only.

◆ retrieve() [1/10]

template<typename T>
T * StoreGateSvc::retrieve ( ) const

Variant of the above which doesn't return a status code.

Just returns null if the object isn't found.

◆ retrieve() [2/10]

StatusCode StoreGateSvc::retrieve ( CLID id,
SG::TypelessIterator & begin,
SG::TypelessIterator & end ) const

Retrieve all objects of type CLID: returns an SG::ConstIterator range.

Definition at line 41 of file StoreGateSvc.cxx.

43 {
44 if (m_storeID == StoreID::EVENT_STORE && currentSlot() != nullptr) {
45 rememberBadRetrieve (id, "(iterator)");
46 }
47 _SGXCALL(retrieve, (id, begin, end), StatusCode::FAILURE);
48}
static SG::HiveEventSlot * currentSlot()
StatusCode retrieve(const T *&ptr) const
Retrieve the default object into a const T*.
void rememberBadRetrieve(CLID clid, const std::string &key) const
Remember that retrieve() was called for a MT store.

◆ retrieve() [3/10]

template<typename T>
StatusCode StoreGateSvc::retrieve ( const T *& ptr) const

Retrieve the default object into a const T*.

◆ retrieve() [4/10]

template<typename T>
StatusCode StoreGateSvc::retrieve ( const T *& ptr,
const std::string & key ) const

Retrieve an object with "key", into a const T*.

Overload for std::string KEY type

◆ retrieve() [5/10]

template<typename T, typename TKEY>
requires KeyConcept<TKEY>
StatusCode StoreGateSvc::retrieve ( const T *& ptr,
const TKEY & key ) const

Retrieve an object with "key", into a const T*.

◆ retrieve() [6/10]

template<typename T, class TKEY>
T * StoreGateSvc::retrieve ( const TKEY & key) const

Variant of the above which doesn't return a status code.

Just returns null if the object isn't found.

◆ retrieve() [7/10]

template<typename T>
StatusCode StoreGateSvc::retrieve ( SG::ConstIterator< T > & begin,
SG::ConstIterator< T > & end ) const

Retrieve all objects of type T: returns an SG::ConstIterator range.

◆ retrieve() [8/10]

template<typename T>
StatusCode StoreGateSvc::retrieve ( T *& ptr) const

Retrieve the default object into a T*.

◆ retrieve() [9/10]

template<typename T>
StatusCode StoreGateSvc::retrieve ( T *& ptr,
const std::string & key ) const

Retrieve an object with "key", into a T*.

Overload for std::string KEY type

◆ retrieve() [10/10]

template<typename T, typename TKEY>
requires KeyConcept<TKEY>
StatusCode StoreGateSvc::retrieve ( T *& ptr,
const TKEY & key ) const

Retrieve an object with "key", into a T*.

◆ setAlias()

template<typename T, typename AKEY>
requires KeyConcept<AKEY>
StatusCode StoreGateSvc::setAlias ( const T * p2BAliased,
const AKEY & aliasKey )

make an alias to a DataObject (provide only valid pointer)

◆ setConst()

StatusCode StoreGateSvc::setConst ( const void * pointer)

prevent downstream clients from modifying the pointed-at dobj

Definition at line 107 of file StoreGateSvc.cxx.

107 {
108 _SGXCALL(setConst, (pObject), StatusCode::FAILURE);
109}
StatusCode setConst(const void *pointer)
prevent downstream clients from modifying the pointed-at dobj

◆ setProxyProviderSvc()

void StoreGateSvc::setProxyProviderSvc ( IProxyProviderSvc * pPPSvc)

associate ProxyProviderSvc to this store

◆ setSlot()

void StoreGateSvc::setSlot ( SG::HiveEventSlot * pSlot)
static

set the hive event slot pointer: used by the event loop mgrs

Definition at line 51 of file StoreGateSvc.cxx.

51 {
52 currentHiveEventSlot=pSlot;
53 if ( 0 != currentHiveEventSlot) {
54 currentHiveEventSlot->pEvtStore->makeCurrent();
55 }
56}

◆ setStoreID()

void StoreGateSvc::setStoreID ( StoreID::type id)

set store ID. request forwarded to DataStore:

set store id in DataStore:

Definition at line 339 of file StoreGateSvc.cxx.

340{
341 m_storeID = id;
342 // FIXME: should broadcast this to all instances.
343 _SGVOIDCALL(setStoreID,(id));
344}
void setStoreID(StoreID::type id)
set store ID. request forwarded to DataStore:

◆ setupProxy()

SG::DataProxy * StoreGateSvc::setupProxy ( const CLID & dataID,
const std::string & gK,
DataObject * pDObj,
bool allowMods,
bool resetOnly )
private

try to locate a proxy or create it if needed

◆ sourceID()

virtual SG::SourceID StoreGateSvc::sourceID ( const std::string & key = "EventSelector") const
overridevirtual

Return the metadata source ID for the current event slot.

Parameters
keySG key of the DataHeader to query. Returns an empty string if no source has been set.

The default version always returns an empty string.

◆ stop()

StatusCode StoreGateSvc::stop ( )
overridevirtual

Service start.

Definition at line 172 of file StoreGateSvc.cxx.

172 {
173 SG_MSG_VERBOSE ("Stop {}", name());
174 //HACK ALERT: ID event store objects refer to det store objects
175 //by setting an ad-hoc priority for event store(s) we make sure they are finalized and hence cleared first
176 // see e.g. https://savannah.cern.ch/bugs/index.php?99993
177 if (m_defaultStore->store()->storeID() == StoreID::EVENT_STORE) {
178 auto pISM = serviceLocator().as<ISvcManager>();
179 pISM->setPriority(name(), pISM->getPriority(name())+1).ignore();
180 SG_MSG_VERBOSE ("stop: setting service priority to {} so that event stores get finalized and cleared before other stores",
181 pISM->getPriority(name()));
182 }
183 return StatusCode::SUCCESS;
184}

◆ storeID()

virtual StoreID::type StoreGateSvc::storeID ( ) const
overridevirtual

get store ID. request forwarded to DataStore:

◆ stringToKey()

StoreGateSvc::sgkey_t StoreGateSvc::stringToKey ( const std::string & str,
CLID clid )
finaloverridevirtual

Find the key for a string/CLID pair.

Parameters
strThe string to look up.
clidThe CLID associated with the string.
Returns
A key identifying the string. A given string will always return the same key. Will abort in case of a hash collision!

Definition at line 363 of file StoreGateSvc.cxx.

363 {
364 _SGXCALL( stringToKey, (str, clid), 0 );
365}
virtual sgkey_t stringToKey(const std::string &str, CLID clid) override final
Find the key for a string/CLID pair.

◆ symLink()

template<KeyConcept TKEY>
StatusCode StoreGateSvc::symLink ( const CLID id,
const TKEY & key,
const CLID linkid )

make a soft link to the object pointed by id/key

◆ t2pRegister()

StatusCode StoreGateSvc::t2pRegister ( const void *const pTrans,
SG::DataProxy *const pPers )
private

forwarded to DataStore

◆ t2pRemove()

void StoreGateSvc::t2pRemove ( const void *const pTrans)
private

forwarded to DataStore

◆ transientContains() [1/2]

template<typename TKEY>
bool StoreGateSvc::transientContains ( const CLID & id,
const TKEY & key ) const

Look up a transient data object in TDS only by CLID.

returns false if object not available in TDS

◆ transientContains() [2/2]

template<typename T, typename TKEY>
bool StoreGateSvc::transientContains ( const TKEY & key) const

Look up a transient data object in TDS only (no Proxy lookup) returns false if object not available in TDS Usage: if (!p_store->contains<Foo>("fooKey")) { ... }.

◆ transientProxy()

SG::DataProxy * StoreGateSvc::transientProxy ( const CLID & id,
const std::string & key ) const

get proxy with given id and key.

Does not query ProxyProviderSvc.

Returns
0 to flag failure

Definition at line 300 of file StoreGateSvc.cxx.

300 {
301 _SGXCALL(transientProxy, (id, key), 0);
302}
SG::DataProxy * transientProxy(const CLID &id, const std::string &key) const
get proxy with given id and key.

◆ tryConstRetrieve() [1/2]

template<typename T>
const T * StoreGateSvc::tryConstRetrieve ( ) const

◆ tryConstRetrieve() [2/2]

template<typename T, class TKEY>
requires KeyConcept<TKEY>
const T * StoreGateSvc::tryConstRetrieve ( const TKEY & key) const

◆ tryELRemap()

bool StoreGateSvc::tryELRemap ( sgkey_t sgkey_in,
size_t index_in,
sgkey_t & sgkey_out,
size_t & index_out )
finaloverridevirtual

Test to see if the target of an ElementLink has moved.

Parameters
sgkey_inOriginal hashed key of the EL.
index_inOriginal index of the EL.
sgkey_out[out]New hashed key for the EL.
index_out[out]New index for the EL.
Returns
True if there is a remapping; false otherwise.

Definition at line 391 of file StoreGateSvc.cxx.

392 {
393 _SGXCALL( tryELRemap, (sgkey_in, index_in, sgkey_out, index_out), false );
394}
virtual bool tryELRemap(sgkey_t sgkey_in, size_t index_in, sgkey_t &sgkey_out, size_t &index_out) override final
Test to see if the target of an ElementLink has moved.

◆ tryRetrieve() [1/2]

template<typename T>
T * StoreGateSvc::tryRetrieve ( ) const

Variant of the above which doesn't print a warning message.

Just returns null if the object isn't found. Compare to contains

◆ tryRetrieve() [2/2]

template<typename T, class TKEY>
requires KeyConcept<TKEY>
T * StoreGateSvc::tryRetrieve ( const TKEY & key) const

Variant of the above which doesn't print a warning message.

Just returns null if the object isn't found. Compare to contains

◆ typeless_overwrite()

StatusCode StoreGateSvc::typeless_overwrite ( const CLID & id,
DataObject * obj,
const std::string & key,
const void *const raw_ptr,
bool allowMods,
bool noHist = false,
const std::type_info * tinfo = 0 )
private

same as typeless_record, allows to overwrite an object in memory or on disk

Definition at line 328 of file StoreGateSvc.cxx.

333 {
334 _SGXCALL(typeless_overwrite, (id, obj, key, raw_ptr, allowMods, noHist, tinfo), StatusCode::FAILURE);
335}
StatusCode typeless_overwrite(const CLID &id, DataObject *obj, const std::string &key, const void *const raw_ptr, bool allowMods, bool noHist=false, const std::type_info *tinfo=0)
same as typeless_record, allows to overwrite an object in memory or on disk

◆ typeless_record()

StatusCode StoreGateSvc::typeless_record ( DataObject * obj,
const std::string & key,
const void *const raw_ptr,
bool allowMods,
bool resetOnly = true,
bool noHist = false )
private

type-less recording of an object with a key, allow possibility of specifying const-access and history record

Definition at line 320 of file StoreGateSvc.cxx.

323 {
324 _SGXCALL(typeless_record, (obj, key, raw_ptr, allowMods, resetOnly, noHist), StatusCode::FAILURE);
325}
StatusCode typeless_record(DataObject *obj, const std::string &key, const void *const raw_ptr, bool allowMods, bool resetOnly=true, bool noHist=false)
type-less recording of an object with a key, allow possibility of specifying const-access and history...

◆ AthenaInternal::py_sg_clearProxyPayload

◆ AthenaInternal::recordObjectToStore

PyObject * AthenaInternal::recordObjectToStore ( StoreGateSvc * ,
PyObject * ,
PyObject * ,
bool ,
bool ,
bool  )
friend

◆ IOVDbSvc

friend class IOVDbSvc
friend

access clearProxyPayload

Definition at line 685 of file StoreGateSvc.h.

◆ IOVSvcTool

friend class IOVSvcTool
friend

Definition at line 686 of file StoreGateSvc.h.

◆ PileUpMergeSvc

friend class PileUpMergeSvc
friend

access emptyTrash

Definition at line 683 of file StoreGateSvc.h.

◆ SG::HiveMgrSvc

friend class SG::HiveMgrSvc
friend

Definition at line 670 of file StoreGateSvc.h.

◆ SG::TestHiveStoreSvc

friend class SG::TestHiveStoreSvc
friend

Definition at line 667 of file StoreGateSvc.h.

◆ SG::VarHandleBase

friend class SG::VarHandleBase
friend

access typeless_record

Definition at line 696 of file StoreGateSvc.h.

◆ xAODMaker::AuxStoreWrapper

friend class xAODMaker::AuxStoreWrapper
friend

FIXME: access releaseObject.

Definition at line 676 of file StoreGateSvc.h.

Member Data Documentation

◆ ATLAS_THREAD_SAFE [1/2]

BadItemList m_badRecords StoreGateSvc::ATLAS_THREAD_SAFE
mutableprivate

Definition at line 775 of file StoreGateSvc.h.

◆ ATLAS_THREAD_SAFE [2/2]

BadItemList m_badRetrieves StoreGateSvc::ATLAS_THREAD_SAFE
mutableprivate

Remember calls to retrieve and record for a MT store, so we can warn about them during finalize().

Definition at line 774 of file StoreGateSvc.h.

◆ m_ActivateHistory

Gaudi::Property<bool> StoreGateSvc::m_ActivateHistory {this, "ActivateHistory", false, "record DataObjects history"}
private

Definition at line 657 of file StoreGateSvc.h.

657{this, "ActivateHistory", false, "record DataObjects history"};

◆ m_algContextSvc

ServiceHandle<IAlgContextSvc> StoreGateSvc::m_algContextSvc {this, "AlgContextSvc", "AlgContextSvc"}
private

Definition at line 655 of file StoreGateSvc.h.

655{this, "AlgContextSvc", "AlgContextSvc"};

◆ m_badMutex

mutex_t StoreGateSvc::m_badMutex
mutableprivate

Definition at line 780 of file StoreGateSvc.h.

◆ m_defaultStore

SmartIF<SGImplSvc> StoreGateSvc::m_defaultStore
private

Definition at line 665 of file StoreGateSvc.h.

◆ m_DumpArena

Gaudi::Property<bool> StoreGateSvc::m_DumpArena {this, "DumpArena", false, "Dump Arena usage stats"}
private

Definition at line 658 of file StoreGateSvc.h.

658{this, "DumpArena", false, "Dump Arena usage stats"};

◆ m_DumpStore

Gaudi::Property<bool> StoreGateSvc::m_DumpStore {this, "Dump", false, "Dump contents at EndEvent"}
private

Definition at line 656 of file StoreGateSvc.h.

656{this, "Dump", false, "Dump contents at EndEvent"};

◆ m_incSvc

ServiceHandle<IIncidentSvc> StoreGateSvc::m_incSvc {this, "IncidentSvc", "IncidentSvc"}
private

Definition at line 654 of file StoreGateSvc.h.

654{this, "IncidentSvc", "IncidentSvc"};

◆ m_listenerState

std::atomic<ListenerState> StoreGateSvc::m_listenerState { UNCHECKED }
private

Definition at line 788 of file StoreGateSvc.h.

788{ UNCHECKED };

◆ m_pPPSHandle

ServiceHandle<IProxyProviderSvc> StoreGateSvc::m_pPPSHandle {this, "ProxyProviderSvc", "ProxyProviderSvc"}
private

Properties.

Definition at line 653 of file StoreGateSvc.h.

653{this, "ProxyProviderSvc", "ProxyProviderSvc"};

◆ m_pruneIncidents

Gaudi::Property<bool> StoreGateSvc::m_pruneIncidents {this, "PruneIncidents", false, "Don't send StoreCleared incidents if there are no registered listeners on the first event."}
private

Definition at line 659 of file StoreGateSvc.h.

659{this, "PruneIncidents", false, "Don't send StoreCleared incidents if there are no registered listeners on the first event."};

◆ m_storeID

StoreID::type StoreGateSvc::m_storeID
private

Cache store type in the facade class.

Definition at line 663 of file StoreGateSvc.h.


The documentation for this class was generated from the following files: