15#include <unordered_map>
30#include "GaudiKernel/IClassIDSvc.h"
31#include "GaudiKernel/IHistorySvc.h"
32#include "GaudiKernel/ISvcLocator.h"
33#include "GaudiKernel/IConversionSvc.h"
34#include "GaudiKernel/Incident.h"
35#include "GaudiKernel/IOpaqueAddress.h"
36#include "GaudiKernel/MsgStream.h"
37#include "GaudiKernel/StatusCode.h"
38#include "GaudiKernel/DataHistory.h"
71template <
class...
Args>
void print(std::FILE* stream, std::format_string<Args...>
fmt,
Args&&... args) {
72 std::fputs(std::format(
fmt, std::forward<Args>(args)...), stream);
75template <
class T>
void*
ptr(T* p) {
return static_cast<void*
>(p); }
104 : base_class(name, svc),
128 declareProperty(
"IncidentSvc",
m_pIncSvc);
152 CHECK( Service::initialize() );
166 SG::CurrentEventStore::setStore (
this);
170 if (!(
m_pIncSvc.retrieve()).isSuccess()) {
172 return StatusCode::FAILURE;
189 return StatusCode::FAILURE;
197 return StatusCode::SUCCESS;
211 return StatusCode::SUCCESS;
221 ISvcManager* pISM(
dynamic_cast<ISvcManager*
>(serviceLocator().
get()));
223 return StatusCode::FAILURE;
224 pISM->setPriority(name(), pISM->getPriority(name())+1).ignore();
225 SG_MSG_VERBOSE (
"stop: setting service priority to {} so that event stores get finalized and cleared before other stores",
226 pISM->getPriority(name()));
228 return StatusCode::SUCCESS;
234 if (inc.type() ==
"EndEvent") {
244 StatusCode
sc(StatusCode::SUCCESS);
250 dbg::print(stderr,
"SGImplSvc::loadEventProxies() LOADED PROXIES on {}\n", name());
253 dbg::print(stderr,
"SGImplSvc::loadEventProxies() PROXIES ALREADY LOADED on {}\n", name());
263 return std::to_string(
m_pStore->typeCount(
id) + 1);
270 dbg::print(stderr,
"SGImplSvc::clearStore(forceRemove={}) on {}\n", forceRemove, name());
274 std::ostringstream s;
285 SG_MSG_DEBUG (
"Clearing store with forceRemove={}", forceRemove);
287 m_pStore->clearStore(forceRemove, hard_reset, &msgStream(MSG::DEBUG));
296 return StatusCode::SUCCESS;
307 const bool FORCEREMOVE(
true);
317 return Service::finalize();
323 const bool FORCEREMOVE(
true);
326 return StatusCode::SUCCESS;
335 bool clearAddressFlag,
336 const std::vector<CLID>& bases)
339 assert(0 != pAddress);
340 CLID dataID = pAddress->clID();
344 SG_MSG_WARNING (
"recordAddress: Invalid Class ID found in IOpaqueAddress @{}. IOA will not be recorded",
345 static_cast<void*
>(pAddress.
get()));
346 return StatusCode::FAILURE;
355 if (dp && dp->provider()) {
356 std::string clidTypeName;
357 m_pCLIDSvc->getTypeNameOfID(dataID, clidTypeName).ignore();
358 SG_MSG_WARNING (
"recordAddress: failed for key={}, type (CLID {})\n"
359 " there is already a persistent version of this object. Will not record a duplicate! ",
360 skey, clidTypeName, dataID);
361 return StatusCode::FAILURE;
367 if (0 == dp && 0 !=
m_pPPS) {
379 m_pStore->addToStore(dataID, dp).ignore();
384 for (
CLID b : bases) {
386 warning() << std::format (
"Can't add extra base {} for object {}/{}",
387 b, dataID, skey) <<
endmsg;
391 else if ((0 != dp) && (0 == dp->address()))
395 dp->setAddress(std::move(pAddress));
400 m_pCLIDSvc->getTypeNameOfID(dataID, errType).ignore();
401 SG_MSG_WARNING (
"recordAddress: preexisting proxy @{} with non-NULL IOA found for key type {} ({}). \n"
402 "Cannot record IOpaqueAddress @{}",
403 static_cast<void*
>(dp), skey, errType, dataID,
404 static_cast<void*
>(pAddress.
get()));
405 return StatusCode::FAILURE;
408 return StatusCode::SUCCESS;
417 bool clearAddressFlag,
418 const std::vector<CLID>& bases)
421 assert(0 != pAddress);
423 CLID dataID = pAddress->clID();
425 string gK = (pAddress->par())[1];
426 if (gK.empty()) gK = (pAddress->par())[0];
429 return this->
recordAddress(gK, std::move(pAddress), clearAddressFlag, bases);
441 if (0 != dp->object())
444 SG_MSG_WARNING (
" setupProxy:: error setting up proxy for key {} and clid {}\n"
445 " Pre-existing valid DataProxy @{} found in Store for key {} with clid {}",
447 static_cast<void*
>(dp),
448 dp->object()->name(),
449 dp->object()->clID());
454 dp->setObject(pDObj);
455 if (!allowMods) dp->setConst();
461 !allowMods, resetOnly);
462 if (!(
m_pStore->addToStore(dataID, dp).isSuccess())) {
464 static_cast<void*
>(dp));
489 bool includeAlias,
bool onlyValid)
493 return store()->
keys(
id, vkeys, includeAlias, onlyValid);
499 return (0 != dp) ? dp->transientID(linkID) :
false;
507 auto out_buffer = std::string{};
508 auto out = std::back_inserter(out_buffer);
509 const std::string me = name();
510 std::format_to(out,
"{}: <<<<<<<<<<<<<<<<< Data Store Dump >>>>>>>>>>>>>>> \n", me);
511 std::format_to(out,
"{}: SGImplSvc()::dump() which is {} \n", me,
m_storeLoaded ?
"LOADED" :
"NOT LOADED");
516 for (; s_iter != s_end; ++s_iter)
519 CLID id = s_iter->first;
522 m_pCLIDSvc->getTypeNameOfID(
id, tname).ignore();
523 std::format_to(out,
"{}: Found {} {} for ClassID {} ({}): \n", me, nProxy, ((nProxy == 1) ?
"proxy" :
"proxies"),
id, tname);
529 while (p_iter != p_end) {
531 std::format_to(out,
"{}: flags: ({:7s}, {:8s}, {:6s}) --- data: {:10p} --- key: {}\n", me,
532 (dp.isValid() ?
"valid" :
"INVALID"),
533 (dp.isConst() ?
"locked" :
"UNLOCKED"),
534 (dp.isResetOnly() ?
"reset" :
"DELETE"),
535 dbg::ptr(dp.object()), p_iter->first);
539 std::format_to(out,
"{}: <<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>> \n", me);
565 StatusCode::SUCCESS :
574 SG_MSG_WARNING (
"addSymLink: no target DataProxy found. Sorry, can't link to a non-existing data object");
575 return StatusCode::FAILURE;
577 StatusCode
sc =
m_pStore->addSymLink(linkid, dp);
581 if (
sc.isSuccess() && dp->object()) {
598 "DataObject does not exist, record before setting alias.",
600 return StatusCode::FAILURE;
604 if (
sc.isFailure()) {
606 "DataObject does not exist, record before setting alias.",
608 return StatusCode::FAILURE;
611 return StatusCode::SUCCESS;
619 SG_MSG_WARNING (
"addAlias: no target DataProxy given, Cannot alias to a non-existing object");
620 return StatusCode::FAILURE;
631 return (0 !=
proxy(
id, key,
true));
632 }
catch(...) {
return false; }
641 }
catch(...) {
return false; }
651 return m_pStore->locatePersistent(pTransient);
657 return proxy(
id,
false);
667 if (0 == dp && 0 !=
m_pPPS) {
669 dp =
m_pPPS->retrieveProxy(
id,
string(
"DEFAULT"), *pStore);
675 if (checkValid && 0 != dp) {
679 return dp->isValid() ? dp : 0;
687 return proxy(
id, key,
false);
698 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");
700 if (0 == dp && 0 !=
m_pPPS) {
702 dp =
m_pPPS->retrieveProxy(
id, key, *pStore);
704 if (!dp)
dbg::print(stderr,
"::SGImplSvc::proxy(name={}, key={}): data proxy is still null\n", this->name(), key);
710 if (checkValid && 0 != dp && !(dp->isValid())) {
750 const std::string& key,
755 const void* raw_ptr = obj.get();
756 const std::type_info* tinfo =
nullptr;
759 raw_ptr = bucket->object();
760 tinfo = &bucket->tinfo();
763 if (returnExisting) {
770 if (
proxy->transientID (obj->clID())) {
774 std::string clidTypeName;
776 SG_MSG_WARNING (
"SGImplSvc::recordObject: addAlias fails for object {} [{}] {} and new key {}",
782 else if (key ==
proxy->name() ||
proxy->hasAlias(key) > 0)
787 std::string clidTypeName;
789 CLID newclid = obj->clID();
790 std::string newclidTypeName;
791 m_pCLIDSvc->getTypeNameOfID(newclid, newclidTypeName).ignore();
793 " addSymLink fails for object {} [{}] {} and new clid {} [{}]",
795 newclid, newclidTypeName);
802 std::string clidTypeName;
804 CLID newclid = obj->clID();
805 std::string newclidTypeName;
806 m_pCLIDSvc->getTypeNameOfID(newclid, newclidTypeName).ignore();
808 " existing object found with {} [{}] {} but neither"
809 " clid {} [{}] nor key {} match.",
811 newclid, newclidTypeName, key);
819 const bool resetOnly =
true;
820 const bool noHist =
false;
823 allowMods, resetOnly, noHist, tinfo,
824 &
proxy,
true).isFailure())
857std::vector<const SG::DataProxy*>
862 std::vector<const SG::DataProxy*> ret (
proxies.begin(),
proxies.end());
876 std::vector<CLID>
clids;
877 clids.reserve( distance( s_iter, s_end ) );
879 for (; s_iter != s_end; ++s_iter ) {
880 const CLID id = s_iter->first;
881 clids.push_back (
id);
893 return ( (0 != dp && dp->isValidObject()) ? dp : 0 );
901 return (0 == theProxy) ? 0 : theProxy->
accessData();
909 return (0 == theProxy) ? 0 : theProxy->
accessData();
914 const void*
const raw_ptr,
915 bool allowMods,
bool resetOnly,
bool noHist)
917 return typeless_record (obj, key, raw_ptr, allowMods, resetOnly, noHist, 0,
924 const void*
const raw_ptr,
925 bool allowMods,
bool resetOnly,
bool noHist,
926 const std::type_info* tinfo)
928 return typeless_record (obj, key, raw_ptr, allowMods, resetOnly, noHist,tinfo,
935 const void*
const raw_ptr,
936 bool allowMods,
bool resetOnly,
bool noHist,
937 const std::type_info* tinfo,
943 record_impl( obj, key, raw_ptr, allowMods, resetOnly, !noOverwrite, tinfo);
944 if (
proxy ==
nullptr )
945 return StatusCode::FAILURE;
950 return StatusCode::SUCCESS;
954 return StatusCode::SUCCESS;
956 return record_HistObj( obj->clID(), key, name(), allowMods, resetOnly );
963 const std::string& key,
964 const void*
const raw_ptr,
967 const std::type_info* tinfo)
970 StatusCode
sc(StatusCode::SUCCESS);
974 const bool FORCEREMOVE(
true);
977 if (
sc.isSuccess()) {
978 const bool ALLOWOVERWRITE(
true);
979 const bool NORESET(
false);
980 if (
record_impl( obj, key, raw_ptr, allowMods, NORESET, ALLOWOVERWRITE, tinfo) ==
nullptr)
981 sc = StatusCode::FAILURE;
997 const void*
const raw_ptr,
998 bool allowMods,
bool resetOnly,
bool allowOverwrite,
999 const std::type_info* tinfo)
1002 std::string rawKey(key);
1003 if (!allowOverwrite &&
m_pPPS) {
1009 if (dp && dp->provider()) {
1010 std::string clidTypeName;
1012 SG_MSG_WARNING (
"record_impl: you are recording an object with key {}, type {} (CLID {})\n"
1013 " There is already a persistent version of this object."
1014 " Recording a duplicate may lead to unreproducible results and it is deprecated.",
1015 rawKey, clidTypeName,
clid);
1022 std::string clidTypeName;
1024 SG_MSG_WARNING (
"record_impl: failed for key={}, type {} (CLID {})\n"
1025 " object @{} already in store with key={}. Will not record a duplicate!",
1026 rawKey, clidTypeName,
clid, raw_ptr, dp->name());
1027 if (pDObj != dp->object()) {
1029 if (!pDBB) std::abort();
1040 std::string clidTypeName;
1042 SG_MSG_WARNING (
"record_impl: Problem setting up the proxy for object @{}\n"
1043 " recorded with key {} of type {} (CLID {}) in DataObject @{}",
1044 raw_ptr, rawKey, clidTypeName,
clid,
1045 static_cast<void*
>(pDObj));
1051 if ( !(this->
t2pRegister( raw_ptr, dp )).isSuccess() ) {
1052 std::string clidTypeName;
1054 SG_MSG_WARNING (
"record_impl: can not add to t2p map object @{}\n"
1055 " with key {} of type {} (CLID {})",
1056 raw_ptr, rawKey, clidTypeName,
clid);
1067 bool checkValid)
const
1071 if (checkValid && 0 != dp) {
1072 return dp->isValid() ? dp : 0;
1084 if (0 ==
proxy)
return StatusCode::FAILURE;
1088 if (bucket) pTrans = bucket->
object();
1096 if (
proxy->isValidObject()) {
1099 for (SG::DataProxy::CLIDCont_t::const_iterator i =
clids.begin();
1115 return m_pStore->t2pRegister(pTrans, pPers);
1129 updateMsgStreamOutputLevel( outputLevel() );
1130 msgSvc()->setOutputLevel(name(), outputLevel());
1141 SG_MSG_WARNING (
"setConst: NO Proxy for the dobj you want to set const");
1142 return StatusCode::FAILURE;
1146 return StatusCode::SUCCESS;
1164 const bool FORCEREMOVE(
true);
1189 const std::string&
store,
1190 bool allowMods,
bool resetOnly) {
1196 StatusCode
sc =
m_pCLIDSvc->getTypeNameOfID(
id, idname);
1197 if (
sc.isFailure() || idname.empty() ) {
1198 idname = std::to_string(
id);
1205 const bool ALLOWOVERWRITE(
false);
1206 if (
record_impl(obj, idname, dho, allowMods, resetOnly, ALLOWOVERWRITE,
1207 &
typeid(DataHistory)) ==
nullptr)
1208 return StatusCode::FAILURE;
1209 return StatusCode::SUCCESS;
1272 const std::string&
str,
1278 const std::string* str2 =
m_stringpool.keyToString (key, clid2);
1279 SG_MSG_WARNING (
"The numeric key {} maps to multiple string key/CLID pairs: {}/{} and {}/{}",
1280 key, *str2, clid2,
str,
clid);
1301 tmp = other.m_stringpool;
1312 if (0 != (pP =
proxy(
id, key))) {
1315 SG::DataProxy::CLIDCont_t::const_iterator i(
clids.begin()), e(
clids.end());
1321 pP->
reset (hard_reset);
1334 if (dp->isValidObject()) {
1336 SG::DataProxy::CLIDCont_t::const_iterator i(
clids.begin()), e(
clids.end());
1343 dp->reset (hard_reset);
1360 payload.target = target;
1361 payload.index_offset = index_offset;
1375 sgkey_t& sgkey_out,
size_t& index_out)
1378 SG::RemapImpl::remap_map_t::iterator i =
1383 sgkey_out = payload.target;
1384 index_out = index_in + payload.index_offset;
1395 for ( ; s_iter != s_end; ++s_iter ) {
1396 if ( s_iter->second.find( key ) != s_iter->second.end() ) {
1397 return s_iter->first;
1409 const std::type_info* tinfo,
1426 const std::vector<CLID>& bases = bib->
get_bases();
1427 for ( std::size_t i = 0, iMax = bases.size(); i < iMax; ++i ) {
1428 if ( bases[i] !=
clid ) {
1429 if (
addSymLink( bases[i], dp ).isSuccess() ) {
1436 " with CLID {} and SG key {}:"
1437 " Proxy already set for base CLID {}; not making auto-symlink.",
1438 clid, key, bases[i]);
1446 if (
m_pStore->addSymLink (copy_clid, dp).isFailure()) {
1448 " with CLID {} and SG key {}:"
1449 " Proxy already set for copy-conversion CLID {}; not making auto-symlink.",
1450 clid, key, copy_clid);
1457 SG_MSG_WARNING (
"record_impl: Could not find suitable SG::BaseInfoBase for CLID [{}] ({}) !\t"
1458 "No auto-symlink established !",
1470 std::vector<IResetable*> handles;
1473 h->reset (hard_reset);
1498 std::vector<IResetable*>::iterator it =
1499 std::find (v.begin(), v.end(),
handle);
1511 SG::CurrentEventStore::setStore (
this);
1527 IOpaqueAddress* addr,
1528 DataObject*& refpObject)
1535 return cvt->createObj (addr, refpObject);
1542 std::println (
"{}", sg->
dump());
1546 std::ofstream f (fname);
1547 std::println (f,
"{}", sg->
dump());
1565 return dh->
begin()->getToken()->dbID().toString();
1587 SG_MSG_DEBUG(
"retrieve(range): no object found of type {} (CLID {})",
1591 (ciend.
setState(end, end,
true)).ignore();
1593 if (!(cibegin.
setState(first, end,
true)).isSuccess()) {
1596 SG_MSG_DEBUG(
"retrieve(range): Can't initialize iterator for object range "
1597 " of type {} (CLID {})",
1599 return StatusCode::FAILURE;
1602 return StatusCode::SUCCESS;
1607 const std::string& key,
1614 if (ptr->hasStore())
return true;
1619 if (!ptr->hasStore()) {
1622 if (!dp->isConst()) {
1625 ptr->setStore (pAux);
1632 ptr->setStore (pAux);
1642 const std::string& key,
1648 if (!ptr->hasStore()) {
1651 if (!dp->isConst()) {
1654 ptr->setStore (pAux);
1661 ptr->setStore (pAux);
Manage index tracking and synchronization of auxiliary data.
a static registry of CLID->typeName entries.
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
Hold a pointer to the current event store.
uint32_t CLID
The Class ID type.
Interface for non-const operations on an auxiliary store.
Interface for const operations on an auxiliary store.
virtual void lock()=0
Interface to allow an object to lock itself when made const in SG.
void SG_dump(SGImplSvc *sg)
These are intended to be easy to call from the debugger.
#define SG_MSG_WARNING(x,...)
#define SG_MSG_DEBUG(x,...)
#define SG_MSG_VERBOSE(x,...)
#define SG_MSG_INFO(x,...)
#define SG_MSG_ERROR(x,...)
Incident sent after a store is cleared.
Maintain a mapping of strings to 64-bit ints.
Define macros for attributes used to control the static checker.
#define ATLAS_THREAD_SAFE
Header file for AthHistogramAlgorithm.
static const std::type_info * CLIDToTypeinfo(CLID clid)
Translate between CLID and type_info.
Simple smart pointer for Gaudi-style refcounted objects.
T * get()
Get the pointer.
A non-templated base class for DataBucket, allows to access the transient object address as a void*.
virtual void * object()=0
virtual void relinquish()=0
Give up ownership of the DataBucket contents.
SG::sgkey_t sgkey_t
Type of the keys.
The Athena Transient Store API.
virtual SG::DataProxy * proxy(const void *const pTransient) const override final
get proxy for a given data object address in memory
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.
void addAutoSymLinks(const std::string &key, CLID clid, SG::DataProxy *dp, const std::type_info *tinfo, bool warn_nobib=true)
Add automatically-made symlinks for DP.
void setStoreID(StoreID::type id)
set store ID. request forwarded to DataStore:
StatusCode t2pRegister(const void *const pTrans, SG::DataProxy *const pPers)
forwarded to DataStore
virtual ~SGImplSvc() override final
Standard Destructor.
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...
virtual void boundHandle(IResetable *handle) override final
Tell the store that a proxy has been bound to a handle.
virtual sgkey_t stringToKey(const std::string &str, CLID clid) override final
Find the key for a string/CLID pair.
virtual StoreID::type storeID() const override
get store ID. request forwarded to DataStore:
StatusCode remove(const void *pObject)
Remove pObject, will remove its proxy if not reset only.
virtual void handle(const Incident &) override final
triggered by Incident service
SG::DataProxy * locatePersistent(const SG::TransientAddress *tAddr, bool checkValid=false) const
virtual std::vector< const SG::DataProxy * > proxies() const override final
return the list of all current proxies in store
virtual SG::DataProxy * recordObject(SG::DataObjectSharedPtr< DataObject > obj, const std::string &key, bool allowMods, bool returnExisting) override final
Record an object in the store.
StatusCode loadEventProxies()
load proxies at begin event
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.
SG::RemapImpl * m_remap_impl
int m_slotNumber
The Hive slot number for this store, or -1 if this isn't a Hive store.
ServiceHandle< IProxyProviderSvc > m_pPPSHandle
virtual StatusCode finalize() override final
Service finalization.
std::map< std::thread::id, std::vector< IResetable * > > m_newBoundHandles
Keep track of proxies bound since the last call to commitNewDataObjects or clearStore.
virtual SG::SourceID sourceID(const std::string &key="EventSelector") const override
Return the metadata source ID for the current event slot.
StatusCode setConst(const void *pointer)
prevent downstream clients from modifying the pointed-at dobj
virtual StatusCode createObj(IConverter *cvt, IOpaqueAddress *addr, DataObject *&refpObject) override
Call converter to create an object, with locking.
bool m_DumpStore
Dump Property flag: triggers dump() at EndEvent.
bool m_ActivateHistory
Activate the history service.
CLID clid(const std::string &key) const
Retrieve the main CLID of the object recorded in StoreGate with the given "key" WARNING: slow!
void msg_update_handler(Gaudi::Details::PropertyBase &outputLevel)
callback for output level property
SG::StringPool m_stringpool
virtual StatusCode start() override final
Service start.
std::string createKey(const CLID &dataID)
creates a key internally if none specified by client
StatusCode setAlias(const void *p2BAliased, const std::string &aliasKey)
make an alias to a DataObject (provide only valid pointer)
bool m_DumpArena
DumpArena Property flag : trigger m_arena->report() at clearStore.
StatusCode removeProxy(SG::DataProxy *proxy, const void *pTrans, bool forceRemove=false)
remove proxy from store, unless it is reset only.
void remap_impl(sgkey_t source, sgkey_t target, off_t index_offset)
Declare a remapping.
virtual void registerKey(sgkey_t key, const std::string &str, CLID clidid) override final
Remember an additional mapping from key to string/CLID.
StatusCode addSymLink(const CLID &linkid, SG::DataProxy *dp)
SG::Arena m_arena
Allocation arena to associate with this store.
virtual StatusCode clearStore(bool forceRemove=false) override final
clear DataStore contents: called by the event loop mgrs
bool isSymLinked(const CLID &linkID, SG::DataProxy *dp)
std::lock_guard< mutex_t > lock_t
IProxyProviderSvc * m_pPPS
StatusCode recordAddress(const std::string &skey, CxxUtils::RefCountedPtr< IOpaqueAddress > pAddress, bool clearAddressFlag=true, const std::vector< CLID > &bases={})
Create a proxy object using an IOpaqueAddress and a transient key.
virtual void commitNewDataObjects() override final
Reset handles added since the last call to commit.
virtual StatusCode stop() override final
Service stop.
void t2pRemove(const void *const pTrans)
forwarded to DataStore
virtual StatusCode addToStore(CLID id, SG::DataProxy *proxy) override final
Raw addition of a proxy to the store.
StatusCode record_HistObj(const CLID &id, const std::string &key, const std::string &store, bool allowMods, bool resetOnly=true)
virtual const std::string * keyToString(sgkey_t key) const override final
Find the string corresponding to a given key.
void clearProxyPayload(SG::DataProxy *)
use to reset a proxy (clearing the data object it contains) Unlike DataProxy::reset this method corre...
StatusCode removeDataAndProxy(const void *pObject)
Remove pObject and its proxy no matter what.
mutex_t m_stringPoolMutex
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
std::vector< CLID > clids() const
Return all CLIDs in the store.
std::list< DataObject * > m_trash
The Recycle Bin.
ServiceHandle< IHistorySvc > m_pHistorySvc
StatusCode symLink(const CLID id, const std::string &key, const CLID linkid)
make a soft link to the object pointed by id/key
void releaseObject(const CLID &id, const std::string &key)
release object held by proxy, if any.
IStringPool::sgkey_t sgkey_t
ServiceHandle< IIOVSvc > m_pIOVSvc
get the IOVSvc "just in time" (breaks recursion at initialize)
void makeCurrent()
The current store is becoming the active store.
SGImplSvc(const SGImplSvc &)=delete
int m_numSlots
The total number of slots. 1 if this isn't a Hive store.
bool mergeStringPool(const SGImplSvc &other)
Merge the string pool from another store into this one.
DataObject * accessData(const CLID &id) const
find proxy and access its data. Returns 0 to flag failure
void recycle(DataObject *pBadDObj)
put a bad (unrecordable) dobj away
virtual StatusCode reinitialize() override final
Service reinitialization.
bool m_storeLoaded
FIXME hack needed by loadEventProxies.
virtual SG::DataProxy * proxy_exact(SG::sgkey_t sgkey) const override final
Get proxy given a hashed key+clid.
ServiceHandle< IClassIDSvc > m_pCLIDSvc
bool transientContains(const CLID id, const std::string &key) const
Look up a transient data object in TDS only by CLID.
ServiceHandle< IIncidentSvc > m_pIncSvc
property
std::string dump() const
dump objects in store.
StatusCode addAlias(const std::string &aliasKey, SG::DataProxy *dp)
bool contains(const CLID id, const std::string &key) const
Look up a keyed object in TDS by CLID.
void setSlotNumber(int slot, int numSlots)
Set the Hive slot number for this store.
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 void unboundHandle(IResetable *handle) override final
Tell the store that a handle has been unbound from a proxy.
SG::DataProxy * transientProxy(const CLID &id, const std::string &key) const
get proxy with given id and key.
bool associateAux_impl(SG::AuxVectorBase *ptr, const std::string &key, CLID auxclid) const
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
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
void emptyTrash()
throw away bad objects
ServiceHandle< IConversionSvc > m_pDataLoader
Manage index tracking and synchronization of auxiliary data.
The non-template portion of the BaseInfo implementation.
static const BaseInfoBase * find(CLID clid)
Find the BaseInfoBase instance for clid.
const std::vector< CLID > & get_bases() const
Return the class IDs of all known bases of T (that have class IDs).
std::vector< CLID > get_copy_conversions() const
Return known copy conversions.
bool transientID(CLID id) const
return the list of transient IDs (primary or symLinked):
void reset(bool hard=false)
Other methods of DataProxy (not in Interface IRegistry):
DataObject * accessData()
Access DataObject on-demand using conversion service.
TransientAddress::TransientClidSet CLIDCont_t
Hold DataProxy instances associated with a store.
int typeCount(const CLID &id) const
Count number of object of a given type in store.
virtual StoreID::type storeID() const override
void keys(const CLID &id, std::vector< std::string > &vkeys, bool includeAlias, bool onlyValid)
StoreMap::const_iterator ConstStoreIterator
void setStoreID(StoreID::type id)
const std::vector< DataProxy * > & proxies() const
All proxies managed by this store.
StatusCode tRange(ConstStoreIterator &f, ConstStoreIterator &e) const
Return an iterator over the StoreMap:
Interface for non-const operations on an auxiliary store.
Implementation class, not to be used directly Iterates over valid proxies in the range.
StatusCode setState(SG::ConstProxyIterator itr, SG::ConstProxyIterator itrEnd, bool isConst)
Reset state of the iterator.
static StoreID::type findStoreID(const std::string &storeName)
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
void setProxyDictInEventContext(IProxyDict *sg)
Update the IProxyDict in the current EventContext.
DATA * DataProxy_cast(DataProxy *proxy)
cast the proxy into the concrete data object it proxies
AuxElement(SG::AuxVectorData *container, size_t index)
Base class for elements of a container that can have aux data.
CxxUtils::RefCountedPtr< T > DataObjectSharedPtr
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
ProxyMap::const_iterator ConstProxyIterator
DataObject * asStorable(SG::DataObjectSharedPtr< T > pObject)
std::unordered_map< sgkey_t, T > SGKeyMap
A map using sgkey_t as a key.
void print(std::FILE *stream, std::format_string< Args... > fmt, Args &&... args)
Some out-of-line helpers for ExtendedEventContext.
static constexpr CLID ID()
SGKeyMap< remap_t > remap_map_t
IStringPool::sgkey_t sgkey_t