ATLAS Offline Software
Public Member Functions | List of all members
SGImplSvc Class Referencefinal

The Athena Transient Store API. More...

#include <SGImplSvc.h>

Inheritance diagram for SGImplSvc:
Collaboration diagram for SGImplSvc:

Public Member Functions

 SGImplSvc (const SGImplSvc &)=delete
 
SGImplSvcoperator= (const SGImplSvc &)=delete
 
Basic Client Interface: data object access
StatusCode retrieve (CLID clid, SG::detail::IteratorBase &cibegin, SG::detail::IteratorBase &ciend) const
 Retrieve all objects of type T: returns an SG::ConstIterator range. More...
 
Advanced Client Interface: data object registration
StatusCode recordAddress (const std::string &skey, IOpaqueAddress *pAddress, bool clearAddressFlag=true)
 Create a proxy object using an IOpaqueAddress and a transient key. More...
 
StatusCode recordAddress (IOpaqueAddress *pAddress, bool clearAddressFlag=true)
 Create a proxy object using an IOpaqueAddress. More...
 
StatusCode symLink (const void *p2BRegistered, CLID linkID)
 make a soft link to the object T* already registered More...
 
StatusCode symLink (const CLID id, const std::string &key, const CLID linkid)
 make a soft link to the object pointed by id/key More...
 
StatusCode setAlias (CLID clid, const std::string &key, const std::string &aliasKey)
 make an alias to a DataObject (provide data type and old key) More...
 
StatusCode setAlias (const void *p2BAliased, const std::string &aliasKey)
 make an alias to a DataObject (provide only valid pointer) More...
 
StatusCode setAlias (SG::DataProxy *proxy, const std::string &aliasKey)
 make an alias to a DataObject (provide valid proxy) More...
 
StatusCode setConst (const void *pointer)
 prevent downstream clients from modifying the pointed-at dobj More...
 
StatusCode remove (const void *pObject)
 Remove pObject, will remove its proxy if not reset only. More...
 
StatusCode removeDataAndProxy (const void *pObject)
 Remove pObject and its proxy no matter what.
More...
 
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 Note that the swap is invalidated at event boundaries and/or when somebody clear the store. More...
 
Advanced Client Interface: data object access
DataObject * typeless_retrievePrivateCopy (const CLID clid, const std::string &key)
 
CLID clid (const std::string &key) const
 Retrieve the main CLID of the object recorded in StoreGate with the given "key" WARNING: slow! More...
 
std::vector< CLIDclids (const std::string &key) const
 Retrieve all the CLID s (including symlinks) of the object recorded in StoreGate with the given "key" WARNING: slow! More...
 
int typeCount (const CLID &id) const
 Return the number of instances of type T (input CLID) More...
 
bool contains (const CLID id, const std::string &key) const
 Look up a keyed object in TDS by CLID. More...
 
bool transientContains (const CLID id, const std::string &key) const
 Look up a transient data object in TDS only by CLID. More...
 
std::string dump () const
 dump objects in store. More...
 
void setStoreID (StoreID::type id)
 set store ID. request forwarded to DataStore: More...
 
StoreID::type storeID () const
 get store ID. request forwarded to DataStore: More...
 
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. More...
 
virtual ::IProxyDicthiveProxyDict () override final
 implements IHiveStore interface for compat with Hive More...
 
IOVSvc interface
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) More...
 
StatusCode regFcn (const std::string &toolName, const CallBackID &c2, const IOVSvcCallBackFcn &fcn, bool trigger=false)
 register a callback function(2) with an already registered AlgTool More...
 
virtual SG::DataProxyproxy (const void *const pTransient) const override final
 get proxy for a given data object address in memory More...
 
virtual SG::DataProxyproxy (const CLID &id) const final
 get default proxy with given id. More...
 
virtual SG::DataProxyproxy (const CLID &id, const std::string &key) const override final
 get proxy with given id and key. Returns 0 to flag failure More...
 
virtual SG::DataProxyproxy (const CLID &id, const char *key) const final
 get proxy with given id and key. More...
 
virtual StatusCode addToStore (CLID id, SG::DataProxy *proxy) override final
 Raw addition of a proxy to the store. More...
 
virtual SG::DataProxyrecordObject (SG::DataObjectSharedPtr< DataObject > obj, const std::string &key, bool allowMods, bool returnExisting) override final
 Record an object in the store. More...
 
virtual SG::DataProxyproxy_exact (SG::sgkey_t sgkey) const override final
 Get proxy given a hashed key+clid. More...
 
more proxy dictionary functionality
virtual SG::DataProxyproxy (const CLID &id, bool checkValid) const
 get default proxy with given id, optionally checking validity. More...
 
virtual SG::DataProxyproxy (const CLID &id, const std::string &key, bool checkValid) const
 get proxy with given id and key, optionally checking validity. More...
 
virtual SG::DataProxyproxy (const CLID &id, const char *key, bool checkValid) const
 get proxy with given id and key, optionally checking validity. More...
 
virtual std::vector< const SG::DataProxy * > proxies () const override final
 return the list of all current proxies in store More...
 
std::vector< CLIDclids () const
 Return all CLIDs in the store. More...
 
SG::DataProxytransientProxy (const CLID &id, const std::string &key) const
 get proxy with given id and key. More...
 
DataObject * accessData (const CLID &id) const
 find proxy and access its data. Returns 0 to flag failure More...
 
DataObject * accessData (const CLID &id, const std::string &key) const
 find proxy and access its data. Returns 0 to flag failure More...
 
void setProxyProviderSvc (IProxyProviderSvc *pPPSvc)
 associate ProxyProviderSvc to this store More...
 
IProxyProviderSvcproxyProviderSvc ()
 Return current ProxyProviderSvc. More...
 
virtual SG::SourceID sourceID (const std::string &key="EventSelector") const override
 Return the metadata source ID for the current event slot. More...
 
ElementLink remapping
void remap_impl (sgkey_t source, sgkey_t target, off_t index_offset)
 Declare a remapping. More...
 
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. More...
 
Gaudi Standard Service constructors/destructors
 SGImplSvc (const std::string &name, ISvcLocator *svc)
 Standard Constructor. More...
 
virtual ~SGImplSvc () override final
 Standard Destructor. More...
 
Gaudi IService implementation
virtual StatusCode initialize () override final
 Service initialization. More...
 
virtual StatusCode reinitialize () override final
 Service reinitialization. More...
 
virtual StatusCode start () override final
 Service start. More...
 
virtual StatusCode stop () override final
 Service stop. More...
 
virtual StatusCode finalize () override final
 Service finalization. More...
 
Gaudi IIncidentListener implementation
virtual void handle (const Incident &) override final
 triggered by Incident service More...
 
StatusCode loadEventProxies ()
 load proxies at begin event More...
 

String <-> int key conversions. IStringPool implementation

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. More...
 
virtual const std::string * keyToString (sgkey_t key) const override final
 Find the string corresponding to a given key. More...
 
virtual const std::string * keyToString (sgkey_t key, CLID &clid) const override final
 Find the string and CLID corresponding to a given key. More...
 
virtual void registerKey (sgkey_t key, const std::string &str, CLID clidid) override final
 Remember an additional mapping from key to string/CLID. More...
 
bool mergeStringPool (const SGImplSvc &other)
 Merge the string pool from another store into this one. More...
 

IHiveStoreMgr implementation

typedef std::recursive_mutex mutex_t
 
typedef std::lock_guard< mutex_tlock_t
 
class IOVDbSvc
 access clearProxyPayload More...
 
class IOVSvcTool
 
class AthenaOutputStream
 access proxyRange() More...
 
class StoreGateSvc
 
class SG::VarHandleBase
 access typeless_record More...
 
class ActiveStoreSvc
 
PyObjectAthenaInternal::recordObjectToStore (StoreGateSvc *, PyObject *, PyObject *, bool, bool, bool)
 
void AthenaInternal::py_sg_clearProxyPayload (StoreGateSvc *, SG::DataProxy *)
 
ServiceHandle< IClassIDSvc > m_pCLIDSvc
 
ServiceHandle< IConversionSvc > m_pDataLoader
 
ServiceHandle< IProxyProviderSvcm_pPPSHandle
 
IProxyProviderSvcm_pPPS
 
ServiceHandle< IHistorySvc > m_pHistorySvc
 
SG::DataStorem_pStore
 
std::list< DataObject * > m_trash
 The Recycle Bin. More...
 
ServiceHandle< IIncidentSvc > m_pIncSvc
 property More...
 
bool m_DumpStore
 Dump Property flag: triggers dump() at EndEvent. More...
 
bool m_ActivateHistory
 Activate the history service. More...
 
bool m_DumpArena
 DumpArena Property flag : trigger m_arena->report() at clearStore. More...
 
StringArrayProperty m_folderNameList
 FolderNameList Property. More...
 
ServiceHandle< IIOVSvcm_pIOVSvc
 get the IOVSvc "just in time" (breaks recursion at initialize) More...
 
bool m_storeLoaded
 FIXME hack needed by loadEventProxies. More...
 
SG::StringPool m_stringpool
 
SG::RemapImplm_remap_impl
 
SG::Arena m_arena
 Allocation arena to associate with this store. More...
 
int m_slotNumber
 The Hive slot number for this store, or -1 if this isn't a Hive store. More...
 
int m_numSlots
 The total number of slots. 1 if this isn't a Hive store. More...
 
std::map< std::thread::id, std::vector< IResetable * > > m_newBoundHandles
 Keep track of proxies bound since the last call to commitNewDataObjects or clearStore. More...
 
mutex_t m_mutex
 
mutex_t m_remapMutex
 
mutex_t m_stringPoolMutex
 
virtual StatusCode clearStore (bool forceRemove=false) override final
 clear DataStore contents: called by the event loop mgrs More...
 
virtual void commitNewDataObjects () override final
 Reset handles added since the last call to commit. More...
 
void setSlotNumber (int slot, int numSlots)
 Set the Hive slot number for this store. More...
 
virtual void boundHandle (IResetable *handle) override final
 Tell the store that a proxy has been bound to a handle. More...
 
virtual void unboundHandle (IResetable *handle) override final
 Tell the store that a handle has been unbound from a proxy. More...
 
virtual StatusCode createObj (IConverter *cvt, IOpaqueAddress *addr, DataObject *&refpObject) override
 Call converter to create an object, with locking. More...
 
StatusCode record_HistObj (const CLID &id, const std::string &key, const std::string &store, bool allowMods, bool resetOnly=true)
 
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 More...
 
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 More...
 
StatusCode typeless_record (DataObject *obj, const std::string &key, const void *const raw_ptr, bool allowMods, bool resetOnly, bool noHist, const std::type_info *tinfo)
 
StatusCode typeless_record (DataObject *obj, const std::string &key, const void *const raw_ptr, bool allowMods, bool resetOnly, bool noHist, const std::type_info *tinfo, SG::DataProxy **proxy_ret, bool noOverwrite)
 
SG::DataProxyrecord_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 More...
 
void releaseObject (const CLID &id, const std::string &key)
 release object held by proxy, if any. More...
 
void clearProxyPayload (SG::DataProxy *)
 use to reset a proxy (clearing the data object it contains) Unlike DataProxy::reset this method correctly updates SGSvc internals More...
 
SG::DataProxylocatePersistent (const SG::TransientAddress *tAddr, bool checkValid=false) const
 
StatusCode proxyRange (const CLID &id, SG::ConstProxyIterator &beg, SG::ConstProxyIterator &end) const
 return a range to all proxies of a given CLID More...
 
SG::DataStorestore ()
 
const SG::DataStorestore () const
 
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 More...
 
SG::DataProxysetupProxy (const CLID &dataID, const std::string &gK, DataObject *pDObj, bool allowMods, bool resetOnly)
 try to locate a proxy or create it if needed More...
 
void recycle (DataObject *pBadDObj)
 put a bad (unrecordable) dobj away More...
 
void emptyTrash ()
 throw away bad objects More...
 
bool bindHandleToProxy (const CLID &id, const std::string &key, IResetable *ir, SG::DataProxy *&dp)
 name says it all More...
 
bool bindHandleToProxyAndRegister (const CLID &id, const std::string &key, IResetable *ir, SG::DataProxy *&dp)
 Also do registration with IOVSvc. More...
 
bool bindHandleToProxyAndRegister (const CLID &id, const std::string &key, IResetable *ir, SG::DataProxy *&dp, const CallBackID &c, const IOVSvcCallBackFcn &fcn, bool trigger)
 
StatusCode removeProxy (SG::DataProxy *proxy, const void *pTrans, bool forceRemove=false)
 remove proxy from store, unless it is reset only. More...
 
StatusCode t2pRegister (const void *const pTrans, SG::DataProxy *const pPers)
 forwarded to DataStore More...
 
void t2pRemove (const void *const pTrans)
 forwarded to DataStore More...
 
void msg_update_handler (Gaudi::Details::PropertyBase &outputLevel)
 callback for output level property More...
 
bool associateAux_impl (SG::AuxVectorBase *ptr, const std::string &key, CLID auxclid) const
 
bool associateAux_impl (SG::AuxElement *ptr, const std::string &key, CLID auxclid) const
 
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. More...
 
void makeCurrent ()
 The current store is becoming the active store. More...
 

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
Author
ATLAS Collaboration

Definition at line 105 of file SGImplSvc.h.

Member Typedef Documentation

◆ lock_t

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

Definition at line 721 of file SGImplSvc.h.

