![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
10 #include <unordered_map>
24 #include "GaudiKernel/IClassIDSvc.h"
25 #include "GaudiKernel/IHistorySvc.h"
26 #include "GaudiKernel/ISvcLocator.h"
27 #include "GaudiKernel/IConversionSvc.h"
28 #include "GaudiKernel/Incident.h"
29 #include "GaudiKernel/IOpaqueAddress.h"
30 #include "GaudiKernel/MsgStream.h"
31 #include "GaudiKernel/StatusCode.h"
32 #include "GaudiKernel/DataHistory.h"
50 using std::ostringstream;
91 m_pPPSHandle(
"ProxyProviderSvc",
name),
94 m_pIncSvc(
"IncidentSvc",
name),
96 m_ActivateHistory(false),
100 m_remap_impl (
new SG::RemapImpl),
152 if (!(
m_pIncSvc.retrieve()).isSuccess()) {
153 error() <<
"Could not locate IncidentSvc "
155 return StatusCode::FAILURE;
164 const bool CREATEIF(
true);
166 if (!(service(
"EventPersistencySvc",
m_pDataLoader, CREATEIF)).isSuccess()) {
168 error() <<
"Could not get pointer to Persistency Service"
170 return StatusCode::FAILURE;
173 if (!(service(
"ClassIDSvc",
m_pCLIDSvc, CREATEIF)).isSuccess()) {
174 error() <<
"Could not get pointer to ClassID Service"
176 return StatusCode::FAILURE;
186 SG_MSG_DEBUG(
" Failed to preLoad proxies");
187 return StatusCode::FAILURE;
192 !(service(
"HistorySvc",
m_pHistorySvc, CREATEIF)).isSuccess()) {
193 error() <<
"Could not locate History Service"
195 return StatusCode::FAILURE;
198 return StatusCode::SUCCESS;
213 return StatusCode::SUCCESS;
223 ISvcManager* pISM(
dynamic_cast<ISvcManager*
>(serviceLocator().
get()));
225 return StatusCode::FAILURE;
226 pISM->setPriority(
name(), pISM->getPriority(
name())+1).ignore();
227 verbose() <<
"stop: setting service priority to " << pISM->getPriority(
name())
228 <<
" so that event stores get finalized and cleared before other stores" <<
endmsg;
230 return StatusCode::SUCCESS;
237 warning() <<
"Could not locate IOVSvc "
246 if (inc.type() ==
"EndEvent") {
248 SG_MSG_DEBUG(
"Dumping StoreGate Contents");
281 std::ostringstream
s;
293 debug() <<
"Clearing store with forceRemove="
305 return StatusCode::SUCCESS;
316 const bool FORCEREMOVE(
true);
338 const bool FORCEREMOVE(
true);
341 return StatusCode::SUCCESS;
346 static const InterfaceID IID(
"SGImplSvc", 1, 0);
357 if ( IProxyDict::interfaceID().versionMatch(riid) ) {
360 else if ( IProxyDict::interfaceID().versionMatch(riid) ) {
373 return Service::queryInterface(riid, ppvInterface);
376 return StatusCode::SUCCESS;
384 IOpaqueAddress* pAddress,
385 bool clearAddressFlag)
388 assert(0 != pAddress);
389 CLID dataID = pAddress->clID();
393 warning() <<
"recordAddress: Invalid Class ID found in IOpaqueAddress @"
394 << pAddress <<
". IOA will not be recorded"
396 return StatusCode::FAILURE;
405 if (
dp &&
dp->provider()) {
406 std::string clidTypeName;
407 m_pCLIDSvc->getTypeNameOfID(dataID, clidTypeName).ignore();
408 warning() <<
"recordAddress: failed for key="<< skey <<
", type "
410 <<
" (CLID " << dataID <<
')'
411 <<
"\n there is already a persistent version of this object. Will not record a duplicate! "
413 return StatusCode::FAILURE;
428 pAddress, clearAddressFlag),
434 else if ((0 !=
dp) && (0 ==
dp->address()))
438 dp->setAddress(pAddress);
443 m_pCLIDSvc->getTypeNameOfID(dataID, errType).ignore();
444 warning() <<
"recordAddress: preexisting proxy @" <<
dp
445 <<
" with non-NULL IOA found for key "
446 << skey <<
" type " << errType <<
" (" << dataID <<
"). \n"
447 <<
"Cannot record IOpaqueAddress @" << pAddress
449 return StatusCode::FAILURE;
452 return StatusCode::SUCCESS;
463 assert(0 != pAddress);
465 CLID dataID = pAddress->clID();
467 string gK = (pAddress->par())[1];
468 if (gK.empty()) gK = (pAddress->par())[0];
483 if (0 !=
dp->object())
486 warning() <<
" setupProxy:: error setting up proxy for key "
487 << gK <<
" and clid " << dataID
488 <<
"\n Pre-existing valid DataProxy @"<<
dp
489 <<
" found in Store for key " <<
dp->object()->name()
490 <<
" with clid " <<
dp->object()->clID()
496 dp->setObject(pDObj);
497 if (!allowMods)
dp->setConst();
503 !allowMods, resetOnly);
505 warning() <<
" setupProxy:: could not addToStore proxy @" <<
dp
531 bool includeAlias,
bool onlyValid)
535 return store()->
keys(
id, vkeys, includeAlias, onlyValid);
541 return (0 !=
dp) ?
dp->transientID(linkID) :
false;
573 ost <<
"<<<<<<<<<<<<<<<<< Data Store Dump >>>>>>>>>>>>>>> \n";
574 ost <<
"SGImplSvc(" +
name() +
")::dump():\n";
576 DataStore::ConstStoreIterator s_iter, s_end;
579 for (; s_iter != s_end; ++s_iter)
582 CLID id = s_iter->first;
585 m_pCLIDSvc->getTypeNameOfID(
id, tname).ignore();
586 ost <<
"Found " << nProxy << ((nProxy == 1) ?
" proxy" :
" proxies")
587 <<
" for ClassID " <<
id <<
" ("<< tname <<
"): \n";
593 while (p_iter != p_end) {
597 << setw(7) << (
dp.isValid() ?
"valid" :
"INVALID") <<
", "
598 << setw(8) << (
dp.isConst() ?
"locked" :
"UNLOCKED") <<
", "
599 << setw(6) << (
dp.isResetOnly() ?
"reset" :
"DELETE")
600 <<
") --- data: " << hex << setw(10) <<
dp.object() << dec
601 <<
" --- key: " << p_iter->first <<
'\n';
605 ost <<
"<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>> \n";
634 StatusCode::SUCCESS :
644 StatusCode::SUCCESS :
653 warning() <<
"addSymLink: no target DataProxy found. Sorry, can't link to a non-existing data object"
655 return StatusCode::FAILURE;
661 if (
sc.isSuccess() &&
dp->object()) {
677 error() <<
"setAlias: problem setting alias "
679 <<
"DataObject does not exist, record before setting alias."
681 return StatusCode::FAILURE;
685 if (
sc.isFailure()) {
686 error() <<
"setAlias: problem setting alias "
688 <<
"DataObject does not exist, record before setting alias."
690 return StatusCode::FAILURE;
693 return StatusCode::SUCCESS;
698 const std::string&
key,
const std::string& aKey)
705 error() <<
"setAlias: problem setting alias "
706 << std::string(aKey) <<
'\n'
707 <<
"DataObject does not exist, record before setting alias."
709 return StatusCode::FAILURE;
713 if (
sc.isFailure()) {
714 error() <<
"setAlias: problem setting alias "
715 << (std::string)aKey <<
'\n'
716 <<
"DataObject does not exist, record before setting alias."
718 return StatusCode::FAILURE;
721 return StatusCode::SUCCESS;
733 warning() <<
"addAlias: no target DataProxy given, Cannot alias to a non-existing object"
735 return StatusCode::FAILURE;
754 }
catch(...) {
return false; }
763 }
catch(...) {
return false; }
779 return proxy(
id,
false);
797 if (checkValid && 0 !=
dp) {
801 return dp->isValid() ?
dp : 0;
826 if (checkValid && 0 !=
dp && !(
dp->isValid()))
dp = 0;
864 const std::string&
key,
869 const void* raw_ptr =
obj.get();
870 const std::type_info* tinfo =
nullptr;
873 raw_ptr = bucket->object();
874 tinfo = &bucket->tinfo();
877 if (returnExisting) {
888 std::string clidTypeName;
890 warning() <<
"SGImplSvc::recordObject: addAlias fails for object "
892 <<
" and new key " <<
key
905 std::string clidTypeName;
908 std::string newclidTypeName;
909 m_pCLIDSvc->getTypeNameOfID(newclid, newclidTypeName).ignore();
910 error() <<
"SGImplSvc::recordObject: addSymLink fails for object "
912 <<
" and new clid " << newclid <<
"[" << newclidTypeName <<
"]"
920 std::string clidTypeName;
923 std::string newclidTypeName;
924 m_pCLIDSvc->getTypeNameOfID(newclid, newclidTypeName).ignore();
925 error() <<
"SGImplSvc::recordObject: existing object found with "
927 <<
" but neither clid " << newclid <<
"[" << newclidTypeName <<
"]"
928 <<
" nor key " <<
key <<
" match."
937 const bool resetOnly =
true;
938 const bool noHist =
false;
941 allowMods, resetOnly, noHist, tinfo,
942 &
proxy,
true).isFailure())
975 std::vector<const SG::DataProxy*>
991 DataStore::ConstStoreIterator s_iter, s_end;
994 std::vector<CLID>
clids;
997 for (; s_iter != s_end; ++s_iter ) {
998 const CLID id = s_iter->first;
999 clids.push_back (
id);
1011 return ( (0 !=
dp &&
dp->isValidObject()) ?
dp : 0 );
1019 return (0 == theProxy) ? 0 : theProxy->
accessData();
1027 return (0 == theProxy) ? 0 : theProxy->
accessData();
1032 const std::string& keyA,
const std::string& keyB )
1035 const bool checkValid =
true;
1038 if ( 0 ==
a || 0 ==
b ) {
return false; }
1039 DataObject* objA =
a->accessData();
1040 DataObject* objB =
b->accessData();
1042 if ( 0 == objA || 0 == objB ) {
return false; }
1044 const unsigned int refCntA = objA->addRef();
1045 const unsigned int refCntB = objB->addRef();
1049 a->setObject( objA );
1050 b->setObject( objB );
1052 return ( (refCntA-1) == objA->release() &&
1053 (refCntB-1) == objB->release() );
1058 const void*
const raw_ptr,
1059 bool allowMods,
bool resetOnly,
bool noHist)
1068 const void*
const raw_ptr,
1069 bool allowMods,
bool resetOnly,
bool noHist,
1070 const std::type_info* tinfo)
1079 const void*
const raw_ptr,
1080 bool allowMods,
bool resetOnly,
bool noHist,
1081 const std::type_info* tinfo,
1088 if (
proxy ==
nullptr )
1089 return StatusCode::FAILURE;
1094 return StatusCode::SUCCESS;
1098 return StatusCode::SUCCESS;
1107 const std::string&
key,
1108 const void*
const raw_ptr,
1111 const std::type_info* tinfo)
1118 const bool FORCEREMOVE(
true);
1121 if (
sc.isSuccess()) {
1122 const bool ALLOWOVERWRITE(
true);
1123 const bool NORESET(
false);
1124 if (
record_impl(
obj,
key, raw_ptr, allowMods, NORESET, ALLOWOVERWRITE, tinfo) ==
nullptr)
1125 sc = StatusCode::FAILURE;
1141 const void*
const raw_ptr,
1142 bool allowMods,
bool resetOnly,
bool allowOverwrite,
1143 const std::type_info* tinfo)
1146 std::string rawKey(
key);
1154 const std::string& pTAName(
dp->name());
1163 warning() <<
"record_impl: Could not setup alias key "
1165 <<
" for unversioned object " << pTAName
1180 if (!allowOverwrite &&
m_pPPS) {
1186 if (
dp &&
dp->provider()) {
1187 std::string clidTypeName;
1189 warning() <<
"record_impl: you are recording an object with key "
1190 << rawKey <<
", type " << clidTypeName
1191 <<
" (CLID " <<
clid <<
')'
1192 <<
"\n There is already a persistent version of this object. Recording a duplicate may lead to unreproducible results and it is deprecated."
1200 std::string clidTypeName;
1202 warning() <<
"record_impl: failed for key="<< rawKey <<
", type "
1204 <<
" (CLID " <<
clid <<
')'
1205 <<
"\n object @" << raw_ptr
1206 <<
" already in store with key="<<
dp->name()
1207 <<
". Will not record a duplicate! "
1209 if (pDObj !=
dp->object()) {
1211 if (!pDBB) std::abort();
1222 std::string clidTypeName;
1224 warning() <<
"record_impl: Problem setting up the proxy for object @"
1226 <<
"\n recorded with key " << rawKey
1227 <<
" of type " << clidTypeName
1228 <<
" (CLID " <<
clid <<
") in DataObject @" << pDObj
1236 std::string clidTypeName;
1238 warning() <<
"record_impl: can not add to t2p map object @" <<raw_ptr
1239 <<
"\n with key " << rawKey
1240 <<
" of type " << clidTypeName
1241 <<
" (CLID " <<
clid <<
')'
1256 warning() <<
"record_impl: Could not setup alias key " << vk.
key()
1257 <<
" for VersionedKey " << rawKey
1258 <<
". Generic access to this object with clid" <<
clid
1269 bool checkValid)
const
1273 if (checkValid && 0 !=
dp) {
1274 return dp->isValid() ?
dp : 0;
1286 if (0 ==
proxy)
return StatusCode::FAILURE;
1290 if (bucket) pTrans = bucket->
object();
1301 for (SG::DataProxy::CLIDCont_t::const_iterator
i =
clids.begin();
1351 warning() <<
"setConst: NO Proxy for the dobj you want to set const"
1353 return StatusCode::FAILURE;
1357 return StatusCode::SUCCESS;
1375 const bool FORCEREMOVE(
true);
1404 if (
dp ==
nullptr &&
m_pPPS !=
nullptr) {
1408 if (0 ==
dp)
return false;
1410 if (!
dp->bindHandle(
ir) ) {
1411 fatal() <<
"DataHandle at " << hex <<
ir << dec
1412 <<
" already bound to DataProxy with key " <<
ir->key()
1413 <<
". Cannot bind to proxy " <<
dp->name() <<
" as well\n"
1414 <<
" You have probably registered multiple callbacks via regFcn with the same DataHandle using different keys (DataProxies)\n"
1422 SG_MSG_DEBUG(
" Bound handle " << MSG::hex <<
ir <<
" to proxy "
1437 if (
sc.isFailure())
return false;
1454 if (
sc.isFailure())
return false;
1456 if (
sc.isFailure())
return false;
1465 const std::string&
store,
1466 bool allowMods,
bool resetOnly) {
1475 if (
sc.isFailure() || idname.empty() ) {
1483 const bool ALLOWOVERWRITE(
false);
1484 if (
record_impl(
obj, idname, dho, allowMods, resetOnly, ALLOWOVERWRITE,
1485 &
typeid(DataHistory)) ==
nullptr)
1486 return StatusCode::FAILURE;
1487 return StatusCode::SUCCESS;
1550 const std::string&
str,
1558 <<
" maps to multiple string key/CLID pairs: "
1559 << *str2 <<
"/" << clid2 <<
" and "
1595 SG::DataProxy::CLIDCont_t::const_iterator
i(
clids.begin()),
e(
clids.end());
1601 pP->
reset (hard_reset);
1614 if (
dp->isValidObject()) {
1616 SG::DataProxy::CLIDCont_t::const_iterator
i(
clids.begin()),
e(
clids.end());
1623 dp->reset (hard_reset);
1641 payload.index_offset = index_offset;
1655 sgkey_t& sgkey_out,
size_t& index_out)
1664 index_out = index_in +
payload.index_offset;
1670 const std::string&
key)
1673 DataObject*
obj =
nullptr;
1676 if (
dp &&
dp->isValid()) {
1691 for ( ; s_iter != s_end; ++s_iter ) {
1692 if ( s_iter->second.find(
key ) != s_iter->second.end() ) {
1693 return s_iter->first;
1704 std::vector<CLID>
clids;
1708 for ( ; s_iter != s_end; ++s_iter ) {
1709 if ( s_iter->second.find(
key ) != s_iter->second.end() ) {
1710 clids.push_back(s_iter->first);
1722 const std::type_info* tinfo,
1739 const std::vector<CLID>& bases = bib->
get_bases();
1740 for ( std::size_t
i = 0, iMax = bases.size();
i < iMax; ++
i ) {
1741 if ( bases[
i] !=
clid ) {
1748 warning() <<
"record_impl: Doing auto-symlinks for object with CLID "
1750 <<
" and SG key " <<
key
1751 <<
": Proxy already set for base CLID " << bases[
i]
1752 <<
"; not making auto-symlink." <<
endmsg;
1761 warning() <<
"record_impl: Doing auto-symlinks for object with CLID "
1763 <<
" and SG key " <<
key
1764 <<
": Proxy already set for copy-conversion CLID "
1766 <<
"; not making auto-symlink." <<
endmsg;
1773 warning() <<
"record_impl: Could not find suitable SG::BaseInfoBase for CLID ["
1774 <<
clid <<
"] (" <<
key <<
") !\t"
1775 <<
"No auto-symlink established !"
1787 std::vector<IResetable*> handles;
1790 h->reset (hard_reset);
1844 IOpaqueAddress* addr,
1845 DataObject*& refpObject)
1852 return cvt->createObj (addr, refpObject);
1859 std::cout << sg->
dump() <<
"\n";
1864 f << sg->
dump() <<
"\n";
1882 return dh->begin()->getToken()->dbID().toString();
1904 SG_MSG_DEBUG(
"retrieve(range): no object found "
1905 <<
" of type " << typnam
1906 <<
"(CLID " <<
clid <<
')');
1914 SG_MSG_DEBUG(
"retrieve(range): Can't initialize iterator for object range "
1915 <<
" of type " << typnam
1916 <<
"(CLID " <<
clid <<
')');
1917 return StatusCode::FAILURE;
1920 return StatusCode::SUCCESS;
1925 const std::string&
key,
1935 SG_MSG_VERBOSE(
"called associateAux_impl for key " +
key);
1940 if (!
dp->isConst()) {
1960 const std::string&
key,
1964 SG_MSG_VERBOSE(
"called associateAux_impl for key " +
key);
1969 if (!
dp->isConst()) {
JetConstituentVector::iterator iterator
bool mergeStringPool(const SGImplSvc &other)
Merge the string pool from another store into this one.
static bool isVersionedKey(const char *)
quickly determine whether a string has the right format to be a VK
bool associateAux_impl(SG::AuxVectorBase *ptr, const std::string &key, CLID auxclid) const
int typeCount(const CLID &id) const
Count number of object of a given type in store.
StatusCode setAlias(CLID clid, const std::string &key, const std::string &aliasKey)
make an alias to a DataObject (provide data type and old key)
bool contains(const CLID id, const std::string &key) const
Look up a keyed object in TDS by CLID.
virtual StatusCode createObj(IConverter *cvt, IOpaqueAddress *addr, DataObject *&refpObject) override
Call converter to create an object, with locking.
StatusCode addSymLink(const CLID &linkid, SG::DataProxy *dp)
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
StatusCode setConst(const void *pointer)
prevent downstream clients from modifying the pointed-at dobj
SGImplSvc(const SGImplSvc &)=delete
StatusCode t2pRegister(const void *const pTrans, DataProxy *const pPers)
methods to query the T2PMap:
SG::DataProxy * locatePersistent(const SG::TransientAddress *tAddr, bool checkValid=false) const
virtual StatusCode clearStore(bool forceRemove=false) override final
clear DataStore contents: called by the event loop mgrs
virtual void commitNewDataObjects() override final
Reset handles added since the last call to commit.
std::string find(const std::string &s)
return a remapped string
A non-templated base class for DataBucket, allows to access the transient object address as a void*.
virtual SG::DataProxy * recordObject(SG::DataObjectSharedPtr< DataObject > obj, const std::string &key, bool allowMods, bool returnExisting) override final
Record an object in the store.
virtual StatusCode loadProxies(IProxyRegistry &dataStore)=0
add new proxies to store every Event:
unsigned char version() const
Base class for elements of a container that can have aux data.
IIOVSvc * getIIOVSvc()
get the IOVSvc "just in time" (breaks recursion at initialize)
virtual void * object()=0
void SG_dump(SGImplSvc *sg)
These are intended to be easy to call from the debugger.
virtual void boundHandle(IResetable *handle) override final
Tell the store that a proxy has been bound to a handle.
StatusCode removeProxy(SG::DataProxy *proxy, const void *pTrans, bool forceRemove=false)
remove proxy from store, unless it is reset only.
IStringPool::sgkey_t sgkey_t
virtual sgkey_t stringToKey(const std::string &str, CLID clid) override final
Find the key for a string/CLID pair.
virtual StatusCode addToStore(const CLID &id, DataProxy *proxy)
add proxy to store.
DataObject * accessData()
Access DataObject on-demand using conversion service.
std::map< std::thread::id, std::vector< IResetable * > > m_newBoundHandles
Keep track of proxies bound since the last call to commitNewDataObjects or clearStore.
static IProxyDict * setStore(IProxyDict *store)
Set the current store.
virtual StatusCode regProxy(SG::DataProxy *proxy, const std::string &key, const std::string &storeName="StoreGateSvc")=0
Subscribe method for DataProxy. key StoreGate key.
StatusCode proxyRange(const CLID &id, SG::ConstProxyIterator &beg, SG::ConstProxyIterator &end) const
return a range to all proxies of a given CLID
static const std::type_info * CLIDToTypeinfo(CLID clid)
Translate between CLID and type_info.
void setStore(SG::IAuxStore *store)
Set the store associated with this object.
mutex_t m_stringPoolMutex
ServiceHandle< IIncidentSvc > m_pIncSvc
property
void emptyTrash()
throw away bad objects
DataObject * asStorable(T *pObject)
StoreMap::const_iterator ConstStoreIterator
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...
void releaseObject(const CLID &id, const std::string &key)
release object held by proxy, if any.
bool isValid() const
called by destructor
virtual StatusCode replaceProxy(SG::DataProxy *pOld, SG::DataProxy *pNew, const std::string &storeName="StoreGateSvc")=0
replace a registered proxy with a new version
virtual std::vector< const SG::DataProxy * > proxies() const override final
return the list of all current proxies in store
static const InterfaceID & interfaceID()
Gaudi boilerplate.
virtual StatusCode reinitialize() override final
Service reinitialization.
SG::sgkey_t sgkey_t
Type of the keys.
const std::vector< CLID > & get_bases() const
Return the class IDs of all known bases of T (that have class IDs).
virtual DataProxy * proxy(const TransientAddress *tAddr) const
return proxy for a given type/key pair if key is empty returns the default proxy (currently last regi...
virtual SG::SourceID sourceID(const std::string &key="EventSelector") const override
Return the metadata source ID for the current event slot.
static bool isAuto(const std::string &)
quickly determine whether a string has the right format to be a VK with auto-generated version #
void setStoreID(StoreID::type id)
Manage index tracking and synchronization of auxiliary data.
StatusCode setState(SG::ConstProxyIterator itr, SG::ConstProxyIterator itrEnd, bool isConst)
Reset state of the iterator.
Manage index tracking and synchronization of auxiliary data.
bool m_ActivateHistory
Activate the history service.
ArenaBase * makeCurrent()
Make this Arena the current one for its ArenaHeader.
TransientAddress::TransientClidSet CLIDCont_t
bool m_storeLoaded
FIXME hack needed by loadEventProxies.
void report(std::ostream &os) const
Generate a report of the memory in use by this Arena.
int m_slotNumber
The Hive slot number for this store, or -1 if this isn't a Hive store.
virtual const std::string * keyToString(sgkey_t key) const override final
Find the string corresponding to a given key.
void clear()
Empty the pool.
virtual StatusCode initialize() override final
Service initialization.
StatusCode typeless_overwrite(const CLID &id, DataObject *obj, const std::string &key, const void *const raw_ptr, bool allowMods, bool noHist=false, const std::type_info *tinfo=0)
same as typeless_record, allows to overwrite an object in memory or on disk
bool bindHandleToProxyAndRegister(const CLID &id, const std::string &key, IResetable *ir, SG::DataProxy *&dp)
Also do registration with IOVSvc.
StoreID::type storeID() const
get store ID. request forwarded to DataStore:
virtual void unboundHandle(IResetable *handle) override final
Tell the store that a handle has been unbound from a proxy.
SG::DataProxy * proxy_exact(sgkey_t sgkey) const
get proxy with given key.
a resetable object (e.g. a SG DataHandle)
bool m_DumpStore
Dump Property flag: triggers dump() at EndEvent.
msgSvc
Provide convenience handles for various services.
std::vector< CLID > clids() const
Return all CLIDs in the store.
void setStore(const SG::IConstAuxStore *store)
Set the store associated with this object.
bool bindHandleToProxy(const CLID &id, const std::string &key, IResetable *ir, SG::DataProxy *&dp)
name says it all
IStringPool::sgkey_t sgkey_t
::StatusCode StatusCode
StatusCode definition for legacy code.
void reset()
Reset all contained allocators.
SG::Arena m_arena
Allocation arena to associate with this store.
AliasCont_t alias() const
access set of proxy aliases Returns a COPY of the alias set.
a StoreGateSvc key with a version number. Notice that StoreGate does not order multiple instances of ...
SG::StringPool m_stringpool
IHistorySvc * m_pHistorySvc
Default, invalid implementation of ClassID_traits.
Maintain a mapping of strings to 64-bit ints.
DataObject * accessData(const CLID &id) const
find proxy and access its data. Returns 0 to flag failure
StatusCode addSymLink(const CLID &linkid, DataProxy *proxy)
add symlink to store:
void clearProxyPayload(SG::DataProxy *)
use to reset a proxy (clearing the data object it contains) Unlike DataProxy::reset this method corre...
SG::DataProxy * setupProxy(const CLID &dataID, const std::string &gK, DataObject *pDObj, bool allowMods, bool resetOnly)
try to locate a proxy or create it if needed
boost::function< StatusCode(IOVSVC_CALLBACK_ARGS) > IOVSvcCallBackFcn
the type of an IOVSvc call back: it wraps both the method and the object the method is called on
std::vector< CLID > get_copy_conversions() const
Return known copy conversions.
The Athena Transient Store API.
#define CHECK(...)
Evaluate an expression and check for errors.
bool transientContains(const CLID id, const std::string &key) const
Look up a transient data object in TDS only by CLID.
Abstract interface for IOVSvc. This is used (usually via StoreGateSvc regFcn and regHandle methods) t...
const std::string * keyToString(sgkey_t key) const
Find the string corresponding to a given key.
AthROOTErrorHandlerSvc * svc
StatusCode remove(const void *pObject)
Remove pObject, will remove its proxy if not reset only.
void remap_impl(sgkey_t source, sgkey_t target, off_t index_offset)
Declare a remapping.
void erase()
Erase all contained allocators.
SG::DataProxy * record_impl(DataObject *obj, const std::string &key, const void *const raw_ptr, bool allowMods, bool resetOnly, bool allowOverwrite, const std::type_info *tinfo)
real recording of an object with a key, allow possibility of specifying const-access
virtual bool tryELRemap(sgkey_t sgkey_in, size_t index_in, sgkey_t &sgkey_out, size_t &index_out) override final
Test to see if the target of an ElementLink has moved.
bool hasStore() const
Return true if this object has an associated store.
virtual StatusCode preLoadProxies(IProxyRegistry &dataStore)=0
add proxies to the store before Begin Event:
uint32_t CLID
The Class ID type.
void fcn(int &, double *, double &result, double par[], int)
this is where we write out chi2
CLID clID() const
Retrieve clid.
virtual ~SGImplSvc() override final
Standard Destructor.
void msg_update_handler(Gaudi::Details::PropertyBase &outputLevel)
callback for output level property
virtual StatusCode finalize() override final
Service finalization.
DATA * DataProxy_cast(DataProxy *proxy)
cast the proxy into the concrete data object it proxies
virtual SG::DataProxy * retrieveProxy(const CLID &id, const std::string &key, IProxyRegistry &dataStore)=0
Use a provider to create a proxy for ID/KEY.
StatusCode recordAddress(const std::string &skey, IOpaqueAddress *pAddress, bool clearAddressFlag=true)
Create a proxy object using an IOpaqueAddress and a transient key.
StatusCode retrieve(CLID clid, SG::detail::IteratorBase &cibegin, SG::detail::IteratorBase &ciend) const
Retrieve all objects of type T: returns an SG::ConstIterator range.
virtual StoreID::type storeID() const
std::string dump() const
dump objects in store.
virtual void registerKey(sgkey_t key, const std::string &str, CLID clidid) override final
Remember an additional mapping from key to string/CLID.
void setStoreID(StoreID::type id)
set store ID. request forwarded to DataStore:
int typeCount(const CLID &id) const
Return the number of instances of type T (input CLID)
StatusCode record_HistObj(const CLID &id, const std::string &key, const std::string &store, bool allowMods, bool resetOnly=true)
std::string to_string(const DetectorType &type)
static const BaseInfoBase * find(CLID clid)
Find the BaseInfoBase instance for clid.
StatusCode removeDataAndProxy(const void *pObject)
Remove pObject and its proxy no matter what.
void recycle(DataObject *pBadDObj)
put a bad (unrecordable) dobj away
bool m_DumpArena
DumpArena Property flag : trigger m_arena->report() at clearStore.
Helpers for checking error return status codes and reporting errors.
void keys(const CLID &id, std::vector< std::string > &vkeys, bool includeAlias, bool onlyValid)
CLID clid(const std::string &key) const
Retrieve the main CLID of the object recorded in StoreGate with the given "key" WARNING: slow!
StatusCode typeless_record(DataObject *obj, const std::string &key, const void *const raw_ptr, bool allowMods, bool resetOnly=true, bool noHist=false)
type-less recording of an object with a key, allow possibility of specifying const-access and history...
const std::string & rawVersionKey() const
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
the interface through which HiveWB control StoreGate instances
Incident sent after a store is cleared.
virtual const name_type & name() const override final
Retrieve data object key == string.
DataProxy * locatePersistent(const void *const pTransient) const
locate the persistent (proxy) for a given T* (void*):
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvInterface) override final
static const InterfaceID & interfaceID()
Should rather be in ISGImplSvc.h if we had one.
int m_numSlots
The total number of slots. 1 if this isn't a Hive store.
StatusCode symLink(const void *p2BRegistered, CLID linkID)
make a soft link to the object T* already registered
virtual StatusCode addToStore(CLID id, SG::DataProxy *proxy) override final
Raw addition of a proxy to the store.
StatusCode addAlias(const std::string &aliasKey, SG::DataProxy *dp)
#define REPORT_MESSAGE(LVL)
Report a message.
virtual void handle(const Incident &) override final
triggered by Incident service
Interface for non-const operations on an auxiliary store.
const std::string & key() const
a static registry of CLID->typeName entries. NOT for general use. Use ClassIDSvc instead.
bool hasStore() const
Return true if this object has an associated store.
int ir
counter of the current depth
bool isValidObject() const
is the object valid?
SG::DataProxy * transientProxy(const CLID &id, const std::string &key) const
get proxy with given id and key.
void reset(bool hard=false)
Other methods of DataProxy (not in Interface IRegistry):
IConversionSvc * m_pDataLoader
void makeCurrent()
The current store is becoming the active store.
bool transientID(CLID id) const
return the list of transient IDs (primary or symLinked):
std::list< DataObject * > m_trash
The Recycle Bin.
Hold DataProxy instances associated with a store.
const std::vector< DataProxy * > & proxies() const
All proxies managed by this store.
StatusCode addAlias(const std::string &aliasKey, DataProxy *proxy)
add alias to store
static StoreID::type findStoreID(const std::string &storeName)
std::unordered_map< sgkey_t, T > SGKeyMap
A map using sgkey_t as a key.
The non-template portion of the BaseInfo implementation.
void t2pRemove(const void *const pTrans)
virtual StatusCode stop() override final
Service stop.
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Interface for non-const operations on an auxiliary store.
IProxyProviderSvc * m_pPPS
virtual void relinquish()=0
Give up ownership of the DataBucket contents.
StatusCode pRange(const CLID &id, SG::ConstProxyIterator &f, SG::ConstProxyIterator &e) const
Return an iterator over proxy for a given CLID:
std::lock_guard< mutex_t > lock_t
StatusCode removeProxy(DataProxy *proxy, bool forceRemove, bool hard)
remove proxy from store, unless proxy is reset only.
bool merge(const StringPool &other)
Merge another pool into this one.
void setSlotNumber(int slot, int numSlots)
Set the Hive slot number for this store.
#define ATLAS_THREAD_SAFE
Smart pointer to manage DataObject reference counts.
std::string createKey(const CLID &dataID)
creates a key internally if none specified by client
virtual SG::DataProxy * proxy_exact(SG::sgkey_t sgkey) const override final
Get proxy given a hashed key+clid.
sgkey_t stringToKey(const std::string &str, sgaux_t aux=0)
Find the key for a string.
Interface for const operations on an auxiliary store.
Interface for const operations on an auxiliary store.
Define macros for attributes used to control the static checker.
void t2pRemove(const void *const pTrans)
forwarded to DataStore
ServiceHandle< IProxyProviderSvc > m_pPPSHandle
StatusCode regFcn(const CallBackID &c1, const CallBackID &c2, const IOVSvcCallBackFcn &fcn, bool trigger=false)
register a callback function(2) with an already registered function(1)
virtual StatusCode regFcn(SG::DataProxy *dp, const CallBackID &c, const IOVSvcCallBackFcn &fcn, bool trigger=false)=0
register callback function
virtual StatusCode start() override final
Service start.
virtual SG::DataProxy * proxy(const void *const pTransient) const override final
get proxy for a given data object address in memory
bool isSymLinked(const CLID &linkID, SG::DataProxy *dp)
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
StatusCode tRange(ConstStoreIterator &f, ConstStoreIterator &e) const
Return an iterator over the StoreMap:
StatusCode t2pRegister(const void *const pTrans, SG::DataProxy *const pPers)
forwarded to DataStore
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.
SGKeyMap< remap_t > remap_map_t
const std::string & name() const
Return this Arena's name.
DataObject * typeless_retrievePrivateCopy(const CLID clid, const std::string &key)
ProxyMap::const_iterator ConstProxyIterator
bool registerKey(sgkey_t key, const std::string &str, sgaux_t aux=0)
Remember an additional mapping from key to string.
void addAutoSymLinks(const std::string &key, CLID clid, SG::DataProxy *dp, const std::type_info *tinfo, bool warn_nobib=true)
Add automatically-made symlinks for DP.
SG::RemapImpl * m_remap_impl
bool transientSwap(const CLID &id, const std::string &keyA, const std::string &keyB)
swap the content of 2 keys payload A indexed by keyA will now be accessed via keyB and vice versa Not...
void keys(const CLID &id, std::vector< std::string > &vkeys, bool includeAlias=false, bool onlyValid=true)
provide list of all StoreGate keys associated with an object.
StatusCode loadEventProxies()
load proxies at begin event