|
ATLAS Offline Software
|
Go to the documentation of this file.
7 #ifndef STOREGATE_SGIMPLSVC_H
8 #define STOREGATE_SGIMPLSVC_H
16 #include "GaudiKernel/IIncidentListener.h"
17 #include "GaudiKernel/Service.h"
18 #include "GaudiKernel/ServiceHandle.h"
19 #include "GaudiKernel/IConverter.h"
22 #include <GaudiKernel/ClassID.h>
23 #include <GaudiKernel/IInterface.h>
24 #include <GaudiKernel/IMessageSvc.h>
25 #include "GaudiKernel/MsgStream.h"
26 #include "Gaudi/Property.h"
27 #include "GaudiKernel/StatusCode.h"
29 #include "GaudiKernel/DataObjID.h"
35 #include <sys/types.h>
50 #include "GaudiKernel/IClassIDSvc.h"
59 #include "GaudiKernel/IIncidentSvc.h"
64 class TransientAddress;
111 public IIncidentListener
137 IOpaqueAddress* pAddress,
bool clearAddressFlag=
true);
171 const std::string& keyA,
const std::string& keyB );
191 std::vector<CLID>
clids(
const std::string&
key )
const;
208 std::string
dump()
const;
224 keys(
const CLID&
id, std::vector<std::string>& vkeys,
225 bool includeAlias =
false,
bool onlyValid =
true);
242 bool trigger =
false);
248 bool trigger =
false);
265 {
return this->
proxy(
id, std::string(
key)); }
292 const std::string&
key,
294 bool returnExisting)
override final;
317 {
return this->
proxy(
id, std::string(
key), checkValid); }
320 virtual std::vector<const SG::DataProxy*>
proxies()
const override final;
403 CLID clidid) override final;
444 sgkey_t& sgkey_out,
size_t& index_out) override final;
472 virtual
void handle(
const Incident&) override final;
533 IOpaqueAddress* addr,
534 DataObject*& refpObject) override;
542 bool resetOnly=true);
552 bool allowMods,
bool resetOnly=true,
560 const std::type_info* tinfo=0);
564 bool allowMods,
bool resetOnly,
566 const std::type_info* tinfo);
569 bool allowMods,
bool resetOnly,
571 const std::type_info* tinfo,
579 bool allowMods,
bool resetOnly,
bool allowOverwrite,
580 const std::type_info* tinfo);
600 bool checkValid = false)
const;
611 friend class
SG::VarHandleBase;
627 const std::
string& gK,
633 void recycle(DataObject* pBadDObj);
654 bool forceRemove=false);
673 const std::type_info* tinfo,
674 bool warn_nobib = true);
740 #include "StoreGate/tools/SGImplSvc.icc"
742 #endif // STOREGATE_SGIMPLSVC_H
Athena service for Interval Of Validity database. The IOVDbSvc may be in one of three time states whi...
bool mergeStringPool(const SGImplSvc &other)
Merge the string pool from another store into this one.
void setProxyProviderSvc(IProxyProviderSvc *pPPSvc)
associate ProxyProviderSvc to this store
bool associateAux_impl(SG::AuxVectorBase *ptr, const std::string &key, CLID auxclid) const
virtual ::IProxyDict * hiveProxyDict() override final
implements IHiveStore interface for compat with Hive
Abstract interface for looking up strings/CLIDs in a pool.
StatusCode setAlias(CLID clid, const std::string &key, const std::string &aliasKey)
make an alias to a DataObject (provide data type and old key)
bool contains(const CLID id, const std::string &key) const
Look up a keyed object in TDS by CLID.
virtual StatusCode createObj(IConverter *cvt, IOpaqueAddress *addr, DataObject *&refpObject) override
Call converter to create an object, with locking.
SGImplSvc & operator=(const SGImplSvc &)=delete
StatusCode addSymLink(const CLID &linkid, SG::DataProxy *dp)
StatusCode setConst(const void *pointer)
prevent downstream clients from modifying the pointed-at dobj
SGImplSvc(const SGImplSvc &)=delete
SG::DataProxy * locatePersistent(const SG::TransientAddress *tAddr, bool checkValid=false) const
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 * recordObject(SG::DataObjectSharedPtr< DataObject > obj, const std::string &key, bool allowMods, bool returnExisting) override final
Record an object in the store.
associate a data object with its VersionedKey
virtual void boundHandle(IResetable *handle) override final
Tell the store that a proxy has been bound to a handle.
StatusCode removeProxy(SG::DataProxy *proxy, const void *pTrans, bool forceRemove=false)
remove proxy from store, unless it is reset only.
an algorithm that resets the data objects listed in a SG::Folder
virtual sgkey_t stringToKey(const std::string &str, CLID clid) override final
Find the key for a string/CLID pair.
std::map< std::thread::id, std::vector< IResetable * > > m_newBoundHandles
Keep track of proxies bound since the last call to commitNewDataObjects or clearStore.
StatusCode proxyRange(const CLID &id, SG::ConstProxyIterator &beg, SG::ConstProxyIterator &end) const
return a range to all proxies of a given CLID
mutex_t m_stringPoolMutex
ServiceHandle< IIncidentSvc > m_pIncSvc
property
void emptyTrash()
throw away bad objects
A service that caches a pointer to the currently active store. It also implements the IProxyDict stor...
std::recursive_mutex mutex_t
void releaseObject(const CLID &id, const std::string &key)
release object held by proxy, if any.
virtual std::vector< const SG::DataProxy * > proxies() const override final
return the list of all current proxies in store
A standard conforming forward iterator over items in StoreGate.
bool const RAWDATA *ch2 const
virtual StatusCode reinitialize() override final
Service reinitialization.
SG::sgkey_t sgkey_t
Type of the keys.
virtual SG::SourceID sourceID(const std::string &key="EventSelector") const override
Return the metadata source ID for the current event slot.
bool m_ActivateHistory
Activate the history service.
bool m_storeLoaded
FIXME hack needed by loadEventProxies.
int m_slotNumber
The Hive slot number for this store, or -1 if this isn't a Hive store.
virtual const std::string * keyToString(sgkey_t key) const override final
Find the string corresponding to a given key.
virtual StatusCode initialize() override final
Service initialization.
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
bool bindHandleToProxyAndRegister(const CLID &id, const std::string &key, IResetable *ir, SG::DataProxy *&dp)
Also do registration with IOVSvc.
StoreID::type storeID() const
get store ID. request forwarded to DataStore:
virtual void unboundHandle(IResetable *handle) override final
Tell the store that a handle has been unbound from a proxy.
The Athena Transient Store API.
a resetable object (e.g. a SG DataHandle)
void SG_dump(SGImplSvc *sg)
These are intended to be easy to call from the debugger.
ServiceHandle< IConversionSvc > m_pDataLoader
bool m_DumpStore
Dump Property flag: triggers dump() at EndEvent.
std::vector< CLID > clids() const
Return all CLIDs in the store.
bool bindHandleToProxy(const CLID &id, const std::string &key, IResetable *ir, SG::DataProxy *&dp)
name says it all
::StatusCode StatusCode
StatusCode definition for legacy code.
SG::Arena m_arena
Allocation arena to associate with this store.
SG::StringPool m_stringpool
DataProxy provides the registry services for StoreGate.
Maintain a mapping of strings to 64-bit ints.
DataObject * accessData(const CLID &id) const
find proxy and access its data. Returns 0 to flag failure
void clearProxyPayload(SG::DataProxy *)
use to reset a proxy (clearing the data object it contains) Unlike DataProxy::reset this method corre...
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
boost::function< StatusCode(IOVSVC_CALLBACK_ARGS) > IOVSvcCallBackFcn
the type of an IOVSvc call back: it wraps both the method and the object the method is called on
The Athena Transient Store API.
bool transientContains(const CLID id, const std::string &key) const
Look up a transient data object in TDS only by CLID.
ServiceHandle< IHistorySvc > m_pHistorySvc
Abstract interface for IOVSvc. This is used (usually via StoreGateSvc regFcn and regHandle methods) t...
AthROOTErrorHandlerSvc * svc
virtual SG::DataProxy * proxy(const CLID &id, const char *key) const final
get proxy with given id and key.
StatusCode remove(const void *pObject)
Remove pObject, will remove its proxy if not reset only.
void remap_impl(sgkey_t source, sgkey_t target, off_t index_offset)
Declare a remapping.
SG::DataProxy * record_impl(DataObject *obj, const std::string &key, const void *const raw_ptr, bool allowMods, bool resetOnly, bool allowOverwrite, const std::type_info *tinfo)
real recording of an object with a key, allow possibility of specifying const-access
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.
uint32_t CLID
The Class ID type.
void msg_update_handler(Gaudi::Details::PropertyBase &outputLevel)
callback for output level property
virtual StatusCode finalize() override final
Service finalization.
StringArrayProperty m_folderNameList
FolderNameList Property.
StatusCode recordAddress(const std::string &skey, IOpaqueAddress *pAddress, bool clearAddressFlag=true)
Create a proxy object using an IOpaqueAddress and a transient key.
StatusCode retrieve(CLID clid, SG::detail::IteratorBase &cibegin, SG::detail::IteratorBase &ciend) const
Retrieve all objects of type T: returns an SG::ConstIterator range.
std::string dump() const
dump objects in store.
virtual void registerKey(sgkey_t key, const std::string &str, CLID clidid) override final
Remember an additional mapping from key to string/CLID.
void setStoreID(StoreID::type id)
set store ID. request forwarded to DataStore:
int typeCount(const CLID &id) const
Return the number of instances of type T (input CLID)
StatusCode record_HistObj(const CLID &id, const std::string &key, const std::string &store, bool allowMods, bool resetOnly=true)
StatusCode removeDataAndProxy(const void *pObject)
Remove pObject and its proxy no matter what.
void recycle(DataObject *pBadDObj)
put a bad (unrecordable) dobj away
bool m_DumpArena
DumpArena Property flag : trigger m_arena->report() at clearStore.
CLID clid(const std::string &key) const
Retrieve the main CLID of the object recorded in StoreGate with the given "key" WARNING: slow!
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...
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
the interface through which HiveWB control StoreGate instances
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvInterface) override final
static const InterfaceID & interfaceID()
Should rather be in ISGImplSvc.h if we had one.
int m_numSlots
The total number of slots. 1 if this isn't a Hive store.
StatusCode symLink(const void *p2BRegistered, CLID linkID)
make a soft link to the object T* already registered
virtual StatusCode addToStore(CLID id, SG::DataProxy *proxy) override final
Raw addition of a proxy to the store.
void py_sg_clearProxyPayload(StoreGateSvc *self, SG::DataProxy *)
ServiceHandle< IClassIDSvc > m_pCLIDSvc
StatusCode addAlias(const std::string &aliasKey, SG::DataProxy *dp)
virtual void handle(const Incident &) override final
triggered by Incident service
int ir
counter of the current depth
Collection of memory allocators with a common lifetime, plus subsystem summary.
SG::DataProxy * transientProxy(const CLID &id, const std::string &key) const
get proxy with given id and key.
ServiceHandle< IIOVSvc > m_pIOVSvc
get the IOVSvc "just in time" (breaks recursion at initialize)
void makeCurrent()
The current store is becoming the active store.
std::list< DataObject * > m_trash
The Recycle Bin.
algorithm that marks for write data objects in SG
virtual StatusCode stop() override final
Service stop.
IProxyProviderSvc * m_pPPS
=============================================================================
std::lock_guard< mutex_t > lock_t
defines and typedefs for IOVSvc
void setSlotNumber(int slot, int numSlots)
Set the Hive slot number for this store.
virtual SG::DataProxy * proxy(const CLID &id, const char *key, bool checkValid) const
get proxy with given id and key, optionally checking validity.
Smart pointer to manage DataObject reference counts.
std::string createKey(const CLID &dataID)
creates a key internally if none specified by client
virtual SG::DataProxy * proxy_exact(SG::sgkey_t sgkey) const override final
Get proxy given a hashed key+clid.
void t2pRemove(const void *const pTrans)
forwarded to DataStore
ServiceHandle< IProxyProviderSvc > m_pPPSHandle
StatusCode regFcn(const CallBackID &c1, const CallBackID &c2, const IOVSvcCallBackFcn &fcn, bool trigger=false)
register a callback function(2) with an already registered function(1)
virtual StatusCode start() override final
Service start.
virtual SG::DataProxy * proxy(const void *const pTransient) const override final
get proxy for a given data object address in memory
bool isSymLinked(const CLID &linkID, SG::DataProxy *dp)
StatusCode t2pRegister(const void *const pTrans, SG::DataProxy *const pPers)
forwarded to DataStore
macros to associate a CLID to a type
IProxyProviderSvc * proxyProviderSvc()
Return current ProxyProviderSvc.
DataObject * typeless_retrievePrivateCopy(const CLID clid, const std::string &key)
PyObject * recordObjectToStore(StoreGateSvc *, PyObject *, PyObject *, bool, bool, bool)
record object to storegate
ProxyMap::const_iterator ConstProxyIterator
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.
SG::RemapImpl * m_remap_impl
bool transientSwap(const CLID &id, const std::string &keyA, const std::string &keyB)
swap the content of 2 keys payload A indexed by keyA will now be accessed via keyB and vice versa Not...
void keys(const CLID &id, std::vector< std::string > &vkeys, bool includeAlias=false, bool onlyValid=true)
provide list of all StoreGate keys associated with an object.
StatusCode loadEventProxies()
load proxies at begin event