ATLAS Offline Software
Loading...
Searching...
No Matches
StoreGateSvc.h
Go to the documentation of this file.
1/* -*- C++ -*- */
2
3/*
4 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
5*/
6
7#ifndef STOREGATE_STOREGATESVC_H
8#define STOREGATE_STOREGATESVC_H
9
10//FIXME the CLASS_DEF header is not needed here but was added to work around
11//bad include statements in client code: when using CLASS_DEF put the
12//include below in your header file!
14
15#include "GaudiKernel/Service.h"
16#include "GaudiKernel/SmartIF.h"
18
24
25#include <GaudiKernel/ClassID.h> // for CLID
26#include <GaudiKernel/IMessageSvc.h> // for Level
27#include "Gaudi/Property.h"
28#include "GaudiKernel/ServiceHandle.h"
29#include "GaudiKernel/StatusCode.h"
30#include "GaudiKernel/DataObjID.h"
31#include "GaudiKernel/IAlgContextSvc.h"
32
33#include <cstddef> // for size_t
34#include <list>
35#include <memory>
36#include <mutex>
37#include <string>
38#include <sys/types.h> // for off_t
39#include <vector>
40#include <type_traits>
41
44#include "AthAllocators/Arena.h"
45
46#include <SGTools/StringPool.h>
47
48// includes used in StoreGateSvc.icc
49#include "GaudiKernel/IClassIDSvc.h"
53#include "StoreGate/SGWPtr.h"
55
56#include "GaudiKernel/IIncidentListener.h"
57
59
60//forward declarations
61namespace SG {
62 class DataProxy;
63 class TransientAddress;
64 struct RemapImpl;
65 class TestHiveStoreSvc;
66 class HiveMgrSvc;
67}
68namespace xAODMaker {
69 class AuxStoreWrapper;
70}
71
72class DataObject;
73class IConversionSvc;
74class IIncidentSvc;
76class IHistorySvc;
77
78// python forward
79struct _object; typedef _object PyObject;
80class StoreGateSvc;
81namespace AthenaInternal {
84}
85namespace SG {
86 class NoAuxStore;
87}
88
89//friends...
91class IOVDbSvc;
92class IOVSvcTool;
93class PileUpMergeSvc;
94namespace SG {
95 class VarHandleBase;
96}
97
113class StoreGateSvc : public extends<Service,
114 IProxyDict,
115 IHiveStore,
116 IHiveStoreMgr,
117 IIncidentListener>
118{
119
120public:
123
124
142
143 template <typename T, typename TKEY, typename... ARGS>
144 SG::WPtr<T> create(const TKEY& key, ARGS... constructorArgs);
146
149
150
152 template <typename T, typename TKEY>
153 StatusCode record(T* p2BRegistered, const TKEY& key);
154
156 template <typename T, typename TKEY>
157 StatusCode record(const T* p2BRegistered, const TKEY& key);
158
159
162 template <typename T, typename TKEY>
163 StatusCode record(T* p2BRegistered, const TKEY& key,
164 bool allowMods, bool resetOnly=true, bool noHist=false);
165
167 template <typename T, typename TKEY>
168 StatusCode record(std::unique_ptr<T> pUnique, const TKEY& key);
169
171 template <typename T, typename TKEY>
172 StatusCode record(std::unique_ptr<const T> pUnique, const TKEY& key);
173
176 template <typename T, typename TKEY>
177 StatusCode record(std::unique_ptr<T> pUnique, const TKEY& key,
178 bool allowMods, bool resetOnly=true, bool noHist=false);
179
181
184
185
187 template <typename T>
188 StatusCode retrieve(const T*& ptr) const;
189
191 template <typename T>
192 StatusCode retrieve(T*& ptr) const;
193
196 template <typename T>
197 T* retrieve () const;
198
201 template <typename T>
202 T* tryRetrieve () const;
203 template <typename T>
204 const T* tryConstRetrieve() const;
205
207 template <typename T, typename TKEY>
208 StatusCode retrieve(const T*& ptr, const TKEY& key) const requires KeyConcept<TKEY>;
209
212 template <typename T>
213 StatusCode retrieve(const T*& ptr, const std::string& key) const;
214
215
217 template <typename T, typename TKEY>
218 StatusCode retrieve(T*& ptr, const TKEY& key) const requires KeyConcept<TKEY>;
219
222 template <typename T>
223 StatusCode retrieve(T*& ptr, const std::string& key) const;
224
225
228 template <typename T, class TKEY>
229 T* retrieve (const TKEY& key) const;
230
233 template <typename T, class TKEY>
234 T* tryRetrieve (const TKEY& key) const requires KeyConcept<TKEY>;
235 template <typename T, class TKEY>
236 const T* tryConstRetrieve(const TKEY& key) const requires KeyConcept<TKEY>;
237
238
239
241 template <typename T>
242 StatusCode retrieve(SG::ConstIterator<T>& begin,
243 SG::ConstIterator<T>& end) const;
244
246 StatusCode retrieve(CLID id,
248 SG::TypelessIterator& end) const;
249
254 template <typename T, typename TKEY>
255 bool contains(const TKEY& key) const;
256
258
261
262
264 template <typename T, typename TKEY>
265 StatusCode overwrite(T* p2BRegistered, const TKEY& key);
266
268 template <typename T, typename TKEY>
269 StatusCode overwrite(T* p2BRegistered, const TKEY& key,
270 bool allowMods, bool noHist=false);
271
272
274 template <typename T, typename TKEY>
275 StatusCode overwrite(std::unique_ptr<T> pUnique, const TKEY& key,
276 bool allowMods, bool noHist=false);
277
279 template <typename T, typename TKEY>
280 StatusCode overwrite(std::unique_ptr<T> pUnique, const TKEY& key);
281
283 StatusCode recordAddress(const std::string& skey,
285 bool clearAddressFlag=true,
286 const std::vector<CLID>& bases = {});
289 bool clearAddressFlag=true,
290 const std::vector<CLID>& bases = {});
291
293 template <typename T, typename TLINK>
294 StatusCode symLink (const T* p2BRegistered, TLINK* p2BLinked );
295
297 template <typename T, typename TLINK>
298 StatusCode symLink (const T* p2BRegistered, const TLINK* p2BLinked );
299
301 template <KeyConcept TKEY>
302 StatusCode symLink (const CLID id, const TKEY& key, const CLID linkid);
303
305 template <typename T, typename TKEY, typename AKEY>
306 StatusCode setAlias(const T* p2BAliased, const TKEY& key, const AKEY& aliasKey) requires KeyConcept<TKEY> && KeyConcept<AKEY>;
307
309 template <typename T, typename AKEY>
310 StatusCode setAlias(const T* p2BAliased, const AKEY& aliasKey) requires KeyConcept<AKEY>;
311
313 StatusCode setAlias(SG::DataProxy* proxy, const std::string& aliasKey);
314
316 StatusCode setConst(const void* pointer);
317
319 template <typename T>
320 StatusCode remove(const T* pObject);
321
323 template <typename T>
324 StatusCode removeDataAndProxy(const T* pObject);
325
331 bool transientSwap( const CLID& id,
332 const std::string& keyA, const std::string& keyB );
333
335
338
339
351 template <typename T>
352 std::unique_ptr<T> retrieveUniquePrivateCopy (const std::string& key);
353
357 template<typename TKEY>
358 CLID clid( const TKEY& key ) const;
359
363 template<typename TKEY>
364 std::vector<CLID> clids( const TKEY& key ) const;
365
370 template <typename T>
371 int typeCount() const;
372
374 int typeCount(const CLID& id) const;
375
379 template <typename TKEY>
380 bool contains(const CLID& id, const TKEY& key) const;
381
382
387 template <typename T, typename TKEY>
388 bool transientContains(const TKEY& key) const;
389
392 template <typename TKEY>
393 bool transientContains(const CLID& id, const TKEY& key) const;
394
397 std::string dump() const;
398
400 void setStoreID(StoreID::type id);
402 virtual StoreID::type storeID() const override;
403
404
411 template <typename T>
412 void
413 keys(std::vector<std::string>& vkeys,
414 bool includeAlias = false, bool onlyValid = true) const;
415
423 void
424 keys(const CLID& id, std::vector<std::string>& vkeys,
425 bool includeAlias = false, bool onlyValid = true) const;
426
428
429
431 // FIXME pointer to unsafe impl exposed
432 virtual ::IProxyDict* hiveProxyDict() override final {
434 }
435
438
439
442
443
445 virtual StatusCode clearStore(bool forceRemove=false) override final;
446
449 virtual void commitNewDataObjects() override final;
451
453 static void setSlot(SG::HiveEventSlot* pSlot);
454
455
457 void setDefaultStore(SGImplSvc* pStore);
458
459
461
463 virtual SG::DataProxy* proxy(const void* const pTransient) const override final;
464
466 virtual SG::DataProxy* proxy(const CLID& id) const final;
467
469 virtual SG::DataProxy* proxy(const CLID& id, const std::string& key) const override final;
472 SG::DataProxy* proxy(const CLID& id, const char* key) const;
473
475 virtual StatusCode addToStore (CLID id, SG::DataProxy* proxy) override final;
476
497 virtual
498 SG::DataProxy* recordObject (SG::DataObjectSharedPtr<DataObject> obj,
499 const std::string& key,
500 bool allowMods,
501 bool returnExisting) override final;
502
503
507 virtual SG::DataProxy* proxy_exact (SG::sgkey_t sgkey) const override final;
508
509
511
513
514
516 virtual SG::DataProxy* proxy(const CLID& id, bool checkValid) const final;
519 virtual SG::DataProxy* proxy(const CLID& id, const std::string& key, bool checkValid) const final;
523 virtual SG::DataProxy* proxy(const CLID& id, const char* key, bool checkValid) const final
524 { return this->proxy(id, std::string(key), checkValid); }
525
527 virtual std::vector<const SG::DataProxy*> proxies() const override final;
528
531
534 SG::DataProxy* transientProxy(const CLID& id, const std::string& key) const;
535
537 DataObject* accessData(const CLID& id) const;
539 DataObject* accessData(const CLID& id, const std::string& key) const;
540
546
547
555 virtual SG::SourceID sourceID (const std::string& key = "EventSelector") const override;
556
557
560
561
563
572 virtual
573 sgkey_t stringToKey (const std::string& str, CLID clid) override final;
574
582 virtual
583 const std::string* keyToString (sgkey_t key) const override final;
584
593 virtual
594 const std::string* keyToString (sgkey_t key, CLID& clid) const override final;
595
608 virtual
609 void registerKey (sgkey_t key,
610 const std::string& str,
611 CLID clidid) override final;
612
614
617
618
619
642 template <class TKEY>
644 const TKEY& source,
645 const TKEY& target,
646 off_t index_offset);
647
648
656 void remap_impl (sgkey_t source,
657 sgkey_t target,
658 off_t index_offset);
659
660
669 virtual bool tryELRemap (sgkey_t sgkey_in, size_t index_in,
670 sgkey_t& sgkey_out, size_t& index_out) override final;
671
673
676
677 StoreGateSvc(const std::string& name, ISvcLocator* svc);
678 virtual ~StoreGateSvc() override;
680
683
684 virtual StatusCode initialize() override;
685 virtual StatusCode stop() override;
686 virtual StatusCode finalize() override;
688
691
692 virtual void handle(const Incident&) override final;
694 StatusCode loadEventProxies();
696
697
708 virtual
709 StatusCode createObj (IConverter* cvt,
710 IOpaqueAddress* addr,
711 DataObject*& refpObject) override;
712
716 void makeCurrent();
717
718
719private:
721
722 ServiceHandle<IProxyProviderSvc> m_pPPSHandle{this, "ProxyProviderSvc", "ProxyProviderSvc"};
723 ServiceHandle<IIncidentSvc> m_incSvc{this, "IncidentSvc", "IncidentSvc"};
724 ServiceHandle<IAlgContextSvc> m_algContextSvc{this, "AlgContextSvc", "AlgContextSvc"};
725 Gaudi::Property<bool> m_DumpStore{this, "Dump", false, "Dump contents at EndEvent"};
726 Gaudi::Property<bool> m_ActivateHistory{this, "ActivateHistory", false, "record DataObjects history"};
727 Gaudi::Property<bool> m_DumpArena{this, "DumpArena", false, "Dump Arena usage stats"};
728 Gaudi::Property<bool> m_pruneIncidents{this, "PruneIncidents", false, "Don't send StoreCleared incidents if there are no registered listeners on the first event."};
730
733
734 SmartIF<SGImplSvc> m_defaultStore;
735
738
739 friend class SG::HiveMgrSvc;
742
743
748 void releaseObject(const CLID& id, const std::string& key);
749
750
752 friend class PileUpMergeSvc;
754 friend class IOVDbSvc;
755 friend class IOVSvcTool;
756 friend
757 void
759
763
765 friend class SG::VarHandleBase;
766 friend
767 PyObject*
771 StatusCode typeless_record( DataObject* obj, const std::string& key,
772 const void* const raw_ptr,
773 bool allowMods, bool resetOnly=true,
774 bool noHist=false );
776 StatusCode typeless_overwrite( const CLID& id,
777 DataObject* obj, const std::string& key,
778 const void* const raw_ptr,
779 bool allowMods,
780 bool noHist=false,
781 const std::type_info* tinfo=0);
782
783 // Helper for record.
784 template <typename T, typename TKEY>
785 StatusCode record1(DataObject* obj, T* pObject, const TKEY& key,
786 bool allowMods, bool resetOnly=true, bool noHist=false) requires KeyConcept<TKEY>;
787
788 // Helper for overwrite.
789 template <typename T, typename TKEY>
790 StatusCode overwrite1(DataObject* obj, T* pObject, const TKEY& key,
791 bool allowMods, bool noHist=false) requires KeyConcept<TKEY>;
792
793 bool isSymLinked(const CLID& linkID, SG::DataProxy* dp);
794
795 StatusCode addSymLink(const CLID& linkid, SG::DataProxy* dp);
796
797 StatusCode addAlias(const std::string& aliasKey, SG::DataProxy* dp);
798
800 std::string createKey(const CLID& dataID);
801
804 const std::string& gK,
805 DataObject* pDObj,
806 bool allowMods,
807 bool resetOnly);
808
810 void recycle(DataObject* pBadDObj);
812 void emptyTrash();
813
819 StatusCode removeProxy(SG::DataProxy* proxy, const void* pTrans,
820 bool forceRemove=false);
822 StatusCode t2pRegister(const void* const pTrans, SG::DataProxy* const pPers);
824 void t2pRemove(const void* const pTrans);
825
827 void msg_update_handler(Gaudi::Details::PropertyBase& outputLevel);
828
830 void addAutoSymLinks (const std::string& key, CLID clid, SG::DataProxy* dp,
831 const std::type_info* tinfo,
832 bool warn_nobib = true);
833
835 : public DataObjID
836 {
837 public:
838 BadListItem (CLID clid, const std::string& key, const std::string& algo)
839 : DataObjID (clid, key), m_algo (algo)
840 {}
841 std::string m_algo;
842 };
843 typedef std::unordered_set<BadListItem, DataObjID_Hasher> BadItemList;
844
847 // Thread-safe, since they're protected by m_badMutex.
848 mutable BadItemList m_badRetrieves ATLAS_THREAD_SAFE;
849 mutable BadItemList m_badRecords ATLAS_THREAD_SAFE;
850
852 typedef std::mutex mutex_t;
853 typedef std::lock_guard<mutex_t> lock_t;
855
856
857 // State of PruneIncidents checking.
858 // HAVE_LISTENERS means that there are listeners for the ClearStore
859 // incident; NO_LISTENERS means that there aren't any.
860 // UNCHECKED means that we haven't checked yet.
862 std::atomic<ListenerState> m_listenerState { UNCHECKED };
863
864
870 void rememberBadRetrieve (CLID clid, const std::string& key) const;
871
872
878 void rememberBadRecord (CLID clid, const std::string& key) const;
879
880
888 CLID clid,
889 const std::string& key) const;
890
891
897 void printBadList (const BadItemList& bad,
898 const std::string& what) const;
899
900
906 template <class DOBJ>
907 bool associateAux (DOBJ*,
908 const std::string& key,
909 bool ignoreMissing=true) const;
910 template <class DOBJ>
911 bool associateAux (const DOBJ*,
912 const std::string& key,
913 bool ignoreMissing=true) const;
914
915 template <class DOBJ, class AUXSTORE>
916 bool associateAux_impl(DOBJ* ptr,
917 const std::string& key,
918 const AUXSTORE*) const;
919 template <class DOBJ>
920 bool associateAux_impl(DOBJ* /*ptr*/,
921 const std::string& /*key*/,
922 const SG::NoAuxStore*) const;
923
924
925private:
928};
929
930
932void SG_dump (StoreGateSvc* sg);
933void SG_dump (StoreGateSvc* sg, const char* fname);
934
935
937
938
939//- PyGate: StoreGate access from python -------------------------------------
940template< class T >
941struct PyGate {
942 // default object retrieval
943 static const T* retrieve( StoreGateSvc* psg ) {
944 const T* obj = 0;
945 if ( StatusCode::SUCCESS == psg->retrieve( obj ) )
946 return obj;
947 return 0;
948 }
949
950 // object retrieval with string key
951 static const T* retrieve( StoreGateSvc* psg, const std::string& key ) {
952 const T* obj = 0;
953 if ( StatusCode::SUCCESS == psg->retrieve( obj, key ) )
954 return obj;
955 return 0;
956 }
957};
958
959#endif // STOREGATE_STOREGATESVC_H
Collection of memory allocators with a common lifetime, plus subsystem summary.
macros to associate a CLID to a type
uint32_t CLID
The Class ID type.
_object PyObject
Simple smart pointer for Gaudi-style refcounted objects.
A standard conforming forward iterator over items in StoreGate.
return type of StoreGateSvc::create.
void SG_dump(StoreGateSvc *sg)
These are intended to be easy to call from the debugger.
Maintain a mapping of strings to 64-bit ints.
Define macros for attributes used to control the static checker.
algorithm that marks for write data objects in SG
Simple smart pointer for Gaudi-style refcounted objects.
DataProxy provides the registry services for StoreGate.
A structure created by HiveMgrSvc and used by SGHiveStoreSvc to forward the StoreGateSvc method to a ...
Athena service for Interval Of Validity database.
Definition IOVDbSvc.h:72
Abstract interface for looking up strings/CLIDs in a pool.
Definition IStringPool.h:28
the preferred mechanism to access information from the different event stores in a pileup job.
The Athena Transient Store API.
Definition SGImplSvc.h:107
a const_iterator facade to DATA.
Definition SGIterator.h:285
Mark that there's no associated AuxStore class.
an iterator facade to DataProxy*.
Definition SGIterator.h:194
Base class for VarHandle types.
The Athena Transient Store API.
StatusCode retrieve(T *&ptr) const
Retrieve the default object into a T*.
StatusCode record(T *p2BRegistered, const TKEY &key, bool allowMods, bool resetOnly=true, bool noHist=false)
Record an object with a key, allow possibility of specifying const-access.
SG::WPtr< T > create(const TKEY &key, ARGS... constructorArgs)
Create an object with one of its constructors and record it with a key.
virtual SG::DataProxy * recordObject(SG::DataObjectSharedPtr< DataObject > obj, const std::string &key, bool allowMods, bool returnExisting) override final
Record an object in the store.
friend class SG::TestHiveStoreSvc
const T * tryConstRetrieve(const TKEY &key) const
virtual StatusCode finalize() override
static SG::HiveEventSlot * currentSlot()
std::string dump() const
dump objects in store.
bool isSymLinked(const CLID &linkID, SG::DataProxy *dp)
virtual StatusCode createObj(IConverter *cvt, IOpaqueAddress *addr, DataObject *&refpObject) override
Call converter to create an object, with locking.
IProxyProviderSvc * proxyProviderSvc()
Return current ProxyProviderSvc.
StatusCode symLink(const T *p2BRegistered, const TLINK *p2BLinked)
make a soft link to the object T* already registered (const link)
virtual void handle(const Incident &) override final
StatusCode record(std::unique_ptr< T > pUnique, const TKEY &key, bool allowMods, bool resetOnly=true, bool noHist=false)
Record an object with a key, allow possibility of specifying const-access.
virtual void registerKey(sgkey_t key, const std::string &str, CLID clidid) override final
Remember an additional mapping from key to string/CLID.
DataObject * accessData(const CLID &id) const
find proxy and access its data. Returns 0 to flag failure
StoreGateSvc(const std::string &name, ISvcLocator *svc)
Standard Constructor.
SmartIF< SGImplSvc > m_defaultStore
T * tryRetrieve(const TKEY &key) const
Variant of the above which doesn't print a warning message.
void msg_update_handler(Gaudi::Details::PropertyBase &outputLevel)
callback for output level property
StatusCode record(T *p2BRegistered, const TKEY &key)
Record an object with a key.
StatusCode loadEventProxies()
load proxies at begin event
BadItemList m_badRetrieves ATLAS_THREAD_SAFE
Remember calls to retrieve and record for a MT store, so we can warn about them during finalize().
Gaudi::Property< bool > m_DumpArena
bool associateAux_impl(DOBJ *ptr, const std::string &key, const AUXSTORE *) const
Gaudi::Property< bool > m_pruneIncidents
StatusCode retrieve(SG::ConstIterator< T > &begin, SG::ConstIterator< T > &end) const
Retrieve all objects of type T: returns an SG::ConstIterator range.
StatusCode retrieve(T *&ptr, const std::string &key) const
Retrieve an object with "key", into a T*.
T * retrieve() const
Variant of the above which doesn't return a status code.
friend class IOVSvcTool
void remap_impl(sgkey_t source, sgkey_t target, off_t index_offset)
Declare a remapping.
bool transientContains(const CLID &id, const TKEY &key) const
Look up a transient data object in TDS only by CLID.
StatusCode overwrite1(DataObject *obj, T *pObject, const TKEY &key, bool allowMods, bool noHist=false)
StatusCode symLink(const CLID id, const TKEY &key, const CLID linkid)
make a soft link to the object pointed by id/key
StatusCode overwrite(T *p2BRegistered, const TKEY &key, bool allowMods, bool noHist=false)
Record an object with a key, overwriting any existing object with same key.
void rememberBad(BadItemList &bad, CLID clid, const std::string &key) const
Remember that retrieve or record was called for a MT store.
StatusCode retrieve(T *&ptr, const TKEY &key) const
Retrieve an object with "key", into a T*.
void t2pRemove(const void *const pTrans)
forwarded to DataStore
static StoreGateSvc * currentStoreGate()
get current StoreGate
StatusCode retrieve(const T *&ptr, const std::string &key) const
Retrieve an object with "key", into a const T*.
StatusCode symLink(const T *p2BRegistered, TLINK *p2BLinked)
make a soft link to the object T* already registered (non-const)
StatusCode record(const T *p2BRegistered, const TKEY &key)
Record a const object with a key.
virtual StoreID::type storeID() const override
get store ID. request forwarded to DataStore:
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::lock_guard< mutex_t > lock_t
T * tryRetrieve() const
Variant of the above which doesn't print a warning message.
SG::DataProxy * transientProxy(const CLID &id, const std::string &key) const
get proxy with given id and key.
const T * tryConstRetrieve() const
void clearProxyPayload(SG::DataProxy *)
use to reset a proxy (clearing the data object it contains) Unlike DataProxy::reset this method corre...
StatusCode remove(const T *pObject)
Remove pObject, will remove its proxy if not reset only.
StatusCode overwrite(T *p2BRegistered, const TKEY &key)
Record an object with a key, overwriting any existing object with same key.
StatusCode retrieve(const T *&ptr) const
Retrieve the default object into a const T*.
StatusCode record1(DataObject *obj, T *pObject, const TKEY &key, bool allowMods, bool resetOnly=true, bool noHist=false)
Gaudi::Property< bool > m_DumpStore
bool contains(const CLID &id, const TKEY &key) const
Look up a keyed object in TDS by CLID.
void setStoreID(StoreID::type id)
set store ID. request forwarded to DataStore:
std::unordered_set< BadListItem, DataObjID_Hasher > BadItemList
IStringPool::sgkey_t sgkey_t
void rememberBadRetrieve(CLID clid, const std::string &key) const
Remember that retrieve() was called for a MT store.
int typeCount() const
Return the number of instances of an object of type T int i = p_store->typeCount<T>(); Note that th...
virtual StatusCode addToStore(CLID id, SG::DataProxy *proxy) override final
Raw addition of a proxy to the store.
CLID clid(const TKEY &key) const
Retrieve the main CLID of the object recorded in StoreGate with the given "key" WARNING: slow!
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.
StatusCode removeDataAndProxy(const T *pObject)
Remove pObject and its proxy no matter what.
friend class PileUpMergeSvc
access emptyTrash
StoreID::type m_storeID
Cache store type in the facade class.
bool associateAux_impl(DOBJ *, const std::string &, const SG::NoAuxStore *) const
virtual void commitNewDataObjects() override final
Reset handles added since the last call to commit.
StoreGateSvc & operator=(const StoreGateSvc &)
void makeCurrent()
The current store is becoming the active store.
bool associateAux(DOBJ *, const std::string &key, bool ignoreMissing=true) const
try to associate a data object to its auxiliary store if ignoreMissing=false
virtual SG::SourceID sourceID(const std::string &key="EventSelector") const override
Return the metadata source ID for the current event slot.
SGImplSvc * currentStore() const
returns pointer to the current SGImplSvc
StatusCode addSymLink(const CLID &linkid, SG::DataProxy *dp)
std::mutex mutex_t
Protect access to m_bad* members.
void emptyTrash()
throw away bad objects
bool transientContains(const TKEY &key) const
Look up a transient data object in TDS only (no Proxy lookup) returns false if object not available i...
virtual StatusCode initialize() override
Service initialization.
std::vector< CLID > clids(const TKEY &key) const
Retrieve all the CLID s (including symlinks) of the object recorded in StoreGate with the given "key"...
virtual StatusCode clearStore(bool forceRemove=false) override final
clear DataStore contents: called by the event loop mgrs
T * retrieve(const TKEY &key) const
Variant of the above which doesn't return a status code.
void printBadList(const BadItemList &bad, const std::string &what) const
Print out a list of bad calls during finalization.
ServiceHandle< IProxyProviderSvc > m_pPPSHandle
Properties.
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...
ServiceHandle< IAlgContextSvc > m_algContextSvc
StatusCode setAlias(SG::DataProxy *proxy, const std::string &aliasKey)
make an alias to a DataObject (provide valid proxy)
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 const std::string * keyToString(sgkey_t key) const override final
Find the string corresponding to a given key.
std::unique_ptr< T > retrieveUniquePrivateCopy(const std::string &key)
EXPERTS ONLY: like readPrivateCopy this method returns your own private copy of a data object of type...
std::atomic< ListenerState > m_listenerState
StatusCode retrieve(const T *&ptr, const TKEY &key) const
Retrieve an object with "key", into a const T*.
StatusCode addAlias(const std::string &aliasKey, SG::DataProxy *dp)
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.
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...
virtual sgkey_t stringToKey(const std::string &str, CLID clid) override final
Find the key for a string/CLID pair.
virtual StatusCode stop() override
Service start.
std::vector< CLID > clids() const
Return all CLIDs in the store.
StatusCode overwrite(std::unique_ptr< T > pUnique, const TKEY &key)
Record an object with a key, overwriting any existing object with same key, take ownership of the uni...
void rememberBadRecord(CLID clid, const std::string &key) const
Remember that retrieve() was called for a MT store.
std::string createKey(const CLID &dataID)
creates a key internally if none specified by client
Gaudi::Property< bool > m_ActivateHistory
virtual std::vector< const SG::DataProxy * > proxies() const override final
return the list of all current proxies in store
StatusCode setAlias(const T *p2BAliased, const AKEY &aliasKey)
make an alias to a DataObject (provide only valid pointer)
void recycle(DataObject *pBadDObj)
put a bad (unrecordable) dobj away
mutex_t m_badMutex
virtual SG::DataProxy * proxy(const void *const pTransient) const override final
get proxy for a given data object address in memory
void remap(CLID clid, const TKEY &source, const TKEY &target, off_t index_offset)
Declare a remapping.
friend class IOVDbSvc
access clearProxyPayload
StatusCode setConst(const void *pointer)
prevent downstream clients from modifying the pointed-at dobj
virtual SG::DataProxy * proxy_exact(SG::sgkey_t sgkey) const override final
Get proxy given a hashed key+clid.
void keys(std::vector< std::string > &vkeys, bool includeAlias=false, bool onlyValid=true) const
provide list of all StoreGate keys associated with an object.
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
void releaseObject(const CLID &id, const std::string &key)
release object held by proxy, if any.
bool contains(const TKEY &key) const
Look up a keyed object in TDS (compare also tryRetrieve) returns false if object not available in TDS...
void setProxyProviderSvc(IProxyProviderSvc *pPPSvc)
associate ProxyProviderSvc to this store
ServiceHandle< IIncidentSvc > m_incSvc
StatusCode removeProxy(SG::DataProxy *proxy, const void *pTrans, bool forceRemove=false)
remove proxy from store, unless it is reset only.
bool associateAux(const DOBJ *, const std::string &key, bool ignoreMissing=true) const
StatusCode record(std::unique_ptr< const T > pUnique, const TKEY &key)
Record a const object with a key.
StoreGateSvc(const StoreGateSvc &)
StatusCode t2pRegister(const void *const pTrans, SG::DataProxy *const pPers)
forwarded to DataStore
virtual::IProxyDict * hiveProxyDict() override final
implements IHiveStore interface
static void setSlot(SG::HiveEventSlot *pSlot)
set the hive event slot pointer: used by the event loop mgrs
StatusCode overwrite(std::unique_ptr< T > pUnique, const TKEY &key, bool allowMods, bool noHist=false)
Record an object with a key, overwriting any existing object with same key.
StatusCode record(std::unique_ptr< T > pUnique, const TKEY &key)
Record an object with a key, take ownership of the unique_ptr obj.
StatusCode setAlias(const T *p2BAliased, const TKEY &key, const AKEY &aliasKey)
make an alias to a DataObject (provide data type and old key)
void setDefaultStore(SGImplSvc *pStore)
set pointer to default event store: used by ActiveStoreSvc
Algorithm preparing auxiliary store objects for slimming.
PyObject * recordObjectToStore(StoreGateSvc *, PyObject *, PyObject *, bool, bool, bool)
record object to storegate
void py_sg_clearProxyPayload(StoreGateSvc *self, SG::DataProxy *)
=============================================================================
Forward declaration.
T * WPtr
Definition SGWPtr.h:15
STL namespace.
static const T * retrieve(StoreGateSvc *psg)
static const T * retrieve(StoreGateSvc *psg, const std::string &key)
BadListItem(CLID clid, const std::string &key, const std::string &algo)
#define private
Definition testRead.cxx:27