◆ mutex_t

typedef std::recursive_mutex SGImplSvc::mutex_t
private

Definition at line 720 of file SGImplSvc.h.

◆ sgkey_t

Definition at line 351 of file SGImplSvc.h.

Constructor & Destructor Documentation

◆ SGImplSvc() [1/2]

SGImplSvc::SGImplSvc ( const SGImplSvc )
delete

◆ SGImplSvc() [2/2]

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

Standard Constructor.

Definition at line 102 of file SGImplSvc.cxx.

103  : base_class(name, svc),
104  m_pCLIDSvc("ClassIDSvc", name),
105  m_pDataLoader("EventPersistencySvc", name),
106  m_pPPSHandle("ProxyProviderSvc", name),
107  m_pPPS(nullptr),
108  m_pHistorySvc("HistorySvc", name),
109  m_pStore(new DataStore(*this)),
110  m_pIncSvc("IncidentSvc", name),
111  m_DumpStore(false),
112  m_ActivateHistory(false),
113  m_DumpArena(false),
114  m_pIOVSvc("IOVSvc", name),
115  m_storeLoaded(false),
117  m_arena (name),
118  m_slotNumber(-1),
119  m_numSlots(1)
120 {
121  //our properties
122  declareProperty("ProxyProviderSvc", m_pPPSHandle);
123  declareProperty("Dump", m_DumpStore);
124  declareProperty("ActivateHistory", m_ActivateHistory);
125  declareProperty("DumpArena", m_DumpArena);
126  //StoreGateSvc properties
127  declareProperty("IncidentSvc", m_pIncSvc);
128  //add handler for Service base class property
129  m_outputLevel.declareUpdateHandler(&SGImplSvc::msg_update_handler, this);
130 
132  header->addArena (&m_arena);
133 }

◆ ~SGImplSvc()

SGImplSvc::~SGImplSvc ( )
finaloverridevirtual

Standard Destructor.

Definition at line 137 of file SGImplSvc.cxx.

137  {
139  header->delArena (&m_arena);
140 
141  delete m_pStore;
142  delete m_remap_impl;
143 }

Member Function Documentation

◆ accessData() [1/2]

DataObject * SGImplSvc::accessData ( const CLID id) const

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

Definition at line 972 of file SGImplSvc.cxx.

973 {
974  lock_t lock (m_mutex);
975  DataProxy* theProxy(proxy(id, true));
976  return (0 == theProxy) ? 0 : theProxy->accessData();
977 }

◆ accessData() [2/2]

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

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

Definition at line 980 of file SGImplSvc.cxx.

981 {
982  lock_t lock (m_mutex);
983  DataProxy* theProxy(proxy(id, key, true));
984  return (0 == theProxy) ? 0 : theProxy->accessData();
985 }

◆ addAlias()

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

Definition at line 680 of file SGImplSvc.cxx.

681 {
682  if (0 == proxy) {
683  warning() << "addAlias: no target DataProxy given, Cannot alias to a non-existing object"
684  << endmsg;
685  return StatusCode::FAILURE;
686  }
687 
688  // add key to proxy and to ProxyStore
689  return m_pStore->addAlias(aliasKey, proxy);
690 }

◆ addAutoSymLinks()

void SGImplSvc::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.

Definition at line 1674 of file SGImplSvc.cxx.

1679 {
1680  // Automatically make all legal base class symlinks
1681  if (!tinfo) {
1683  }
1684  const SG::BaseInfoBase* bib = nullptr;
1685  if (tinfo) {
1686  bib = SG::BaseInfoBase::find (*tinfo);
1687  }
1688  if (!bib) {
1689  // Could succeed where the previous fails if clid for DataVector<T>
1690  // but tinfo is for ConstDataVector<DataVector<T> >.
1691  bib = SG::BaseInfoBase::find (clid);
1692  }
1693  if ( bib ) {
1694  const std::vector<CLID>& bases = bib->get_bases();
1695  for ( std::size_t i = 0, iMax = bases.size(); i < iMax; ++i ) {
1696  if ( bases[i] != clid ) {
1697  if ( addSymLink( bases[i], dp ).isSuccess() ) {
1698  // register with t2p
1699  if (dp->object())
1700  this->t2pRegister( SG::DataProxy_cast( dp, bases[i] ), dp ).ignore();
1701  }
1702  else {
1703  warning() << "record_impl: Doing auto-symlinks for object with CLID "
1704  << clid
1705  << " and SG key " << key
1706  << ": Proxy already set for base CLID " << bases[i]
1707  << "; not making auto-symlink." << endmsg;
1708  }
1709  }
1710  }
1711 
1712  // Handle copy conversions.
1713  {
1714  for (CLID copy_clid : bib->get_copy_conversions()) {
1715  if (m_pStore->addSymLink (copy_clid, dp).isFailure()) {
1716  warning() << "record_impl: Doing auto-symlinks for object with CLID "
1717  << clid
1718  << " and SG key " << key
1719  << ": Proxy already set for copy-conversion CLID "
1720  << copy_clid
1721  << "; not making auto-symlink." << endmsg;
1722  }
1723  }
1724  }
1725  }
1726  else {
1727  if (warn_nobib) {
1728  warning() << "record_impl: Could not find suitable SG::BaseInfoBase for CLID ["
1729  << clid << "] (" << key << ") !\t"
1730  << "No auto-symlink established !"
1731  << endmsg;
1732  }
1733  }
1734 }

◆ addSymLink()

StatusCode SGImplSvc::addSymLink ( const CLID linkid,
SG::DataProxy dp 
)
private

Definition at line 600 of file SGImplSvc.cxx.

601 {
602  if (0 == dp) {
603  warning() << "addSymLink: no target DataProxy found. Sorry, can't link to a non-existing data object"
604  << endmsg;
605  return StatusCode::FAILURE;
606  }
607  StatusCode sc = m_pStore->addSymLink(linkid, dp);
608 
609  // If the symlink is a derived->base conversion, then we may have
610  // a different transient pointer for the symlink.
611  if (sc.isSuccess() && dp->object()) {
612  void* baseptr = SG::DataProxy_cast (dp, linkid);
613  if (baseptr)
614  this->t2pRegister (baseptr, dp).ignore();
615  }
616  return sc;
617 }

◆ addToStore()

StatusCode SGImplSvc::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 794 of file SGImplSvc.cxx.

795 {
796  lock_t lock (m_mutex);
797  return m_pStore->addToStore (id, proxy);
798 }

◆ associateAux_impl() [1/2]

bool SGImplSvc::associateAux_impl ( SG::AuxElement ptr,
const std::string &  key,
CLID  auxclid 
) const
private

Definition at line 1914 of file SGImplSvc.cxx.

1917 {
1918  lock_t lock (m_mutex);
1919  SG_MSG_VERBOSE("called associateAux_impl for key " + key);
1920  // no Aux store set yet
1921  if (!ptr->hasStore()) {
1922  SG::DataProxy* dp = proxy (auxclid, key + "Aux.", true);
1923  if (dp) {
1924  if (!dp->isConst()) {
1925  SG::IAuxStore* pAux = SG::DataProxy_cast<SG::IAuxStore> (dp);
1926  if (pAux) {
1927  ptr->setStore (pAux);
1928  return true;
1929  }
1930  }
1931 
1932  const SG::IConstAuxStore* pAux = SG::DataProxy_cast<SG::IConstAuxStore> (dp);
1933  if (pAux) {
1934  ptr->setStore (pAux);
1935  return true;
1936  }
1937  }
1938  }
1939  return false;
1940 }

◆ associateAux_impl() [2/2]

bool SGImplSvc::associateAux_impl ( SG::AuxVectorBase ptr,
const std::string &  key,
CLID  auxclid 
) const
private

Definition at line 1879 of file SGImplSvc.cxx.

1882 {
1883  // If we already have the aux store (as should usually be the case), return
1884  // without taking out the SG lock. Otherwise, we can deadlock
1885  // if another thread is also trying to dereference a link to the aux store.
1886  // (Should _not_ be holding the SG lock when dereferencing the link!)
1887  if (ptr->hasStore()) return true;
1888 
1889  lock_t lock (m_mutex);
1890  SG_MSG_VERBOSE("called associateAux_impl for key " + key);
1891  // no Aux store set yet
1892  if (!ptr->hasStore()) {
1893  SG::DataProxy* dp = proxy (auxclid, key + "Aux.", true);
1894  if (dp) {
1895  if (!dp->isConst()) {
1896  SG::IAuxStore* pAux = SG::DataProxy_cast<SG::IAuxStore> (dp);
1897  if (pAux) {
1898  ptr->setStore (pAux);
1899  return true;
1900  }
1901  }
1902 
1903  const SG::IConstAuxStore* pAux = SG::DataProxy_cast<SG::IConstAuxStore> (dp);
1904  if (pAux) {
1905  ptr->setStore (pAux);
1906  return true;
1907  }
1908  }
1909  }
1910  return false;
1911 }

◆ bindHandleToProxy()

bool SGImplSvc::bindHandleToProxy ( const CLID id,
const std::string &  key,
IResetable ir,
SG::DataProxy *&  dp 
)
private

name says it all

Definition at line 1355 of file SGImplSvc.cxx.

1357 {
1358  lock_t lock (m_mutex);
1359 
1360  dp = m_pStore->proxy (id, key);
1361  if (dp == nullptr && m_pPPS != nullptr) {
1362  dp = m_pPPS->retrieveProxy(id, key, *m_pStore);
1363  }
1364 
1365  if (0 == dp) return false;
1366 
1367  if (! dp->bindHandle(ir) ) {
1368  fatal() << "DataHandle at " << hex << ir << dec
1369  << " already bound to DataProxy with key " << ir->key()
1370  << ". Cannot bind to proxy " << dp->name() << " as well\n"
1371  << " You have probably registered multiple callbacks via regFcn with the same DataHandle using different keys (DataProxies)\n"
1372  << endmsg;
1373  return false;
1374  }
1375 
1376  //already done in DataHandleBase::setState dp->addRef();
1377 
1378 #ifndef NDEBUG
1379  SG_MSG_DEBUG(" Bound handle " << MSG::hex << ir << " to proxy "
1380  << dp << MSG::dec);
1381 #endif
1382  return true;
1383 }

◆ bindHandleToProxyAndRegister() [1/2]

bool SGImplSvc::bindHandleToProxyAndRegister ( const CLID id,
const std::string &  key,
IResetable ir,
SG::DataProxy *&  dp 
)
private

Also do registration with IOVSvc.

Definition at line 1387 of file SGImplSvc.cxx.

1389 {
1390  lock_t lock (m_mutex);
1391  bool ret = bindHandleToProxy (id, key, ir, dp);
1392  if (ret) {
1393  StatusCode sc = m_pIOVSvc->regProxy(dp,key);
1394  if (sc.isFailure()) return false;
1395  }
1396  return true;
1397 }

◆ bindHandleToProxyAndRegister() [2/2]

bool SGImplSvc::bindHandleToProxyAndRegister ( const CLID id,
const std::string &  key,
IResetable ir,
SG::DataProxy *&  dp,
const CallBackID c,
const IOVSvcCallBackFcn fcn,
bool  trigger 
)
private

Definition at line 1401 of file SGImplSvc.cxx.

1406 {
1407  lock_t lock (m_mutex);
1408  bool ret = bindHandleToProxy (id, key, ir, dp);
1409  if (ret) {
1410  StatusCode sc = m_pIOVSvc->regProxy(dp,key);
1411  if (sc.isFailure()) return false;
1412  sc = m_pIOVSvc->regFcn(dp,c,fcn,trigger);
1413  if (sc.isFailure()) return false;
1414  }
1415  return true;
1416 }

◆ boundHandle()

void SGImplSvc::boundHandle ( IResetable handle)
finaloverridevirtual

Tell the store that a proxy has been bound to a handle.

Parameters
proxyThe proxy that was bound. The default implementation does nothing.

Definition at line 1755 of file SGImplSvc.cxx.

1756 {
1757  m_newBoundHandles[std::this_thread::get_id()].push_back (handle);
1758 }

◆ clearProxyPayload()

void SGImplSvc::clearProxyPayload ( SG::DataProxy dp)
private

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

Definition at line 1561 of file SGImplSvc.cxx.

1561  {
1562  lock_t lock (m_mutex);
1563 
1564  // Remove transient pointer entries for this proxy.
1565  // But do that only if the proxy has a valid object.
1566  // Otherwise, we could trigger I/O --- which we don't want since it's useless
1567  // (we'd just destroy the object immediately). In some cases it can also
1568  // lead to a deadlock (see ATR-24482).
1569  if (dp->isValidObject()) {
1570  SG::DataProxy::CLIDCont_t clids = dp->transientID();
1571  SG::DataProxy::CLIDCont_t::const_iterator i(clids.begin()), e(clids.end());
1572  while (i != e) {
1574  }
1575  }
1576 
1577  bool hard_reset = (m_numSlots > 1);
1578  dp->reset (hard_reset);
1579 }

◆ clearStore()

StatusCode SGImplSvc::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 268 of file SGImplSvc.cxx.

