![]() |
ATLAS Offline Software
|
A service that caches a pointer to the currently active store. It also implements the IProxyDict store interface. More...
#include <ActiveStoreSvc.h>
Public Types | |
typedef SG::sgkey_t | sgkey_t |
Type of the keys. More... | |
Public Member Functions | |
StoreGateSvc * | activeStore () const |
returns pointer to the active store as StoreGateSvc More... | |
StoreGateSvc * | operator-> () const |
dereference operator to access the active store More... | |
void | setStore (StoreGateSvc *s) |
set the active store pointer: used by the event loop mgrs More... | |
virtual SG::DataProxy * | proxy (const void *const pTransient) const override |
get proxy for a given data object address in memory More... | |
virtual SG::DataProxy * | proxy (const CLID &id, const std::string &key) const override |
get proxy with given id and key. Returns 0 to flag failure More... | |
virtual SG::DataProxy * | proxy_exact (SG::sgkey_t sgkey) const override |
Get proxy given a hashed key+clid. More... | |
virtual std::vector< const SG::DataProxy * > | proxies () const override |
return the list of all current proxies in store More... | |
StatusCode | addToStore (CLID id, SG::DataProxy *proxy) override |
Raw addition of a proxy to the store. More... | |
virtual SG::DataProxy * | recordObject (SG::DataObjectSharedPtr< DataObject > obj, const std::string &key, bool allowMods, bool returnExisting) override |
Record an object in the store. More... | |
virtual sgkey_t | stringToKey (const std::string &str, CLID clid) override |
Find the key for a string/CLID pair. More... | |
virtual const std::string * | keyToString (sgkey_t key) const override |
Find the string corresponding to a given key. More... | |
virtual const std::string * | keyToString (sgkey_t key, CLID &clid) const override |
Find the string and CLID corresponding to a given key. More... | |
virtual void | registerKey (sgkey_t key, const std::string &str, CLID clid) override |
Remember an additional mapping from key to string/CLID. More... | |
virtual StatusCode | initialize () override |
Service initialization. More... | |
virtual StatusCode | queryInterface (const InterfaceID &riid, void **ppvInterface) override |
ActiveStoreSvc (const std::string &name, ISvcLocator *svc) | |
Standard Service Constructor. sets active store to default event store. More... | |
virtual | ~ActiveStoreSvc () override |
Standard Destructor. More... | |
virtual SG::DataProxy * | proxy (const CLID &id, const std::string &key) const=0 |
TEMPORARY: avoid warnings. More... | |
virtual SG::DataProxy * | proxy (const void *const pTransient) const=0 |
TEMPORARY: avoid warnings. More... | |
DeclareInterfaceID (IProxyDict, 2, 0) | |
virtual void | boundHandle (IResetable *handle) |
Tell the store that a handle has been bound to a proxy. More... | |
virtual void | unboundHandle (IResetable *handle) |
Tell the store that a handle has been unbound from a proxy. More... | |
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. More... | |
virtual StatusCode | createObj (IConverter *cvt, IOpaqueAddress *addr, DataObject *&refpObject) |
Call converter to create an object, possibly with locking. More... | |
virtual IProxyDict * | hiveProxyDict () override |
Return the current event-slot-specific store. More... | |
virtual SG::SourceID | sourceID (const std::string &key="EventSelector") const |
Return the metadata source ID for the current event slot. More... | |
Static Public Member Functions | |
static const InterfaceID & | interfaceID () |
not really kosher: should be in IActiveStoreSvc More... | |
Private Member Functions | |
StoreGateSvc * | activeStoreOOL () const |
Private Attributes | |
std::string | m_storeName |
A service that caches a pointer to the currently active store. It also implements the IProxyDict store interface.
In most jobs the active store is simply the default event store (named "StoreGateSvc"). When doing pile-up (and perhaps later on in multi-threaded jobs, the active store changes during the event loop execution. It is important, for example, that converters always refer to the active store rather than to the default one.
Definition at line 29 of file ActiveStoreSvc.h.
|
inherited |
Type of the keys.
Definition at line 34 of file IStringPool.h.
ActiveStoreSvc::ActiveStoreSvc | ( | const std::string & | name, |
ISvcLocator * | svc | ||
) |
Standard Service Constructor. sets active store to default event store.
Standard Constructor.
Definition at line 16 of file ActiveStoreSvc.cxx.
|
overridevirtual |
|
inline |
|
private |
Definition at line 188 of file ActiveStoreSvc.cxx.
|
overridevirtual |
Raw addition of a proxy to the store.
Implements IProxyDict.
Definition at line 73 of file ActiveStoreSvc.cxx.
|
virtualinherited |
Tell the store that a handle has been bound to a proxy.
handle | The handle that was bound. The default implementation does nothing. |
Reimplemented in SGImplSvc.
Definition at line 23 of file IProxyDict.cxx.
|
virtualinherited |
Call converter to create an object, possibly with locking.
cvt | The converter to call. |
addr | Opaque address information for the object to create. |
refpObject | Reference to location of the pointer of the created object. |
This calls the createObj
method on cvt
to create the referenced transient object.
This will also lock the store, if that is required.
The default implementation just forwards the method call, with no locking.
Reimplemented in StoreGateSvc, and SGImplSvc.
Definition at line 70 of file IProxyDict.cxx.
|
inherited |
|
overridevirtualinherited |
Return the current event-slot-specific store.
The default version just returns this.
Reimplemented in StoreGateSvc, and SGImplSvc.
Definition at line 83 of file IProxyDict.cxx.
|
overridevirtual |
|
static |
not really kosher: should be in IActiveStoreSvc
Definition at line 167 of file ActiveStoreSvc.cxx.
Find the string corresponding to a given key.
key | The key to look up. |
stringToKey()
or registerKey()
. Implements IStringPool.
Definition at line 126 of file ActiveStoreSvc.cxx.
Find the string and CLID corresponding to a given key.
key | The key to look up. |
clid[out] | The found CLID. |
stringToKey()
or registerKey()
. Implements IStringPool.
Definition at line 140 of file ActiveStoreSvc.cxx.
|
inline |
dereference operator to access the active store
Definition at line 42 of file ActiveStoreSvc.h.
|
overridevirtual |
return the list of all current proxies in store
Implements IProxyDict.
Definition at line 67 of file ActiveStoreSvc.cxx.
|
overridevirtual |
get proxy with given id and key. Returns 0 to flag failure
Implements IProxyDict.
Definition at line 56 of file ActiveStoreSvc.cxx.
virtual SG::DataProxy* IProxyDict::proxy |
TEMPORARY: avoid warnings.
get proxy for a given data object address in memory
Implements IProxyDict.
Definition at line 50 of file ActiveStoreSvc.cxx.
virtual SG::DataProxy* IProxyDict::proxy |
TEMPORARY: avoid warnings.
|
overridevirtual |
Get proxy given a hashed key+clid.
Find an exact match; no handling of aliases, etc. Returns 0 to flag failure.
Implements IProxyDict.
Definition at line 60 of file ActiveStoreSvc.cxx.
|
overridevirtual |
Definition at line 171 of file ActiveStoreSvc.cxx.
|
overridevirtual |
Record an object in the store.
obj | The data object to store. |
key | The key as which it should be stored. |
allowMods | If false, the object will be recorded as const. |
returnExisting | If true, return proxy if this key already exists. |
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.
Implements IProxyDict.
Definition at line 96 of file ActiveStoreSvc.cxx.
|
overridevirtual |
Remember an additional mapping from key to string/CLID.
key | The key to enter. |
str | The string to enter. |
clid | The CLID associated with the string. |
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.
Implements IStringPool.
Definition at line 159 of file ActiveStoreSvc.cxx.
void ActiveStoreSvc::setStore | ( | StoreGateSvc * | s | ) |
set the active store pointer: used by the event loop mgrs
Definition at line 44 of file ActiveStoreSvc.cxx.
|
virtualinherited |
Return the metadata source ID for the current event slot.
key | SG key of the DataHeader to query. Returns an empty string if no source has been set. |
The default version always returns an empty string.
Reimplemented in StoreGateSvc, and SGImplSvc.
Definition at line 97 of file IProxyDict.cxx.
Find the key for a string/CLID pair.
str | The string to look up. |
clid | The CLID associated with the string. |
Implements IStringPool.
Definition at line 113 of file ActiveStoreSvc.cxx.
|
virtualinherited |
Test to see if the target of an ElementLink has moved.
sgkey_in | Original hashed key of the EL. |
index_in | Original index of the EL. |
sgkey_out[out] | New hashed key for the EL. |
index_out[out] | New index for the EL. |
The default implementation here always returns false.
Reimplemented in StoreGateSvc, and SGImplSvc.
Definition at line 48 of file IProxyDict.cxx.
|
virtualinherited |
Tell the store that a handle has been unbound from a proxy.
handle | The handle that was unbound. The default implementation does nothing. |
Reimplemented in SGImplSvc.
Definition at line 33 of file IProxyDict.cxx.
|
private |
Definition at line 159 of file ActiveStoreSvc.h.