269 {
270 #ifdef DEBUG_SGIMPL
271  dbg::print(stderr, "SGImplSvc::clearStore(forceRemove={}) on {}\n", forceRemove, name());
272 #endif
273  {
274  if (m_DumpArena) {
275  std::ostringstream s;
276  m_arena.report(s);
277  info() << "Report for Arena: " << m_arena.name() << '\n'
278  << s.str() << endmsg;
279  }
280  }
281  {
282  lock_t lock (m_mutex);
283  emptyTrash();
284  for (auto& p : m_newBoundHandles)
285  p.second.clear();
286  assert(m_pStore);
287  debug() << "Clearing store with forceRemove="
288  << forceRemove << endmsg;
289  bool hard_reset = (m_numSlots > 1);
290  m_pStore->clearStore(forceRemove, hard_reset, &msgStream(MSG::DEBUG));
291  m_storeLoaded=false; //FIXME hack needed by loadEventProxies
292  }
293  {
294  lock_t remap_lock (m_remapMutex);
295  m_remap_impl->m_remaps.clear();
296  m_arena.reset();
297  }
298 
299  return StatusCode::SUCCESS;
300 }

◆ clid()

CLID SGImplSvc::clid ( const std::string &  key) const

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

Definition at line 1640 of file SGImplSvc.cxx.

1641 {
1642  lock_t lock (m_mutex);
1643  SG::DataStore::ConstStoreIterator s_iter, s_end;
1644  store()->tRange(s_iter, s_end).ignore();
1645 
1646  for ( ; s_iter != s_end; ++s_iter ) {
1647  if ( s_iter->second.find( key ) != s_iter->second.end() ) {
1648  return s_iter->first;
1649  }
1650  }
1651 
1652  return CLID_NULL;
1653 }

◆ clids() [1/2]

std::vector< CLID > SGImplSvc::clids ( ) const

Return all CLIDs in the store.

Definition at line 943 of file SGImplSvc.cxx.

944 {
945  lock_t lock (m_mutex);
946 
947  using std::distance;
948  DataStore::ConstStoreIterator s_iter, s_end;
949  store()->tRange(s_iter, s_end).ignore();
950 
951  std::vector<CLID> clids;
952  clids.reserve( distance( s_iter, s_end ) );
953 
954  for (; s_iter != s_end; ++s_iter ) {
955  const CLID id = s_iter->first;
956  clids.push_back (id);
957  }
958 
959  return clids;
960 }

◆ clids() [2/2]

std::vector< CLID > SGImplSvc::clids ( const std::string &  key) const

Retrieve all the CLID s (including symlinks) of the object recorded in StoreGate with the given "key" WARNING: slow!

Definition at line 1656 of file SGImplSvc.cxx.

1657 {
1658  lock_t lock (m_mutex);
1659  std::vector<CLID> clids;
1660  SG::DataStore::ConstStoreIterator s_iter, s_end;
1661  store()->tRange(s_iter, s_end).ignore();
1662 
1663  for ( ; s_iter != s_end; ++s_iter ) {
1664  if ( s_iter->second.find( key ) != s_iter->second.end() ) {
1665  clids.push_back(s_iter->first);
1666  }
1667  }
1668 
1669  return clids;
1670 }

◆ commitNewDataObjects()

void SGImplSvc::commitNewDataObjects ( )
finaloverridevirtual

Reset handles added since the last call to commit.

Definition at line 1737 of file SGImplSvc.cxx.

1737  {
1738  lock_t lock (m_mutex);
1739 
1740  // Reset handles added since the last call to commit.
1741  bool hard_reset = (m_numSlots > 1);
1742  std::vector<IResetable*> handles;
1743  m_newBoundHandles[std::this_thread::get_id()].swap (handles);
1744  for (IResetable* h : handles)
1745  h->reset (hard_reset);
1746 }

◆ contains()

bool SGImplSvc::contains ( const CLID  id,
const std::string &  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")) { ... }

Definition at line 700 of file SGImplSvc.cxx.

701 {
702  try {
703  return (0 != proxy(id, key, true));
704  } catch(...) { return false; }
705 }

◆ createKey()

string SGImplSvc::createKey ( const CLID dataID)
private

creates a key internally if none specified by client

Definition at line 262 of file SGImplSvc.cxx.

263 {
264  return std::to_string(m_pStore->typeCount(id) + 1);
265 }

◆ createObj()

StatusCode SGImplSvc::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 1798 of file SGImplSvc.cxx.

1801 {
1802  // This lock was here originally, but is probably not really needed ---
1803  // both DataProxy and the I/O components have their own locks.
1804  // Further, this was observed to cause deadlocks for the detector store,
1805  // and would in general be expected to be a contention issue.
1806  //lock_t lock (m_mutex);
1807  return cvt->createObj (addr, refpObject);
1808 }

◆ dump()

string SGImplSvc::dump ( ) const

dump objects in store.

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

Definition at line 522 of file SGImplSvc.cxx.

523 {
524  lock_t lock (m_mutex);
525  auto out_buffer = std::string{};
526  auto out = std::back_inserter(out_buffer);
527  const std::string me = name();
528  std::format_to(out, "{}: <<<<<<<<<<<<<<<<< Data Store Dump >>>>>>>>>>>>>>> \n", me);
529  std::format_to(out, "{}: SGImplSvc()::dump() which is {} \n", me, m_storeLoaded ? "LOADED" : "NOT LOADED");
530 
531  DataStore::ConstStoreIterator s_iter, s_end;
532  store()->tRange(s_iter, s_end).ignore();
533 
534  for (; s_iter != s_end; ++s_iter)
535  {
536 
537  CLID id = s_iter->first;
538  int nProxy = store()->typeCount(id);
539  std::string tname;
540  m_pCLIDSvc->getTypeNameOfID(id, tname).ignore();
541  std::format_to(out, "{}: Found {} {} for ClassID {} ({}): \n", me, nProxy, ((nProxy == 1) ? "proxy" : "proxies"), id, tname);
542 
543  // loop over each type:
544  SG::ConstProxyIterator p_iter = (s_iter->second).begin();
545  SG::ConstProxyIterator p_end = (s_iter->second).end();
546 
547  while (p_iter != p_end) {
548  const DataProxy& dp(*p_iter->second);
549  std::format_to(out, "{}: flags: ({:7s}, {:8s}, {:6s}) --- data: {:10p} --- key: {}\n", me,
550  (dp.isValid() ? "valid" : "INVALID"),
551  (dp.isConst() ? "locked" : "UNLOCKED"),
552  (dp.isResetOnly() ? "reset" : "DELETE"),
553  dbg::ptr(dp.object()), p_iter->first);
554  ++p_iter;
555  }
556  }
557  std::format_to(out, "{}: <<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>> \n", me);
558  return out_buffer;
559 }

◆ emptyTrash()

void SGImplSvc::emptyTrash ( )
private

throw away bad objects

Definition at line 1344 of file SGImplSvc.cxx.

1344  {
1345  lock_t lock (m_mutex);
1346  while (!m_trash.empty()) {
1347  m_trash.front()->release(); //delete the bad data object
1348  m_trash.pop_front(); //remove pointer from list
1349  }
1350 }

◆ finalize()

StatusCode SGImplSvc::finalize ( )
finaloverridevirtual

Service finalization.

Definition at line 303 of file SGImplSvc.cxx.

303  {
304  verbose() << "Finalizing " << name() << endmsg ;
305 
306  // Incident service may not work in finalize.
307  // Clear this, so that we won't try to send an incident from clearStore.
308  (m_pIncSvc.release()).ignore();
309 
310  const bool FORCEREMOVE(true);
311  clearStore(FORCEREMOVE).ignore();
312 
314  delete m_pStore;
315  m_pStore = nullptr;
316  delete m_remap_impl;
317  m_remap_impl = 0;
318  m_arena.erase();
319 
320  return Service::finalize();
321 }

◆ handle()

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

triggered by Incident service

Definition at line 232 of file SGImplSvc.cxx.

232  {
233 
234  if (inc.type() == "EndEvent") {
235  if (m_DumpStore) {
236  SG_MSG_DEBUG("Dumping StoreGate Contents");
237  info() << '\n' << dump() << endl
238  << endmsg;
239  }
240  }
241 }

◆ hiveProxyDict()

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

implements IHiveStore interface for compat with Hive

Definition at line 225 of file SGImplSvc.h.

225  {
226  return this;
227  }

◆ initialize()

StatusCode SGImplSvc::initialize ( )
finaloverridevirtual

Service initialization.

Definition at line 147 of file SGImplSvc.cxx.

147  {
148 
149  verbose() << "Initializing " << name() << endmsg;
150 
152 
153  if (!m_pStore)
154  m_pStore = new DataStore (*this);
155  if (!m_remap_impl)
157 
158  //properties accessible from now on
159 
161  // If this is the default event store (StoreGateSvc), then declare
162  // our arena as the default for memory allocations.
163  if (this->storeID() == StoreID::EVENT_STORE) {
166  }
167  // set up the incident service:
168  if (!(m_pIncSvc.retrieve()).isSuccess()) {
169  error() << "Could not locate IncidentSvc "
170  << endmsg;
171  return StatusCode::FAILURE;
172  }
173 
174  // We explicitly do not retrieve m_pIOVSvc and rely on retrieval
175  // on first use to avoid an initialization loop here.
176 
177  CHECK( m_pDataLoader.retrieve() );
178  CHECK( m_pCLIDSvc.retrieve() );
179 
180  if (!m_pPPSHandle.empty()) {
181  CHECK( m_pPPSHandle.retrieve() );
182  m_pPPS = &*m_pPPSHandle;
183  }
184 
185  if ( m_pPPS && (m_pPPS->preLoadProxies(*m_pStore)).isFailure() )
186  {
187  SG_MSG_DEBUG(" Failed to preLoad proxies");
188  return StatusCode::FAILURE;
189  }
190 
191  // Get hold of History Service
192  if (m_ActivateHistory) {
193  CHECK( m_pHistorySvc.retrieve() );
194  }
195 
196  return StatusCode::SUCCESS;
197 }

◆ isSymLinked()

bool SGImplSvc::isSymLinked ( const CLID linkID,
SG::DataProxy dp 
)
private

Definition at line 492 of file SGImplSvc.cxx.

493 {
494  return (0 != dp) ? dp->transientID(linkID) : false;
495 }

◆ keys()

void SGImplSvc::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.

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 483 of file SGImplSvc.cxx.

486 {
487  lock_t lock (m_mutex);
488  return store()->keys(id, vkeys, includeAlias, onlyValid);
489 }

◆ keyToString() [1/2]

const std::string * SGImplSvc::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 1469 of file SGImplSvc.cxx.

1470 {
1472  return m_stringpool.keyToString (key);
1473 }

◆ keyToString() [2/2]

const std::string * SGImplSvc::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 1485 of file SGImplSvc.cxx.

1486 {
1488  return m_stringpool.keyToString (key, clid);
1489 }

◆ loadEventProxies()

StatusCode SGImplSvc::loadEventProxies ( )

load proxies at begin event

Definition at line 243 of file SGImplSvc.cxx.

243  {
244  lock_t lock (m_mutex);
245  StatusCode sc(StatusCode::SUCCESS);
246  //FIXME this should probably be dealt with by the providers
247  if (0 != m_pPPS && !m_storeLoaded) {
248  m_storeLoaded = true;
250 #ifdef DEBUG_SGIMPL
251  dbg::print(stderr, "SGImplSvc::loadEventProxies() LOADED PROXIES on {}\n", name());
252  }
253  else {
254  dbg::print(stderr, "SGImplSvc::loadEventProxies() PROXIES ALREADY LOADED on {}\n", name());
255 #endif
256  }
257  return sc;
258 }

◆ locatePersistent()

DataProxy * SGImplSvc::locatePersistent ( const SG::TransientAddress tAddr,
bool  checkValid = false 
) const
private

Definition at line 1225 of file SGImplSvc.cxx.

1227 {
1228  DataProxy* dp = m_pStore->proxy(tAddr);
1229 
1230  if (checkValid && 0 != dp) {
1231  return dp->isValid() ? dp : 0;
1232  } else {
1233  return dp;
1234  }
1235 }

◆ makeCurrent()

void SGImplSvc::makeCurrent ( )
private

The current store is becoming the active store.

Switch the allocation arena, if needed. Only intended to be called by ActiveStoreSvc.

Switch the allocation arena, if needed, and call SG::CurrentEventStore::setStore.

Definition at line 1779 of file SGImplSvc.cxx.

1780 {
1781  lock_t lock (m_mutex);
1782  m_arena.makeCurrent();
1784 }

◆ mergeStringPool()

bool SGImplSvc::mergeStringPool ( const SGImplSvc other)

Merge the string pool from another store into this one.

Parameters
otherThe other store.

In case of collisions, the colliding entries are skipped, and false is returned. If no collisions, then true is returned.

Definition at line 1527 of file SGImplSvc.cxx.

1528 {
1529  // We should hold m_stringPoolMutex before touching the pool.
1530  // But if we acquire the locks for both this and the other store,
1531  // we risk a deadlock. So first copy the other pool, so that we
1532  // don't need to hold both locks at the same time.
1534  {
1535  lock_t lock (other.m_stringPoolMutex);
1536  tmp = other.m_stringpool;
1537  }
1539  return m_stringpool.merge (tmp);
1540 }

◆ msg_update_handler()

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

callback for output level property

Definition at line 1285 of file SGImplSvc.cxx.

1286 {
1287  setUpMessaging();
1288  updateMsgStreamOutputLevel( outputLevel() );
1289  msgSvc()->setOutputLevel(name(), outputLevel());
1290 }

◆ operator=()

SGImplSvc& SGImplSvc::operator= ( const SGImplSvc )
delete

◆ proxies()

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

return the list of all current proxies in store

Definition at line 933 of file SGImplSvc.cxx.

934 {
935  lock_t lock (m_mutex);
936  const std::vector<SG::DataProxy*>& proxies = store()->proxies();
937  std::vector<const SG::DataProxy*> ret (proxies.begin(), proxies.end());
938  return ret;
939 }

◆ proxy() [1/7]

DataProxy * SGImplSvc::proxy ( const CLID id) const
finalvirtual

get default proxy with given id.

Returns 0 to flag failure Deprecated for the event store.

Definition at line 727 of file SGImplSvc.cxx.

728 {
729  return proxy(id, false);
730 }

◆ proxy() [2/7]

DataProxy * SGImplSvc::proxy ( const CLID id,
bool  checkValid 
) const
virtual

get default proxy with given id, optionally checking validity.

Returns
0 to flag failure

Check if it is valid

Definition at line 733 of file SGImplSvc.cxx.

734 {
735  DataProxy* dp = nullptr;
736  {
737  lock_t lock (m_mutex);
738  dp = m_pStore->proxy(id);
739  if (0 == dp && 0 != m_pPPS) {
741  dp = m_pPPS->retrieveProxy(id, string("DEFAULT"), *pStore);
742  }
743  }
745  // Be sure to release the lock before this.
746  // isValid() may call back to the store, so we could otherwise deadlock..
747  if (checkValid && 0 != dp) {
748  // FIXME: For keyless retrieve, this checks only the first instance
749  // of the CLID in store. If that happens to be invalid, but the second
750  // is valid - this does not work (when checkValid is requested).
751  return dp->isValid() ? dp : 0;
752  }
753  return dp;
754 }

◆ proxy() [3/7]

virtual SG::DataProxy* SGImplSvc::proxy ( const CLID id,
const char *  key 
) const
inlinefinalvirtual

get proxy with given id and key.

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

Definition at line 261 of file SGImplSvc.h.

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

◆ proxy() [4/7]

virtual SG::DataProxy* SGImplSvc::proxy ( const CLID id,
const char *  key,
bool  checkValid 
) const
inlinevirtual

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 313 of file SGImplSvc.h.

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

◆ proxy() [5/7]

DataProxy * SGImplSvc::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 757 of file SGImplSvc.cxx.

758 {
759  return proxy(id, key, false);
760 }

◆ proxy() [6/7]

DataProxy * SGImplSvc::proxy ( const CLID id,
const std::string &  key,
bool  checkValid 
) const
virtual

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

Returns
0 to flag failure

Definition at line 763 of file SGImplSvc.cxx.

764 {
765  DataProxy* dp = nullptr;
766  {
767  lock_t lock (m_mutex);
768  dp = m_pStore->proxy(id, key);
769 #ifdef DEBUG_SGIMPL
770  if (!dp) dbg::print(stderr, "::SGImplSvc::proxy(name={}, key={}): data proxy is null, m_pPPS is {}\n", this->name(), key, m_pPPS == 0 ? "NULL" : "NOT NULL");
771 #endif
772  if (0 == dp && 0 != m_pPPS) {
774  dp = m_pPPS->retrieveProxy(id, key, *pStore);
775 #ifdef DEBUG_SGIMPL
776  if (!dp) dbg::print(stderr, "::SGImplSvc::proxy(name={}, key={}): data proxy is still null\n", this->name(), key);
777 #endif
778  }
779  }
780  // Be sure to release the lock before this.
781  // isValid() may call back to the store, so we could otherwise deadlock..
782  if (checkValid && 0 != dp && !(dp->isValid())) {
783  dp = 0;
784  }
785  return dp;
786 }

◆ proxy() [7/7]

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

get proxy for a given data object address in memory

Definition at line 718 of file SGImplSvc.cxx.

719 {
720  // No lock needed here --- the T2pmap held by DataStore has its own locking
721  // (and we were seeing contention here).
722  //lock_t lock (m_mutex);
723  return m_pStore->locatePersistent(pTransient);
724 }

◆ proxy_exact()

SG::DataProxy * SGImplSvc::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.

Definition at line 910 of file SGImplSvc.cxx.

911 {
913 }

◆ proxyProviderSvc()

IProxyProviderSvc* SGImplSvc::proxyProviderSvc ( )

Return current ProxyProviderSvc.

◆ proxyRange()

StatusCode SGImplSvc::proxyRange ( const CLID id,
SG::ConstProxyIterator beg,
SG::ConstProxyIterator end 
) const
private

return a range to all proxies of a given CLID

Definition at line 1293 of file SGImplSvc.cxx.

1295  {
1296  lock_t lock (m_mutex);
1297  return m_pStore->pRange(id,begin,end);
1298 }

◆ record_HistObj()

StatusCode SGImplSvc::record_HistObj ( const CLID id,
const std::string &  key,
const std::string &  store,
bool  allowMods,
bool  resetOnly = true 
)
private

Definition at line 1421 of file SGImplSvc.cxx.

1423  {
1424 
1425  DataHistory *dho;
1426  dho = m_pHistorySvc->createDataHistoryObj( id, key, store );
1427 
1428  std::string idname;
1429  StatusCode sc = m_pCLIDSvc->getTypeNameOfID(id, idname);
1430  if (sc.isFailure() || idname.empty() ) {
1431  idname = std::to_string(id);
1432  }
1433  idname += '/';
1434  idname += key;
1435 
1436  DataObject* obj = SG::asStorable(dho);
1437 
1438  const bool ALLOWOVERWRITE(false);
1439  if (record_impl(obj, idname, dho, allowMods, resetOnly, ALLOWOVERWRITE,
1440  &typeid(DataHistory)) == nullptr)
1441  return StatusCode::FAILURE;
1442  return StatusCode::SUCCESS;
1443 }

◆ record_impl()

SG::DataProxy * SGImplSvc::record_impl ( DataObject *  obj,
const std::string &  key,
const void *const  raw_ptr,
bool  allowMods,
bool  resetOnly,
bool  allowOverwrite,
const std::type_info *  tinfo 
)
private

real recording of an object with a key, allow possibility of specifying const-access

Definition at line 1097 of file SGImplSvc.cxx.

1101 {
1102  CLID clid = pDObj->clID();
1103  std::string rawKey(key);
1104  bool isVKey(SG::VersionedKey::isVersionedKey(key));
1105  if (isVKey) {
1106  //FIXME VersionedKeys will need to be handled more efficiently
1107  SG::VersionedKey vk(rawKey);
1108  DataProxy *dp(proxy(clid, vk.key()));
1109  if (dp) {
1110  //proxies primary key
1111  const std::string& pTAName(dp->name());
1112  //original key as versioned
1113  SG::VersionedKey primaryVK(pTAName);
1114 
1115  //if the existing matching object has no version
1116  //create a versioned alias for the original unversioned key
1117  //so it will remain accessible
1118  if (!SG::VersionedKey::isVersionedKey(pTAName)) {
1119  if (!(this->addAlias(primaryVK.rawVersionKey(), dp)).isSuccess()) {
1120  warning() << "record_impl: Could not setup alias key "
1121  << primaryVK.rawVersionKey()
1122  << " for unversioned object " << pTAName
1123  << endmsg;
1124  return nullptr;
1125  }
1126  }
1127  if (vk.isAuto()) {
1128  //make a new versioned key incrementing the existing version
1129  SG::VersionedKey newVK(primaryVK.key(), primaryVK.version()+1);
1130  //FIXME this will fail in a confusing way if version+1 is in use
1131  //FIXME need a better error message below, probably looking at all
1132  //FIXME aliases
1133  rawKey = newVK.rawVersionKey();
1134  }
1135  }
1136  }
1137  if (!allowOverwrite && m_pPPS) {
1138  //do not overwrite a persistent object
1139  DataProxy* dp = m_pStore->proxy (clid, rawKey);
1140  if (!dp) {
1141  dp = m_pPPS->retrieveProxy(clid, rawKey, *m_pStore);
1142  }
1143  if (dp && dp->provider()) {
1144  std::string clidTypeName;
1145  m_pCLIDSvc->getTypeNameOfID(clid, clidTypeName).ignore();
1146  warning() << "record_impl: you are recording an object with key "
1147  << rawKey << ", type " << clidTypeName
1148  << " (CLID " << clid << ')'
1149  << "\n There is already a persistent version of this object. Recording a duplicate may lead to unreproducible results and it is deprecated."
1150  << endmsg;
1151  }
1152  }
1153  //now check whether raw_ptr has already been recorded
1154  //We need to do this before we create the bucket, the proxy etc
1155  SG::DataProxy* dp(proxy(raw_ptr));
1156  if (0 != dp) {
1157  std::string clidTypeName;
1158  m_pCLIDSvc->getTypeNameOfID(clid, clidTypeName).ignore();
1159  warning() << "record_impl: failed for key="<< rawKey << ", type "
1160  << clidTypeName
1161  << " (CLID " << clid << ')'
1162  << "\n object @" << raw_ptr
1163  << " already in store with key="<< dp->name()
1164  << ". Will not record a duplicate! "
1165  << endmsg;
1166  if (pDObj != dp->object()) {
1167  DataBucketBase* pDBB(dynamic_cast<DataBucketBase*>(pDObj));
1168  if (!pDBB) std::abort();
1169  pDBB->relinquish(); //don't own the data obj already recorded!
1170  }
1171  this->recycle(pDObj);
1172  return nullptr;
1173  }
1174 
1175 
1176  // setup the proxy
1177  dp = setupProxy( clid, rawKey, pDObj, allowMods, resetOnly );
1178  if ( 0 == dp ) {
1179  std::string clidTypeName;
1180  m_pCLIDSvc->getTypeNameOfID(clid, clidTypeName).ignore();
1181  warning() << "record_impl: Problem setting up the proxy for object @"
1182  << raw_ptr
1183  << "\n recorded with key " << rawKey
1184  << " of type " << clidTypeName
1185  << " (CLID " << clid << ") in DataObject @" << pDObj
1186  << endmsg;
1187 
1188  return nullptr;
1189  }
1190 
1191  // record in t2p:
1192  if ( !(this->t2pRegister( raw_ptr, dp )).isSuccess() ) {
1193  std::string clidTypeName;
1194  m_pCLIDSvc->getTypeNameOfID(clid, clidTypeName).ignore();
1195  warning() << "record_impl: can not add to t2p map object @" <<raw_ptr
1196  << "\n with key " << rawKey
1197  << " of type " << clidTypeName
1198  << " (CLID " << clid << ')'
1199  << endmsg;
1200  return nullptr;
1201  }
1202 
1203  addAutoSymLinks (rawKey, clid, dp, tinfo);
1204 
1205  //handle versionedKeys: we register an alias with the "true" key
1206  //unless an object as already been recorded with that key.
1207  //Notice that addAlias overwrites any existing alias, so a generic
1208  //retrieve will always return the last version added
1209  //FIXME not the one with the highest version
1210  if (isVKey) {
1211  SG::VersionedKey vk(rawKey);
1212  if (!(this->addAlias(vk.key(), dp)).isSuccess()) {
1213  warning() << "record_impl: Could not setup alias key " << vk.key()
1214  << " for VersionedKey " << rawKey
1215  << ". Generic access to this object with clid" << clid
1216  << " will not work"
1217  << endmsg;
1218  }
1219  }
1220 
1221  return dp;
1222 }

◆ recordAddress() [1/2]

StatusCode SGImplSvc::recordAddress ( const std::string &  skey,
IOpaqueAddress *  pAddress,
bool  clearAddressFlag = true 
)

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

Definition at line 336 of file SGImplSvc.cxx.

339 {
340  lock_t lock (m_mutex);
341  assert(0 != pAddress);
342  CLID dataID = pAddress->clID();
343 
344  if (dataID == 0)
345  {
346  warning() << "recordAddress: Invalid Class ID found in IOpaqueAddress @"
347  << pAddress << ". IOA will not be recorded"
348  << endmsg;
349  return StatusCode::FAILURE;
350  }
351 
352  //do not overwrite a persistent object
353  if (m_pPPS) {
354  DataProxy* dp = m_pStore->proxy (dataID, skey);
355  if (!dp) {
356  dp = m_pPPS->retrieveProxy(dataID, skey, *m_pStore);
357  }
358  if (dp && dp->provider()) {
359  std::string clidTypeName;
360  m_pCLIDSvc->getTypeNameOfID(dataID, clidTypeName).ignore();
361  warning() << "recordAddress: failed for key="<< skey << ", type "
362  << clidTypeName
363  << " (CLID " << dataID << ')'
364  << "\n there is already a persistent version of this object. Will not record a duplicate! "
365  << endmsg;
366  return StatusCode::FAILURE;
367  }
368  }
369 
370  // Check if a key already exists
371  DataProxy* dp = m_pStore->proxy_exact(dataID, skey);
372  if (0 == dp && 0 != m_pPPS) {
373  dp = m_pPPS->retrieveProxy(dataID, skey, *m_pStore);
374  }
375 
376  // Now treat the various cases:
377  if (0 == dp)
378  {
379  // create the proxy object and register it
380  dp = new DataProxy (TransientAddress (dataID, skey,
381  pAddress, clearAddressFlag),
382  m_pDataLoader.get(), true, true);
383  m_pStore->addToStore(dataID, dp).ignore();
384 
385  addAutoSymLinks (skey, dataID, dp, 0, false);
386  }
387  else if ((0 != dp) && (0 == dp->address()))
388  // Note: intentionally not checking dp->isValidAddress()
389  {
390  // Update proxy with IOpaqueAddress
391  dp->setAddress(pAddress);
392  }
393  else
394  {
395  string errType;
396  m_pCLIDSvc->getTypeNameOfID(dataID, errType).ignore();
397  warning() << "recordAddress: preexisting proxy @" << dp
398  << " with non-NULL IOA found for key "
399  << skey << " type " << errType << " (" << dataID << "). \n"
400  << "Cannot record IOpaqueAddress @" << pAddress
401  << endmsg;
402  return StatusCode::FAILURE;
403  }
404 
405  return StatusCode::SUCCESS;
406 
407 }

◆ recordAddress() [2/2]

StatusCode SGImplSvc::recordAddress ( IOpaqueAddress *  pAddress,
bool  clearAddressFlag = true 
)

Create a proxy object using an IOpaqueAddress.

Definition at line 413 of file SGImplSvc.cxx.

414 {
415  lock_t lock (m_mutex);
416  assert(0 != pAddress);
417 
418  CLID dataID = pAddress->clID();
419 
420  string gK = (pAddress->par())[1]; // transient name by convention
421  if (gK.empty()) gK = (pAddress->par())[0]; // FIXME backward compatibility
422  if (gK.empty()) gK = createKey(dataID);
423 
424  return this->recordAddress(gK, pAddress, clearAddressFlag);
425 }

◆ recordObject()

SG::DataProxy * SGImplSvc::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 821 of file SGImplSvc.cxx.

825 {
826  lock_t lock (m_mutex);
827  const void* raw_ptr = obj.get();
828  const std::type_info* tinfo = nullptr;
829 
830  if (DataBucketBase* bucket = dynamic_cast<DataBucketBase*> (obj.get())) {
831  raw_ptr = bucket->object();
832  tinfo = &bucket->tinfo();
833  }
834 
835  if (returnExisting) {
836  SG::DataProxy* proxy = this->proxy (obj->clID(), key);
837  if (proxy && proxy->isValid()) return proxy;
838 
839  // Look for the same object recorded under a different key/clid.
840  proxy = this->proxy (raw_ptr);
841  if (proxy && proxy->isValid()) {
842  if (proxy->transientID (obj->clID())) {
843  // CLID matches. Make an alias.
844  if (addAlias (key, proxy).isFailure()) {
845  CLID clid = proxy->clID();
846  std::string clidTypeName;
847  m_pCLIDSvc->getTypeNameOfID(clid, clidTypeName).ignore();
848  warning() << "SGImplSvc::recordObject: addAlias fails for object "
849  << clid << "[" << clidTypeName << "] " << proxy->name()
850  << " and new key " << key
851  << endmsg;
852 
853  proxy = nullptr;
854  }
855  }
856 
857  else if (key == proxy->name() || proxy->hasAlias(key) > 0)
858  {
859  // key matches. Make a symlink.
860  if (addSymLink (obj->clID(), proxy).isFailure()) {
861  CLID clid = proxy->clID();
862  std::string clidTypeName;
863  m_pCLIDSvc->getTypeNameOfID(clid, clidTypeName).ignore();
864  CLID newclid = obj->clID();
865  std::string newclidTypeName;
866  m_pCLIDSvc->getTypeNameOfID(newclid, newclidTypeName).ignore();
867  error() << "SGImplSvc::recordObject: addSymLink fails for object "
868  << clid << "[" << clidTypeName << "] " << proxy->name()
869  << " and new clid " << newclid << "[" << newclidTypeName << "]"
870  << endmsg;
871  proxy = nullptr;
872  }
873  }
874 
875  else {
876  CLID clid = proxy->clID();
877  std::string clidTypeName;
878  m_pCLIDSvc->getTypeNameOfID(clid, clidTypeName).ignore();
879  CLID newclid = obj->clID();
880  std::string newclidTypeName;
881  m_pCLIDSvc->getTypeNameOfID(newclid, newclidTypeName).ignore();
882  error() << "SGImplSvc::recordObject: existing object found with "
883  << clid << "[" << clidTypeName << "] " << proxy->name()
884  << " but neither clid " << newclid << "[" << newclidTypeName << "]"
885  << " nor key " << key << " match."
886  << endmsg;
887  proxy = nullptr;
888  }
889 
890  return proxy;
891  }
892  }
893 
894  const bool resetOnly = true;
895  const bool noHist = false;
896  SG::DataProxy* proxy = nullptr;
897  if (this->typeless_record (obj.get(), key, raw_ptr,
898  allowMods, resetOnly, noHist, tinfo,
899  &proxy, true).isFailure())
900  {
901  return nullptr;
902  }
903  return proxy;
904 }

◆ recycle()

void SGImplSvc::recycle ( DataObject *  pBadDObj)
private

put a bad (unrecordable) dobj away

Definition at line 1337 of file SGImplSvc.cxx.

1337  {
1338  assert(pBadDObj);
1339  pBadDObj->addRef();
1340  m_trash.push_back(pBadDObj);
1341 }

◆ regFcn() [1/2]

StatusCode SGImplSvc::regFcn ( const CallBackID c1,
const CallBackID c2,
const IOVSvcCallBackFcn fcn,
bool  trigger = false 
)

register a callback function(2) with an already registered function(1)

Definition at line 499 of file SGImplSvc.cxx.

503 {
504  lock_t lock (m_mutex);
505  return ( m_pIOVSvc->regFcn(c1,c2,fcn,trigger) );
506 }

◆ regFcn() [2/2]

StatusCode SGImplSvc::regFcn ( const std::string &  toolName,
const CallBackID c2,
const IOVSvcCallBackFcn fcn,
bool  trigger = false 
)

register a callback function(2) with an already registered AlgTool

Definition at line 510 of file SGImplSvc.cxx.

514 {
515  lock_t lock (m_mutex);
516  return ( m_pIOVSvc->regFcn(toolName,c2,fcn,trigger) );
517 }

◆ registerKey()

void SGImplSvc::registerKey ( sgkey_t  key,
const std::string &  str,
CLID  clid 
)
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 1504 of file SGImplSvc.cxx.

1507 {
1509  if (!m_stringpool.registerKey (key, str, clid)) {
1510  CLID clid2;
1511  const std::string* str2 = m_stringpool.keyToString (key, clid2);
1512  REPORT_MESSAGE (MSG::WARNING) << "The numeric key " << key
1513  << " maps to multiple string key/CLID pairs: "
1514  << *str2 << "/" << clid2 << " and "
1515  << str << "/" << clid;
1516  }
1517 }

◆ reinitialize()

StatusCode SGImplSvc::reinitialize ( )
finaloverridevirtual

Service reinitialization.

Definition at line 324 of file SGImplSvc.cxx.

324  {
325  verbose() << "Reinitializing " << name() << endmsg ;
326  const bool FORCEREMOVE(true);
327  clearStore(FORCEREMOVE).ignore();
328  //not in v20r2p2! return Service::reinitialize();
329  return StatusCode::SUCCESS;
330 }

◆ releaseObject()

void SGImplSvc::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 1544 of file SGImplSvc.cxx.

1544  {
1545  lock_t lock (m_mutex);
1546  DataProxy *pP(0);
1547  if (0 != (pP = proxy(id, key))) {
1548  // remove all entries from t2p map
1549  SG::DataProxy::CLIDCont_t clids = pP->transientID();
1550  SG::DataProxy::CLIDCont_t::const_iterator i(clids.begin()), e(clids.end());
1551  while (i != e) t2pRemove(SG::DataProxy_cast (pP, *i++));
1552  DataBucketBase *pDBB(dynamic_cast<DataBucketBase*>(pP->object()));
1553  //tell the bucket to let go of the data object
1554  if (0 != pDBB) pDBB->relinquish(); //somebody else better took ownership
1555  bool hard_reset = (m_numSlots > 1);
1556  pP->reset (hard_reset);
1557  }
1558 }

◆ remap_impl()

void SGImplSvc::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 1589 of file SGImplSvc.cxx.

1592 {
1595  payload.target = target;
1596  payload.index_offset = index_offset;
1598 }

◆ remove()

StatusCode SGImplSvc::remove ( const void *  pObject)

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

Definition at line 1320 of file SGImplSvc.cxx.

1321 {
1322  lock_t lock (m_mutex);
1323  return removeProxy(proxy(pObject), pObject);
1324 }

◆ removeDataAndProxy()

StatusCode SGImplSvc::removeDataAndProxy ( const void *  pObject)

Remove pObject and its proxy no matter what.

Definition at line 1329 of file SGImplSvc.cxx.

1330 {
1331  lock_t lock (m_mutex);
1332  const bool FORCEREMOVE(true);
1333  return removeProxy(proxy(pObject), pObject, FORCEREMOVE);
1334 }

◆ removeProxy()

StatusCode SGImplSvc::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

Definition at line 1238 of file SGImplSvc.cxx.

1240 {
1241  lock_t lock (m_mutex);
1242  // check if valid proxy
1243  if (0 == proxy) return StatusCode::FAILURE;
1244 
1245  if (0 == pTrans) {
1246  DataBucketBase* bucket = dynamic_cast<DataBucketBase*>(proxy->object());
1247  if (bucket) pTrans = bucket->object();
1248  }
1249 
1250  // remove all entries from t2p map
1251  // --- only if the proxy actually has an object!
1252  // otherwise, we can trigger I/O.
1253  // besides being useless here, we can get deadlocks if we
1254  // call into the I/O code while holding the SG lock.
1255  if (proxy->isValidObject()) {
1256  this->t2pRemove(pTrans);
1258  for (SG::DataProxy::CLIDCont_t::const_iterator i = clids.begin();
1259  i != clids.end();
1260  ++i)
1261  {
1262  void* ptr = SG::DataProxy_cast (proxy, *i);
1263  this->t2pRemove(ptr);
1264  }
1265  }
1266 
1267  // remove from store
1268  return m_pStore->removeProxy(proxy, forceRemove, true);
1269 }

◆ retrieve()

StatusCode SGImplSvc::retrieve ( CLID  clid,
SG::detail::IteratorBase cibegin,
SG::detail::IteratorBase ciend 
) const

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

Definition at line 1848 of file SGImplSvc.cxx.

1851 {
1852  lock_t lock (m_mutex);
1855 
1856  if (!(proxyRange(clid,first,end)).isSuccess()) {
1857  std::string typnam;
1858  m_pCLIDSvc->getTypeNameOfID(clid, typnam).ignore();
1859  SG_MSG_DEBUG("retrieve(range): no object found "
1860  << " of type " << typnam
1861  << "(CLID " << clid << ')');
1862  }
1863 
1864  (ciend.setState(end, end, true)).ignore();
1865 
1866  if (!(cibegin.setState(first, end, true)).isSuccess()) {
1867  std::string typnam;
1868  m_pCLIDSvc->getTypeNameOfID(clid, typnam).ignore();
1869  SG_MSG_DEBUG("retrieve(range): Can't initialize iterator for object range "
1870  << " of type " << typnam
1871  << "(CLID " << clid << ')');
1872  return StatusCode::FAILURE;
1873  }
1874 
1875  return StatusCode::SUCCESS;
1876 }

◆ setAlias() [1/3]

StatusCode SGImplSvc::setAlias ( CLID  clid,
const std::string &  key,
const std::string &  aliasKey 
)

make an alias to a DataObject (provide data type and old key)

Definition at line 647 of file SGImplSvc.cxx.

649 {
650  lock_t lock (m_mutex);
651 
652  SG::DataProxy* dp(0);
653  dp = proxy(clid, key);
654  if (0 == dp) {
655  error() << "setAlias: problem setting alias "
656  << std::string(aKey) << '\n'
657  << "DataObject does not exist, record before setting alias."
658  << endmsg;
659  return StatusCode::FAILURE;
660  }
661 
662  StatusCode sc = addAlias(aKey, dp);
663  if (sc.isFailure()) {
664  error() << "setAlias: problem setting alias "
665  << (std::string)aKey << '\n'
666  << "DataObject does not exist, record before setting alias."
667  << endmsg;
668  return StatusCode::FAILURE;
669  }
670 
671  return StatusCode::SUCCESS;
672 }

◆ setAlias() [2/3]

StatusCode SGImplSvc::setAlias ( const void *  p2BAliased,
const std::string &  aliasKey 
)

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

Definition at line 620 of file SGImplSvc.cxx.

621 {
622  lock_t lock (m_mutex);
623 
624  SG::DataProxy* dp(0);
625  dp = proxy(pObject);
626  if (0 == dp) {
627  error() << "setAlias: problem setting alias "
628  << aliasKey << '\n'
629  << "DataObject does not exist, record before setting alias."
630  << endmsg;
631  return StatusCode::FAILURE;
632  }
633 
634  StatusCode sc = addAlias(aliasKey, dp);
635  if (sc.isFailure()) {
636  error() << "setAlias: problem setting alias "
637  << aliasKey << '\n'
638  << "DataObject does not exist, record before setting alias."
639  << endmsg;
640  return StatusCode::FAILURE;
641  }
642 
643  return StatusCode::SUCCESS;
644 }

◆ setAlias() [3/3]

StatusCode SGImplSvc::setAlias ( SG::DataProxy proxy,
const std::string &  aliasKey 
)

make an alias to a DataObject (provide valid proxy)

Definition at line 674 of file SGImplSvc.cxx.

675 {
676  return addAlias( aliasKey, proxy );
677 }

◆ setConst()

StatusCode SGImplSvc::setConst ( const void *  pointer)

prevent downstream clients from modifying the pointed-at dobj

Definition at line 1300 of file SGImplSvc.cxx.

1301 {
1302  lock_t lock (m_mutex);
1303  // Check if DataProxy does not exist
1304  DataProxy * dp = proxy(pObject);
1305 
1306  if (0 == dp)
1307  {
1308  warning() << "setConst: NO Proxy for the dobj you want to set const"
1309  << endmsg;
1310  return StatusCode::FAILURE;
1311  }
1312 
1313  dp->setConst();
1314  return StatusCode::SUCCESS;
1315 }

◆ setProxyProviderSvc()

void SGImplSvc::setProxyProviderSvc ( IProxyProviderSvc pPPSvc)

associate ProxyProviderSvc to this store

◆ setSlotNumber()

void SGImplSvc::setSlotNumber ( int  slot,
int  numSlots 
)

Set the Hive slot number for this store.

Parameters
slotThe slot number. -1 means that this isn't a Hive store.
numSlotsThe total number of slots. Should be 1 for the non-Hive case.

Definition at line 922 of file SGImplSvc.cxx.

923 {
924  m_slotNumber = slot;
925  m_numSlots = numSlots;
926 
928  header->setArenaForSlot (slot, &m_arena);
929 }

◆ setStoreID()

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

set store ID. request forwarded to DataStore:

set store id in DataStore:

Definition at line 469 of file SGImplSvc.cxx.

470 {
471  lock_t lock (m_mutex);
472  store()->setStoreID(id);
473 }

◆ setupProxy()

DataProxy * SGImplSvc::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

Definition at line 427 of file SGImplSvc.cxx.

431  {
432  // locate the proxy
433  DataProxy* dp = m_pStore->proxy_exact(dataID, gK);
434 
435  if (0 != dp) { //proxy found
436  if (0 != dp->object())
437  {
438  // Case 0: duplicated proxy
439  warning() << " setupProxy:: error setting up proxy for key "
440  << gK << " and clid " << dataID
441  << "\n Pre-existing valid DataProxy @"<< dp
442  << " found in Store for key " << dp->object()->name()
443  << " with clid " << dp->object()->clID()
444  << endmsg;
445  recycle(pDObj); // commit this object to trash
446  dp = 0;
447  } else {
448  // Case 1: Proxy found... if not valid, update it:
449  dp->setObject(pDObj);
450  if (!allowMods) dp->setConst();
451  }
452  } else {
453  // Case 2: No Proxy found:
454  dp = new DataProxy(pDObj,
455  TransientAddress(dataID, gK),
456  !allowMods, resetOnly);
457  if (!(m_pStore->addToStore(dataID, dp).isSuccess())) {
458  warning() << " setupProxy:: could not addToStore proxy @" << dp
459  << endmsg;
460  recycle(pDObj); // commit this object to trash
461  delete dp;
462  dp = 0;
463  }
464  }
465  return dp;
466 }

◆ sourceID()

SG::SourceID SGImplSvc::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.

Returns an empty string if no source has been set.

The default version always returns an empty string.

Definition at line 1830 of file SGImplSvc.cxx.

1831 {
1832  lock_t lock (m_mutex);
1834  if (dp) {
1835  const DataHeader* dh = SG::DataProxy_cast<DataHeader> (dp);
1836  if (dh) {
1837  return dh->begin()->getToken()->dbID().toString();
1838  }
1839  }
1840  return "";
1841 }

◆ start()

StatusCode SGImplSvc::start ( )
finaloverridevirtual

Service start.

Definition at line 199 of file SGImplSvc.cxx.

199  {
200 
201  verbose() << "Start " << name() << endmsg;
202  /*
203  // This will need regFcn clients to be updated first.
204  if ( 0 == m_pPPS || (m_pPPS->preLoadProxies(*m_pStore)).isFailure() ) {
205  debug() << " Failed to preLoad proxies"
206  << endmsg;
207  return StatusCode::FAILURE;
208  }
209  */
210 
211  return StatusCode::SUCCESS;
212 }

◆ stop()

StatusCode SGImplSvc::stop ( )
finaloverridevirtual

Service stop.

Definition at line 214 of file SGImplSvc.cxx.

214  {
215 
216  verbose() << "Stop " << name() << endmsg;
217  //HACK ALERT: ID event store objects refer to det store objects
218  //by setting an ad-hoc priority for event store(s) we make sure they are finalized and hence cleared first
219  // see e.g. https://savannah.cern.ch/bugs/index.php?99993
220  if (store()->storeID() == StoreID::EVENT_STORE) {
221  ISvcManager* pISM(dynamic_cast<ISvcManager*>(serviceLocator().get()));
222  if (!pISM)
223  return StatusCode::FAILURE;
224  pISM->setPriority(name(), pISM->getPriority(name())+1).ignore();
225  verbose() << "stop: setting service priority to " << pISM->getPriority(name())
226  << " so that event stores get finalized and cleared before other stores" <<endmsg;
227  }
228  return StatusCode::SUCCESS;
229 }

◆ store() [1/2]

DataStore * SGImplSvc::store ( )
private

Definition at line 562 of file SGImplSvc.cxx.

563 {
564  return m_pStore;
565 }

◆ store() [2/2]

const DataStore * SGImplSvc::store ( ) const
private

Definition at line 568 of file SGImplSvc.cxx.

569 {
570  return m_pStore;
571 }

◆ storeID()

StoreID::type SGImplSvc::storeID ( ) const

get store ID. request forwarded to DataStore:

get store id from DataStore:

Definition at line 475 of file SGImplSvc.cxx.

476 {
477  lock_t lock (m_mutex);
478  return store()->storeID();
479 }

◆ stringToKey()

SGImplSvc::sgkey_t SGImplSvc::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 1455 of file SGImplSvc.cxx.

1456 {
1458  return m_stringpool.stringToKey (str, clid);
1459 }

◆ symLink() [1/2]

StatusCode SGImplSvc::symLink ( const CLID  id,
const std::string &  key,
const CLID  linkid 
)

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

Definition at line 588 of file SGImplSvc.cxx.

589 {
590  lock_t lock (m_mutex);
591  SG::DataProxy* dp(proxy(id, key, false));
592  // if symLink already exists, just return success
593  return isSymLinked(linkID,dp) ?
594  StatusCode::SUCCESS :
595  addSymLink(linkID,dp);
596 }

◆ symLink() [2/2]

StatusCode SGImplSvc::symLink ( const void *  p2BRegistered,
CLID  linkID 
)

make a soft link to the object T* already registered

Definition at line 577 of file SGImplSvc.cxx.

578 {
579  lock_t lock (m_mutex);
580  SG::DataProxy* dp(proxy(pObject));
581 
582  // if symLink already exists, just return success
583  return isSymLinked(linkID,dp) ?
584  StatusCode::SUCCESS :
585  addSymLink(linkID,dp);
586 }

◆ t2pRegister()

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

forwarded to DataStore

Definition at line 1272 of file SGImplSvc.cxx.

1273 {
1274  return m_pStore->t2pRegister(pTrans, pPers);
1275 }

◆ t2pRemove()

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

forwarded to DataStore

Definition at line 1279 of file SGImplSvc.cxx.

1280 {
1281  m_pStore->t2pRemove(pTrans);
1282 }

◆ transientContains()

bool SGImplSvc::transientContains ( const CLID  id,
const std::string &  key 
) const

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

returns false if object not available in TDS

Definition at line 709 of file SGImplSvc.cxx.

710 {
711  try {
712  return (0 != transientProxy(id, key));
713  } catch(...) { return false; }
714 }

◆ transientProxy()

DataProxy * SGImplSvc::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 964 of file SGImplSvc.cxx.

965 {
966  lock_t lock (m_mutex);
967  DataProxy* dp(m_pStore->proxy(id, key));
968  return ( (0 != dp && dp->isValidObject()) ? dp : 0 );
969 }

◆ transientSwap()

bool SGImplSvc::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 Note that the swap is invalidated at event boundaries and/or when somebody clear the store.

Returns
false if swap failed

Definition at line 988 of file SGImplSvc.cxx.

990 {
991  lock_t lock (m_mutex);
992  const bool checkValid = true;
993  DataProxy* a = proxy( id, keyA, checkValid );
994  DataProxy* b = proxy( id, keyB, checkValid );
995  if ( 0 == a || 0 == b ) { return false; }
996  DataObject* objA = a->accessData();
997  DataObject* objB = b->accessData();
998 
999  if ( 0 == objA || 0 == objB ) { return false; }
1000  // prevent 'accidental' release of DataObjects...
1001  const unsigned int refCntA = objA->addRef();
1002  const unsigned int refCntB = objB->addRef();
1003  // in case swap is being specialized for DataObjects
1004  using std::swap;
1005  swap( objA, objB );
1006  a->setObject( objA );
1007  b->setObject( objB );
1008  // and then restore old ref-count;
1009  return ( (refCntA-1) == objA->release() &&
1010  (refCntB-1) == objB->release() );
1011 }

◆ tryELRemap()

bool SGImplSvc::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 1609 of file SGImplSvc.cxx.

1611 {
1614  m_remap_impl->m_remaps.find (sgkey_in);
1615  if (i == m_remap_impl->m_remaps.end())
1616  return false;
1617  const SG::RemapImpl::remap_t& payload = i->second;
1618  sgkey_out = payload.target;
1619  index_out = index_in + payload.index_offset;
1620  return true;
1621 }

◆ typeCount()

int SGImplSvc::typeCount ( const CLID id) const

Return the number of instances of type T (input CLID)

Definition at line 692 of file SGImplSvc.cxx.

693 {
694  lock_t lock (m_mutex);
695  return m_pStore->typeCount(id);
696 }

◆ typeless_overwrite()

StatusCode SGImplSvc::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 1062 of file SGImplSvc.cxx.

1069 {
1070  lock_t lock (m_mutex);
1071  StatusCode sc(StatusCode::SUCCESS);
1072  SG::DataProxy* toRemove(proxy(clid, key, false));
1073  if (0 != toRemove) {
1074  toRemove->addRef();
1075  const bool FORCEREMOVE(true);
1076  sc =removeProxy(toRemove, (void*)0, FORCEREMOVE);
1077  }
1078  if (sc.isSuccess()) {
1079  const bool ALLOWOVERWRITE(true);
1080  const bool NORESET(false);
1081  if (record_impl( obj, key, raw_ptr, allowMods, NORESET, ALLOWOVERWRITE, tinfo) == nullptr)
1082  sc = StatusCode::FAILURE;
1083  else if ( m_ActivateHistory && noHist && store()->storeID() == StoreID::EVENT_STORE ) {
1084  sc = record_HistObj( obj->clID(), key, name(), allowMods, NORESET );
1085  }
1086  }
1087  //for detector store objects managed by IIOVSvc, replace the old proxy with the new one (#104311)
1088  if (toRemove && sc.isSuccess() && store()->storeID() == StoreID::DETECTOR_STORE) {
1089  sc = m_pIOVSvc->replaceProxy(toRemove, proxy(clid, key));
1090  }
1091  if (toRemove)
1092  toRemove->release();
1093  return sc;
1094 }

◆ typeless_record() [1/3]

StatusCode SGImplSvc::typeless_record ( DataObject *  obj,
const std::string &  key,
const void *const  raw_ptr,
bool  allowMods,
bool  resetOnly,
bool  noHist,
const std::type_info *  tinfo 
)
private

Definition at line 1024 of file SGImplSvc.cxx.

1028 {
1029  return typeless_record (obj, key, raw_ptr, allowMods, resetOnly, noHist,tinfo,
1030  nullptr, true);
1031 }

◆ typeless_record() [2/3]

StatusCode SGImplSvc::typeless_record ( DataObject *  obj,
const std::string &  key,
const void *const  raw_ptr,
bool  allowMods,
bool  resetOnly,
bool  noHist,
const std::type_info *  tinfo,
SG::DataProxy **  proxy_ret,
bool  noOverwrite 
)
private

Definition at line 1035 of file SGImplSvc.cxx.

1041 {
1042  lock_t lock (m_mutex);
1043  SG::DataProxy* proxy =
1044  record_impl( obj, key, raw_ptr, allowMods, resetOnly, !noOverwrite, tinfo);
1045  if ( proxy == nullptr )
1046  return StatusCode::FAILURE;
1047  if (proxy_ret)
1048  *proxy_ret = proxy;
1049 
1050  if ( !m_ActivateHistory || noHist ) {
1051  return StatusCode::SUCCESS;
1052  }
1053 
1054  if ( store()->storeID() != StoreID::EVENT_STORE ) {
1055  return StatusCode::SUCCESS;
1056  } else {
1057  return record_HistObj( obj->clID(), key, name(), allowMods, resetOnly );
1058  }
1059 }

◆ typeless_record() [3/3]

StatusCode SGImplSvc::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 1014 of file SGImplSvc.cxx.

1017 {
1018  return typeless_record (obj, key, raw_ptr, allowMods, resetOnly, noHist, 0,
1019  nullptr, true);
1020 }

◆ typeless_retrievePrivateCopy()

DataObject * SGImplSvc::typeless_retrievePrivateCopy ( const CLID  clid,
const std::string &  key 
)

Definition at line 1624 of file SGImplSvc.cxx.

1626 {
1627  lock_t lock (m_mutex);
1628  DataObject* obj = nullptr;
1629  SG::DataProxy* dp = proxy (clid, key);
1630  //we do not want anyone to mess up with our copy hence we release it immediately.
1631  if (dp && dp->isValid()) {
1632  obj = dp->object();
1633  obj->addRef();
1635  }
1636  return obj;
1637 }

◆ unboundHandle()

void SGImplSvc::unboundHandle ( IResetable handle)
finaloverridevirtual

Tell the store that a handle has been unbound from a proxy.

Parameters
handleThe handle that was unbound. The default implementation does nothing.

Definition at line 1767 of file SGImplSvc.cxx.

1768 {
1769  std::vector<IResetable*>& v = m_newBoundHandles[std::this_thread::get_id()];
1771  std::find (v.begin(), v.end(), handle);
1772  if (it != v.end())
1773  v.erase (it);
1774 }

Friends And Related Function Documentation

◆ ActiveStoreSvc

friend class ActiveStoreSvc
friend

Definition at line 669 of file SGImplSvc.h.

◆ AthenaInternal::py_sg_clearProxyPayload

◆ AthenaInternal::recordObjectToStore

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

◆ AthenaOutputStream

friend class AthenaOutputStream
friend

access proxyRange()

Definition at line 596 of file SGImplSvc.h.

◆ IOVDbSvc

friend class IOVDbSvc
friend

access clearProxyPayload

Definition at line 582 of file SGImplSvc.h.

◆ IOVSvcTool

friend class IOVSvcTool
friend

Definition at line 583 of file SGImplSvc.h.

◆ SG::VarHandleBase

friend class SG::VarHandleBase
friend

access typeless_record

Definition at line 604 of file SGImplSvc.h.

◆ StoreGateSvc

friend class StoreGateSvc
friend

Definition at line 602 of file SGImplSvc.h.

Member Data Documentation

◆ m_ActivateHistory

bool SGImplSvc::m_ActivateHistory
private

Activate the history service.

Definition at line 690 of file SGImplSvc.h.

◆ m_arena

SG::Arena SGImplSvc::m_arena
private

Allocation arena to associate with this store.

Definition at line 706 of file SGImplSvc.h.

◆ m_DumpArena

bool SGImplSvc::m_DumpArena
private

DumpArena Property flag : trigger m_arena->report() at clearStore.

Definition at line 691 of file SGImplSvc.h.

◆ m_DumpStore

bool SGImplSvc::m_DumpStore
private

Dump Property flag: triggers dump() at EndEvent.

Definition at line 689 of file SGImplSvc.h.

◆ m_folderNameList

StringArrayProperty SGImplSvc::m_folderNameList
private

FolderNameList Property.

Definition at line 694 of file SGImplSvc.h.

◆ m_mutex

mutex_t SGImplSvc::m_mutex
mutableprivate

Definition at line 722 of file SGImplSvc.h.

◆ m_newBoundHandles

std::map<std::thread::id, std::vector<IResetable*> > SGImplSvc::m_newBoundHandles
private

Keep track of proxies bound since the last call to commitNewDataObjects or clearStore.

Has to be done per-thread. We can't use thread_specific_ptr because we want to be able to clear the vectors for all threads in clearStore().

Definition at line 718 of file SGImplSvc.h.

◆ m_numSlots

int SGImplSvc::m_numSlots
private

The total number of slots. 1 if this isn't a Hive store.

Definition at line 712 of file SGImplSvc.h.

◆ m_pCLIDSvc

ServiceHandle<IClassIDSvc> SGImplSvc::m_pCLIDSvc
private

Definition at line 675 of file SGImplSvc.h.

◆ m_pDataLoader

ServiceHandle<IConversionSvc> SGImplSvc::m_pDataLoader
private

Definition at line 676 of file SGImplSvc.h.

◆ m_pHistorySvc

ServiceHandle<IHistorySvc> SGImplSvc::m_pHistorySvc
private

Definition at line 683 of file SGImplSvc.h.

◆ m_pIncSvc

ServiceHandle<IIncidentSvc> SGImplSvc::m_pIncSvc
private

property

Definition at line 688 of file SGImplSvc.h.

◆ m_pIOVSvc

ServiceHandle<IIOVSvc> SGImplSvc::m_pIOVSvc
private

get the IOVSvc "just in time" (breaks recursion at initialize)

Definition at line 697 of file SGImplSvc.h.

◆ m_pPPS

IProxyProviderSvc* SGImplSvc::m_pPPS
private

Definition at line 681 of file SGImplSvc.h.

◆ m_pPPSHandle

ServiceHandle<IProxyProviderSvc> SGImplSvc::m_pPPSHandle
private

Definition at line 678 of file SGImplSvc.h.

◆ m_pStore

SG::DataStore* SGImplSvc::m_pStore
private

Definition at line 685 of file SGImplSvc.h.

◆ m_remap_impl

SG::RemapImpl* SGImplSvc::m_remap_impl
private

Definition at line 703 of file SGImplSvc.h.

◆ m_remapMutex

mutex_t SGImplSvc::m_remapMutex
mutableprivate

Definition at line 723 of file SGImplSvc.h.

◆ m_slotNumber

int SGImplSvc::m_slotNumber
private

The Hive slot number for this store, or -1 if this isn't a Hive store.

Definition at line 709 of file SGImplSvc.h.

◆ m_storeLoaded

bool SGImplSvc::m_storeLoaded
private

FIXME hack needed by loadEventProxies.

Definition at line 699 of file SGImplSvc.h.

◆ m_stringpool

SG::StringPool SGImplSvc::m_stringpool
private

Definition at line 701 of file SGImplSvc.h.

◆ m_stringPoolMutex

mutex_t SGImplSvc::m_stringPoolMutex
mutableprivate

Definition at line 724 of file SGImplSvc.h.

◆ m_trash

std::list<DataObject*> SGImplSvc::m_trash
private

The Recycle Bin.

Definition at line 686 of file SGImplSvc.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
SG::DataProxy_cast
DATA * DataProxy_cast(DataProxy *proxy)
cast the proxy into the concrete data object it proxies
Definition: DataProxy_cast.h:53
SG::VersionedKey::isVersionedKey
static bool isVersionedKey(const char *)
quickly determine whether a string has the right format to be a VK
Definition: SGVersionedKey.cxx:18
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
SG::DataStore::typeCount
int typeCount(const CLID &id) const
Count number of object of a given type in store.
Definition: Control/SGTools/src/DataStore.cxx:407
common.sgkey
def sgkey(tool)
Definition: common.py:1027
TileDCSDataPlotter.dp
dp
Definition: TileDCSDataPlotter.py:842
SGImplSvc::addSymLink
StatusCode addSymLink(const CLID &linkid, SG::DataProxy *dp)
Definition: SGImplSvc.cxx:600
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:50
SG::DataStore::t2pRegister
StatusCode t2pRegister(const void *const pTrans, DataProxy *const pPers)
methods to query the T2PMap:
Definition: Control/SGTools/src/DataStore.cxx:615
header
Definition: hcg.cxx:526
SGImplSvc::clearStore
virtual StatusCode clearStore(bool forceRemove=false) override final
clear DataStore contents: called by the event loop mgrs
Definition: SGImplSvc.cxx:268
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
DataBucketBase
A non-templated base class for DataBucket, allows to access the transient object address as a void*.
Definition: DataBucketBase.h:24
SG::DataStore::proxy
virtual DataProxy * proxy(const TransientAddress *tAddr) const override
return proxy for a given type/key pair if key is empty returns the default proxy (currently last regi...
Definition: Control/SGTools/src/DataStore.cxx:416
SG::StringPool
Definition: StringPool.h:35
IProxyProviderSvc::loadProxies
virtual StatusCode loadProxies(IProxyRegistry &dataStore)=0
add new proxies to store every Event:
DataBucketBase::object
virtual void * object()=0
initialize
void initialize()
Definition: run_EoverP.cxx:894
SG::DataStore::addAlias
virtual StatusCode addAlias(const std::string &aliasKey, DataProxy *proxy) override
add alias to store
Definition: Control/SGTools/src/DataStore.cxx:379
extractSporadic.c1
c1
Definition: extractSporadic.py:133
SGImplSvc::removeProxy
StatusCode removeProxy(SG::DataProxy *proxy, const void *pTrans, bool forceRemove=false)
remove proxy from store, unless it is reset only.
Definition: SGImplSvc.cxx:1238
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
skel.it
it
Definition: skel.GENtoEVGEN.py:407
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:70
SG::TransientAddress
Definition: TransientAddress.h:32
SG::CurrentEventStore::setStore
static IProxyDict * setStore(IProxyDict *store)
Set the current store.
Definition: CurrentEventStore.cxx:36
SGImplSvc::m_newBoundHandles
std::map< std::thread::id, std::vector< IResetable * > > m_newBoundHandles
Keep track of proxies bound since the last call to commitNewDataObjects or clearStore.
Definition: SGImplSvc.h:718
SGImplSvc::proxyRange
StatusCode proxyRange(const CLID &id, SG::ConstProxyIterator &beg, SG::ConstProxyIterator &end) const
return a range to all proxies of a given CLID
Definition: SGImplSvc.cxx:1293
CLIDRegistry::CLIDToTypeinfo
static const std::type_info * CLIDToTypeinfo(CLID clid)
Translate between CLID and type_info.
Definition: CLIDRegistry.cxx:136
SGImplSvc::m_stringPoolMutex
mutex_t m_stringPoolMutex
Definition: SGImplSvc.h:724
SGImplSvc::m_pIncSvc
ServiceHandle< IIncidentSvc > m_pIncSvc
property
Definition: SGImplSvc.h:688
get_generator_info.stderr
stderr
Definition: get_generator_info.py:40
SGImplSvc::emptyTrash
void emptyTrash()
throw away bad objects
Definition: SGImplSvc.cxx:1344
SG::DataStore::ConstStoreIterator
StoreMap::const_iterator ConstStoreIterator
Definition: Control/SGTools/SGTools/DataStore.h:81
SG::DataStore::clearStore
void clearStore(bool force, bool hard, MsgStream *pmlog)
If HARD is true, then the bound objects should also clear any data that depends on the identity of th...
Definition: Control/SGTools/src/DataStore.cxx:68
SG::DataProxy::isValid
bool isValid() const
called by destructor
python.RatesEmulationExample.lock
lock
Definition: RatesEmulationExample.py:148
PyPoolBrowser.dh
dh
Definition: PyPoolBrowser.py:102
SGImplSvc::proxies
virtual std::vector< const SG::DataProxy * > proxies() const override final
return the list of all current proxies in store
Definition: SGImplSvc.cxx:933
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
SG::RemapImpl
Definition: SGImplSvc.cxx:85
SG::BaseInfoBase::get_bases
const std::vector< CLID > & get_bases() const
Return the class IDs of all known bases of T (that have class IDs).
Definition: BaseInfo.cxx:304
SG::DataStore::setStoreID
void setStoreID(StoreID::type id)
Definition: Control/SGTools/SGTools/DataStore.h:92
SG::detail::IteratorBase::setState
StatusCode setState(SG::ConstProxyIterator itr, SG::ConstProxyIterator itrEnd, bool isConst)
Reset state of the iterator.
Definition: SGIterator.cxx:94
SGImplSvc::m_ActivateHistory
bool m_ActivateHistory
Activate the history service.
Definition: SGImplSvc.h:690
SG::Arena::makeCurrent
ArenaBase * makeCurrent()
Make this Arena the current one for its ArenaHeader.
Definition: Arena.cxx:59
SG::DataProxy::CLIDCont_t
TransientAddress::TransientClidSet CLIDCont_t
Definition: DataProxy.h:54
SGImplSvc::m_storeLoaded
bool m_storeLoaded
FIXME hack needed by loadEventProxies.
Definition: SGImplSvc.h:699
SG::ArenaBase::report
void report(std::ostream &os) const
Generate a report of the memory in use by this Arena.
Definition: ArenaBase.cxx:76
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
SGImplSvc::m_slotNumber
int m_slotNumber
The Hive slot number for this store, or -1 if this isn't a Hive store.
Definition: SGImplSvc.h:709
SG::StringPool::clear
void clear()
Empty the pool.
Definition: StringPool.cxx:352
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:92
SG::RemapImpl::m_remaps
remap_map_t m_remaps
Definition: SGImplSvc.cxx:93
SGImplSvc::storeID
StoreID::type storeID() const
get store ID. request forwarded to DataStore:
Definition: SGImplSvc.cxx:475
SG::asStorable
DataObject * asStorable(SG::DataObjectSharedPtr< T > pObject)
Definition: DataObjectSharedPtr.h:65
DiTauMassTools::ignore
void ignore(T &&)
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:58
SGImplSvc::m_pStore
SG::DataStore * m_pStore
Definition: SGImplSvc.h:685
IResetable
a resetable object (e.g. a SG DataHandle)
Definition: IResetable.h:15
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
python.UpdateManyBadChannelIOVs.toRemove
tuple toRemove
Definition: UpdateManyBadChannelIOVs.py:86
SGImplSvc::m_pDataLoader
ServiceHandle< IConversionSvc > m_pDataLoader
Definition: SGImplSvc.h:676
SGImplSvc::m_DumpStore
bool m_DumpStore
Dump Property flag: triggers dump() at EndEvent.
Definition: SGImplSvc.h:689
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
SGImplSvc::clids
std::vector< CLID > clids() const
Return all CLIDs in the store.
Definition: SGImplSvc.cxx:943
DataHeader
This class provides the layout for summary information stored for data written to POOL.
Definition: DataHeader.h:126
lumiFormat.i
int i
Definition: lumiFormat.py:85
SG::ArenaHeader
Proxy for a group of Arenas.
Definition: ArenaHeader.h:54
SGImplSvc::bindHandleToProxy
bool bindHandleToProxy(const CLID &id, const std::string &key, IResetable *ir, SG::DataProxy *&dp)
name says it all
Definition: SGImplSvc.cxx:1355
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
SG::ArenaBase::reset
void reset()
Reset all contained allocators.
Definition: ArenaBase.cxx:44
SGImplSvc::m_arena
SG::Arena m_arena
Allocation arena to associate with this store.
Definition: SGImplSvc.h:706
SG::VersionedKey
a StoreGateSvc key with a version number. Notice that StoreGate does not order multiple instances of ...
Definition: SGVersionedKey.h:31
SGImplSvc::m_stringpool
SG::StringPool m_stringpool
Definition: SGImplSvc.h:701
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:37
SG::DataStore::addSymLink
StatusCode addSymLink(const CLID &linkid, DataProxy *proxy)
add symlink to store:
Definition: Control/SGTools/src/DataStore.cxx:332
SGImplSvc::clearProxyPayload
void clearProxyPayload(SG::DataProxy *)
use to reset a proxy (clearing the data object it contains) Unlike DataProxy::reset this method corre...
Definition: SGImplSvc.cxx:1561
SGImplSvc::setupProxy
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
Definition: SGImplSvc.cxx:427
SG::BaseInfoBase::get_copy_conversions
std::vector< CLID > get_copy_conversions() const
Return known copy conversions.
Definition: BaseInfo.cxx:455
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
SGImplSvc::m_pHistorySvc
ServiceHandle< IHistorySvc > m_pHistorySvc
Definition: SGImplSvc.h:683
SG::StringPool::keyToString
const std::string * keyToString(sgkey_t key) const
Find the string corresponding to a given key.
Definition: StringPool.cxx:288
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
SG::ArenaBase::erase
void erase()
Erase all contained allocators.
Definition: ArenaBase.cxx:60
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
SGImplSvc::record_impl
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
Definition: SGImplSvc.cxx:1097
WriteCalibToCool.swap
swap
Definition: WriteCalibToCool.py:94
IProxyProviderSvc::preLoadProxies
virtual StatusCode preLoadProxies(IProxyRegistry &dataStore)=0
add proxies to the store before Begin Event:
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
SG::DataProxy::clID
CLID clID() const
Retrieve clid.
StoreID::DETECTOR_STORE
@ DETECTOR_STORE
Definition: StoreID.h:27
SGImplSvc::msg_update_handler
void msg_update_handler(Gaudi::Details::PropertyBase &outputLevel)
callback for output level property
Definition: SGImplSvc.cxx:1285
SG::DataStore::storeID
virtual StoreID::type storeID() const override
Definition: Control/SGTools/SGTools/DataStore.h:93
IProxyProviderSvc::retrieveProxy
virtual SG::DataProxy * retrieveProxy(const CLID &id, const std::string &key, IProxyRegistry &dataStore)=0
Use a provider to create a proxy for ID/KEY.
SGImplSvc::recordAddress
StatusCode recordAddress(const std::string &skey, IOpaqueAddress *pAddress, bool clearAddressFlag=true)
Create a proxy object using an IOpaqueAddress and a transient key.
Definition: SGImplSvc.cxx:336
SGImplSvc::dump
std::string dump() const
dump objects in store.
Definition: SGImplSvc.cxx:522
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
SGImplSvc::record_HistObj
StatusCode record_HistObj(const CLID &id, const std::string &key, const std::string &store, bool allowMods, bool resetOnly=true)
Definition: SGImplSvc.cxx:1421
debug
const bool debug
Definition: MakeUncertaintyPlots.cxx:53
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:76
SG::BaseInfoBase::find
static const BaseInfoBase * find(CLID clid)
Find the BaseInfoBase instance for clid.
Definition: BaseInfo.cxx:570
SGImplSvc::recycle
void recycle(DataObject *pBadDObj)
put a bad (unrecordable) dobj away
Definition: SGImplSvc.cxx:1337
SGImplSvc::m_DumpArena
bool m_DumpArena
DumpArena Property flag : trigger m_arena->report() at clearStore.
Definition: SGImplSvc.h:691
SG::DataStore::keys
void keys(const CLID &id, std::vector< std::string > &vkeys, bool includeAlias, bool onlyValid)
Definition: Control/SGTools/src/DataStore.cxx:121
SGImplSvc::clid
CLID clid(const std::string &key) const
Retrieve the main CLID of the object recorded in StoreGate with the given "key" WARNING: slow!
Definition: SGImplSvc.cxx:1640
SGImplSvc::typeless_record
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...
Definition: SGImplSvc.cxx:1014
SG::DataProxy::name
virtual const name_type & name() const override final
Retrieve data object key == string.
SG::DataStore::locatePersistent
DataProxy * locatePersistent(const void *const pTransient) const
locate the persistent (proxy) for a given T* (void*):
Definition: Control/SGTools/src/DataStore.cxx:608
SGImplSvc::m_numSlots
int m_numSlots
The total number of slots. 1 if this isn't a Hive store.
Definition: SGImplSvc.h:712
PixelModuleFeMask_create_db.payload
string payload
Definition: PixelModuleFeMask_create_db.py:69
SGImplSvc::m_pCLIDSvc
ServiceHandle< IClassIDSvc > m_pCLIDSvc
Definition: SGImplSvc.h:675
SGImplSvc::addAlias
StatusCode addAlias(const std::string &aliasKey, SG::DataProxy *dp)
Definition: SGImplSvc.cxx:680
REPORT_MESSAGE
#define REPORT_MESSAGE(LVL)
Report a message.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:365
SGImplSvc::handle
virtual void handle(const Incident &) override final
triggered by Incident service
Definition: SGImplSvc.cxx:232
python.TrigPSCPythonDbSetup.outputLevel
outputLevel
Definition: TrigPSCPythonDbSetup.py:30
SG::IAuxStore
Interface for non-const operations on an auxiliary store.
Definition: IAuxStore.h:48
ir
int ir
counter of the current depth
Definition: fastadd.cxx:49
python.PyAthena.v
v
Definition: PyAthena.py:154
SG::DataProxy::isValidObject
bool isValidObject() const
is the object valid?
SG::ArenaHeader::defaultHeader
static ArenaHeader * defaultHeader()
Return the global default Header instance.
Definition: ArenaHeader.cxx:164
python.DataFormatRates.c2
c2
Definition: DataFormatRates.py:123
SG::DataStore::addToStore
virtual StatusCode addToStore(const CLID &id, DataProxy *proxy) override
add proxy to store.
Definition: Control/SGTools/src/DataStore.cxx:142
SG::DataProxy::hasAlias
bool hasAlias(const std::string &key) const
Test to see if a given string is in the alias set.
SGImplSvc::transientProxy
SG::DataProxy * transientProxy(const CLID &id, const std::string &key) const
get proxy with given id and key.
Definition: SGImplSvc.cxx:964
SG::DataStore::proxy_exact
virtual SG::DataProxy * proxy_exact(sgkey_t sgkey) const override
get proxy with given key.
Definition: Control/SGTools/src/DataStore.cxx:526
a
TList * a
Definition: liststreamerinfos.cxx:10
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
SGImplSvc::m_pIOVSvc
ServiceHandle< IIOVSvc > m_pIOVSvc
get the IOVSvc "just in time" (breaks recursion at initialize)
Definition: SGImplSvc.h:697
h
SG::DataProxy::transientID
bool transientID(CLID id) const
return the list of transient IDs (primary or symLinked):
SGImplSvc::m_trash
std::list< DataObject * > m_trash
The Recycle Bin.
Definition: SGImplSvc.h:686
SG::DataStore
Hold DataProxy instances associated with a store.
Definition: Control/SGTools/SGTools/DataStore.h:74
SG::DataStore::proxies
const std::vector< DataProxy * > & proxies() const
All proxies managed by this store.
Definition: Control/SGTools/src/DataStore.cxx:629
copySelective.target
string target
Definition: copySelective.py:36
StoreID::findStoreID
static StoreID::type findStoreID(const std::string &storeName)
Definition: StoreID.cxx:21
python.TriggerHandler.verbose
verbose
Definition: TriggerHandler.py:296
DeMoScan.first
bool first
Definition: DeMoScan.py:534
DEBUG
#define DEBUG
Definition: page_access.h:11
SG::BaseInfoBase
The non-template portion of the BaseInfo implementation.
Definition: Control/AthenaKernel/AthenaKernel/BaseInfo.h:451
SG::DataStore::t2pRemove
void t2pRemove(const void *const pTrans)
Definition: Control/SGTools/SGTools/DataStore.h:256
SGImplSvc::store
SG::DataStore * store()
Definition: SGImplSvc.cxx:562
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition: hcg.cxx:127
SGImplSvc::m_pPPS
IProxyProviderSvc * m_pPPS
Definition: SGImplSvc.h:681
python.SystemOfUnits.s
float s
Definition: SystemOfUnits.py:147
SG::DataStore::pRange
StatusCode pRange(const CLID &id, SG::ConstProxyIterator &f, SG::ConstProxyIterator &e) const
Return an iterator over proxy for a given CLID:
Definition: Control/SGTools/src/DataStore.cxx:576
SGImplSvc::lock_t
std::lock_guard< mutex_t > lock_t
Definition: SGImplSvc.h:721
SG::DataStore::removeProxy
StatusCode removeProxy(DataProxy *proxy, bool forceRemove, bool hard)
remove proxy from store, unless proxy is reset only.
Definition: Control/SGTools/src/DataStore.cxx:199
SG::StringPool::merge
bool merge(const StringPool &other)
Merge another pool into this one.
Definition: StringPool.cxx:365
copySelective.source
string source
Definition: copySelective.py:31
str
Definition: BTagTrackIpAccessor.cxx:11
dbg::print
void print(std::FILE *stream, std::format_string< Args... > fmt, Args &&... args)
Definition: SGImplSvc.cxx:70
ATLAS_THREAD_SAFE
#define ATLAS_THREAD_SAFE
Definition: checker_macros.h:211
StoreID::EVENT_STORE
@ EVENT_STORE
Definition: StoreID.h:26
SGImplSvc::createKey
std::string createKey(const CLID &dataID)
creates a key internally if none specified by client
Definition: SGImplSvc.cxx:262
SG::StringPool::stringToKey
sgkey_t stringToKey(const std::string &str, sgaux_t aux=0)
Find the key for a string.
Definition: StringPool.cxx:250
SG::RemapImpl::remap_t
Definition: SGImplSvc.cxx:88
get_generator_info.error
error
Definition: get_generator_info.py:40
SG::IConstAuxStore
Interface for const operations on an auxiliary store.
Definition: IConstAuxStore.h:64
SGImplSvc::m_mutex
mutex_t m_mutex
Definition: SGImplSvc.h:722
SGImplSvc::t2pRemove
void t2pRemove(const void *const pTrans)
forwarded to DataStore
Definition: SGImplSvc.cxx:1279
python.PyAthena.obj
obj
Definition: PyAthena.py:132
SGImplSvc::m_pPPSHandle
ServiceHandle< IProxyProviderSvc > m_pPPSHandle
Definition: SGImplSvc.h:678
SG::DataProxy
Definition: DataProxy.h:45
SGImplSvc::proxy
virtual SG::DataProxy * proxy(const void *const pTransient) const override final
get proxy for a given data object address in memory
Definition: SGImplSvc.cxx:718
SGImplSvc::isSymLinked
bool isSymLinked(const CLID &linkID, SG::DataProxy *dp)
Definition: SGImplSvc.cxx:492
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
SG::DataStore::tRange
StatusCode tRange(ConstStoreIterator &f, ConstStoreIterator &e) const
Return an iterator over the StoreMap:
Definition: Control/SGTools/src/DataStore.cxx:598
SGImplSvc::t2pRegister
StatusCode t2pRegister(const void *const pTrans, SG::DataProxy *const pPers)
forwarded to DataStore
Definition: SGImplSvc.cxx:1272
SG::DataStore::proxy_exact_unlocked
SG::DataProxy * proxy_exact_unlocked(sgkey_t sgkey, std::recursive_mutex &mutex) const
Like proxy_exact, but intended to be called without holding the store lock.
Definition: Control/SGTools/src/DataStore.cxx:545
python.compressB64.c
def c
Definition: compressB64.py:93
python.ParticleTypeUtil.info
def info
Definition: ParticleTypeUtil.py:87
SG::ArenaBase::name
const std::string & name() const
Return this Arena's name.
Definition: ArenaBase.cxx:114
SG::ConstProxyIterator
ProxyMap::const_iterator ConstProxyIterator
Definition: ProxyMap.h:28
SG::StringPool::registerKey
bool registerKey(sgkey_t key, const std::string &str, sgaux_t aux=0)
Remember an additional mapping from key to string.
Definition: StringPool.cxx:321
SGImplSvc::addAutoSymLinks
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.
Definition: SGImplSvc.cxx:1674
SGImplSvc::m_remap_impl
SG::RemapImpl * m_remap_impl
Definition: SGImplSvc.h:703
SGImplSvc::m_remapMutex
mutex_t m_remapMutex
Definition: SGImplSvc.h:723
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37