ATLAS Offline Software
StoreGateSvc.h
Go to the documentation of this file.
1 /* -*- C++ -*- */
2 
3 /*
4  Copyright (C) 2002-2024 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!
13 #include "AthenaKernel/CLASS_DEF.h"
14 
15 //HIVE wrapper implementation
16 //base classes
17 #include "GaudiKernel/Service.h"
19 
24 
25 #include <GaudiKernel/ClassID.h> // for CLID
26 #include <GaudiKernel/IInterface.h> // for InterfaceID
27 #include <GaudiKernel/IMessageSvc.h> // for Level
28 #include "Gaudi/Property.h"
29 #include "GaudiKernel/ServiceHandle.h"
30 #include "GaudiKernel/StatusCode.h"
31 #include "GaudiKernel/DataObjID.h"
32 #include "GaudiKernel/IAlgContextSvc.h"
33 
34 #include <cstddef> // for size_t
35 #include <list>
36 #include <memory>
37 #include <mutex>
38 #include <string>
39 #include <sys/types.h> // for off_t
40 #include <vector>
41 #include <type_traits>
42 
43 #include "AthenaKernel/StoreID.h"
46 #include "AthAllocators/Arena.h"
47 
48 #include <SGTools/StringPool.h>
49 #include "SGTools/ProxyMap.h" /* for SG::ConstProxyIterator */
50 
51 // includes used in StoreGateSvc.icc
52 #include "GaudiKernel/IClassIDSvc.h"
54 #include "AthenaKernel/IIOVSvc.h"
55 #include "StoreGate/SGIterator.h"
56 #include "StoreGate/DataHandle.h"
57 #include "StoreGate/SGWPtr.h"
60 
61 #include "GaudiKernel/IIncidentListener.h"
62 
63 
64 //forward declarations
65 namespace SG {
66  class DataProxy;
67  class TransientAddress;
68  struct RemapImpl;
69  class TestHiveStoreSvc;
70  class HiveMgrSvc;
71 }
72 namespace xAODMaker {
73  class AuxStoreWrapper;
74 }
75 
76 class DataObject;
77 class IConversionSvc;
78 class IIncidentSvc;
79 class IProxyProviderSvc;
80 class IHistorySvc;
81 
82 // python forward
83 struct _object; typedef _object PyObject;
84 class StoreGateSvc;
85 namespace AthenaInternal {
88 }
89 namespace SG {
90  class NoAuxStore;
91 }
92 
93 //friends...
94 class AthenaOutputStream;
95 class IOVDbSvc;
96 class IOVSvcTool;
97 class PileUpMergeSvc;
98 class SGDeleteAlg;
99 namespace SG {
100  class VarHandleBase;
101 }
102 
120  public Service,
121  public IProxyDict,
122  virtual public IHiveStore,
123  public IHiveStoreMgr,
124  public IIncidentListener
125 {
126 
127 public:
128 #ifndef BOOST_NO_CXX11_TEMPLATE_ALIASES
129 #ifndef BOOST_NO_CXX11_VARIADIC_TEMPLATES
130 
133 
152  template <typename T, typename TKEY, typename... ARGS>
153  SG::WPtr<T> create(const TKEY& key, ARGS... constructorArgs);
155 #endif /* needs C++11 variadic templates to call arbitrary constructors */
156 #endif /* needs "templated typedef" to define SG::WPtr (for now) */
157 
160 
161 
163  template <typename T, typename TKEY>
164  StatusCode record(T* p2BRegistered, const TKEY& key);
165 
167  template <typename T, typename TKEY>
168  StatusCode record(const T* p2BRegistered, const TKEY& key);
169 
170 
173  template <typename T, typename TKEY>
174  StatusCode record(T* p2BRegistered, const TKEY& key,
175  bool allowMods, bool resetOnly=true, bool noHist=false);
176 
178  template <typename T, typename TKEY>
179  StatusCode record(std::unique_ptr<T> pUnique, const TKEY& key);
180 
182  template <typename T, typename TKEY>
183  StatusCode record(std::unique_ptr<const T> pUnique, const TKEY& key);
184 
187  template <typename T, typename TKEY>
188  StatusCode record(std::unique_ptr<T> pUnique, const TKEY& key,
189  bool allowMods, bool resetOnly=true, bool noHist=false);
190 
192 
195 
196 
198  template <typename T>
199  StatusCode retrieve(const T*& ptr) const;
200 
202  template <typename T>
204 
207  template <typename T>
208  T* retrieve () const;
209 
212  template <typename T>
213  T* tryRetrieve () const;
214  template <typename T>
215  const T* tryConstRetrieve() const;
216 
218  template <typename T, typename TKEY>
219  StatusCode retrieve(const T*& ptr, const TKEY& key) const;
220 
223  template <typename T>
224  StatusCode retrieve(const T*& ptr, const std::string& key) const;
225 
226 
228  template <typename T, typename TKEY>
229  StatusCode retrieve(T*& ptr, const TKEY& key) const;
230 
233  template <typename T>
234  StatusCode retrieve(T*& ptr, const std::string& key) const;
235 
236 
239  template <typename T, class TKEY>
240  T* retrieve (const TKEY& key) const;
241 
244  template <typename T, class TKEY>
245  T* tryRetrieve (const TKEY& key) const;
246  template <typename T, class TKEY>
247  const T* tryConstRetrieve(const TKEY& key) const;
248 
249 
250 
252  template <typename T>
254  SG::ConstIterator<T>& end) const;
255 
259  template <typename T, typename TKEY>
261  bool contains(const TKEY& key) const;
262 
276  template <typename T, typename TKEY>
278 
280 
283 
284 
286  template <typename T, typename TKEY>
287  StatusCode overwrite(T* p2BRegistered, const TKEY& key);
288 
290  template <typename T, typename TKEY>
291  StatusCode overwrite(T* p2BRegistered, const TKEY& key,
292  bool allowMods, bool noHist=false);
293 
294 
296  template <typename T, typename TKEY>
297  StatusCode overwrite(std::unique_ptr<T> pUnique, const TKEY& key,
298  bool allowMods, bool noHist=false);
299 
301  template <typename T, typename TKEY>
302  StatusCode overwrite(std::unique_ptr<T> pUnique, const TKEY& key);
303 
305  StatusCode recordAddress(const std::string& skey,
306  IOpaqueAddress* pAddress, bool clearAddressFlag=true);
308  StatusCode recordAddress(IOpaqueAddress* pAddress, bool clearAddressFlag=true);
309 
311  template <typename T, typename TLINK>
312  StatusCode symLink (const T* p2BRegistered, TLINK* p2BLinked );
313 
315  template <typename T, typename TLINK>
316  StatusCode symLink (const T* p2BRegistered, const TLINK* p2BLinked );
317 
319  template <typename TKEY>
320  StatusCode symLink (const CLID id, const TKEY& key, const CLID linkid);
321 
323  template <typename T, typename TKEY, typename AKEY>
324  StatusCode setAlias(const T* p2BAliased, const TKEY& key, const AKEY& aliasKey);
325 
327  template <typename T, typename AKEY>
328  StatusCode setAlias(const T* p2BAliased, const AKEY& aliasKey);
329 
331  StatusCode setAlias(SG::DataProxy* proxy, const std::string& aliasKey);
332 
334  StatusCode setConst(const void* pointer);
335 
337  template <typename T>
338  StatusCode remove(const T* pObject);
339 
341  template <typename T>
342  StatusCode removeDataAndProxy(const T* pObject);
343 
349  bool transientSwap( const CLID& id,
350  const std::string& keyA, const std::string& keyB );
351 
353 
356 
357 
366  template <typename T, class TKEY>
368  const TKEY& requestedKey) const;
369 
375  //FIXME using a vector exposes ObjectWithVersion definition and hence
376  //FIXME VersionedKey.h. Should try an iface like
377  //FIXME retrieveAllVersions(const TKEY& requestedKey,
378  //FIXME ObjectWithVersion<T>& begin,
379  //FIXME ObjectWithVersion<T>& end)
380  template <typename T, class TKEY>
381  StatusCode
383  const TKEY& requestedKey) const;
384 
385 
386 
398  template <typename T>
399  std::unique_ptr<T> retrieveUniquePrivateCopy (const std::string& key);
400 
404  template<typename TKEY>
405  CLID clid( const TKEY& key ) const;
406 
410  template<typename TKEY>
411  std::vector<CLID> clids( const TKEY& key ) const;
412 
417  template <typename T>
418  int typeCount() const;
419 
421  int typeCount(const CLID& id) const;
422 
426  template <typename TKEY>
427  bool contains(const CLID& id, const TKEY& key) const;
428 
429 
433  template <typename T, typename TKEY>
435  bool transientContains(const TKEY& key) const;
436 
439  template <typename TKEY>
440  bool transientContains(const CLID& id, const TKEY& key) const;
441 
444  std::string dump() const;
445 
447  void setStoreID(StoreID::type id);
450 
451 
458  template <typename T>
459  void
460  keys(std::vector<std::string>& vkeys,
461  bool includeAlias = false, bool onlyValid = true) const;
462 
470  void
471  keys(const CLID& id, std::vector<std::string>& vkeys,
472  bool includeAlias = false, bool onlyValid = true) const;
473 
475 
476 
478  // FIXME pointer to unsafe impl exposed
479  virtual ::IProxyDict* hiveProxyDict() override final {
481  }
482 
484  static StoreGateSvc* currentStoreGate();
485 
486 
489 
490  virtual StatusCode clearStore(bool forceRemove=false) override final;
493 
496  virtual void commitNewDataObjects() override final;
498 
500  static void setSlot(SG::HiveEventSlot* pSlot);
501 
502 
504  void setDefaultStore(SGImplSvc* pStore);
505 
506 
509 
510 
511  template <typename H, typename TKEY>
513 
515  template <typename H, typename TKEY>
517 
522  const TKEY& key, bool trigger=false);
523 
527  const T* obj, DataHandle<H>& handle,
528  const TKEY& key, bool trigger=false);
529 
531  template <typename T1, typename T2>
533  const T1* obj1,
534  StatusCode (T2::*fcn2)(IOVSVC_CALLBACK_ARGS),
535  const T2* obj2, bool trigger=false);
536 
538  template <typename T2>
539  StatusCode regFcn ATLAS_NOT_THREAD_SAFE (const std::string& toolName,
540  StatusCode (T2::*fcn2)(IOVSVC_CALLBACK_ARGS),
541  const T2* obj2, bool trigger=false);
542 
544 
547  virtual SG::DataProxy* proxy(const void* const pTransient) const override final;
548 
550  virtual SG::DataProxy* proxy(const CLID& id) const final;
551 
553  virtual SG::DataProxy* proxy(const CLID& id, const std::string& key) const override final;
557 
559  virtual StatusCode addToStore (CLID id, SG::DataProxy* proxy) override final;
560 
581  virtual
582  SG::DataProxy* recordObject (SG::DataObjectSharedPtr<DataObject> obj,
583  const std::string& key,
584  bool allowMods,
585  bool returnExisting) override final;
586 
587 
591  virtual SG::DataProxy* proxy_exact (SG::sgkey_t sgkey) const override final;
592 
593 
595 
597 
598  virtual SG::DataProxy* proxy(const CLID& id, bool checkValid) const final;
603  virtual SG::DataProxy* proxy(const CLID& id, const std::string& key, bool checkValid) const final;
607  virtual SG::DataProxy* proxy(const CLID& id, const char* key, bool checkValid) const final
608  { return this->proxy(id, std::string(key), checkValid); }
609 
611  virtual std::vector<const SG::DataProxy*> proxies() const override final;
612 
614  std::vector<CLID> clids() const;
615 
618  SG::DataProxy* transientProxy(const CLID& id, const std::string& key) const;
619 
621  DataObject* accessData(const CLID& id) const;
623  DataObject* accessData(const CLID& id, const std::string& key) const;
624 
630 
631 
639  virtual SG::SourceID sourceID (const std::string& key = "EventSelector") const override;
640 
641 
644 
645 
647 
656  virtual
657  sgkey_t stringToKey (const std::string& str, CLID clid) override final;
658 
666  virtual
667  const std::string* keyToString (sgkey_t key) const override final;
668 
677  virtual
678  const std::string* keyToString (sgkey_t key, CLID& clid) const override final;
679 
692  virtual
693  void registerKey (sgkey_t key,
694  const std::string& str,
695  CLID clidid) override final;
696 
698 
701 
702 
703 
726  template <class TKEY>
727  void remap (CLID clid,
728  const TKEY& source,
729  const TKEY& target,
730  off_t index_offset);
731 
732 
740  void remap_impl (sgkey_t source,
741  sgkey_t target,
742  off_t index_offset);
743 
744 
753  virtual bool tryELRemap (sgkey_t sgkey_in, size_t index_in,
754  sgkey_t& sgkey_out, size_t& index_out) override final;
755 
757 
760 
761  StoreGateSvc(const std::string& name, ISvcLocator* svc);
762  virtual ~StoreGateSvc() override;
764 
767 
768  virtual StatusCode initialize() override;
769  virtual StatusCode stop() override;
770  virtual StatusCode finalize() override;
771  virtual StatusCode queryInterface( const InterfaceID& riid, void** ppvInterface ) override;
773  static const InterfaceID& interfaceID();
775 
776 
779 
780  virtual void handle(const Incident&) override final;
784 
785 
796  virtual
797  StatusCode createObj (IConverter* cvt,
798  IOpaqueAddress* addr,
799  DataObject*& refpObject) override;
800 
804  void makeCurrent();
805 
806 
807 private:
808 
811  ServiceHandle<IIncidentSvc> m_incSvc;
812 
813 
814  friend class SG::TestHiveStoreSvc;
815  static SG::HiveEventSlot* currentSlot();
816 
817  friend class SG::HiveMgrSvc;
820 
821 
823  friend class AthenaOutputStream;
828 
830  friend class xAODMaker::AuxStoreWrapper;
833  void releaseObject(const CLID& id, const std::string& key);
834 
835 
837  friend class PileUpMergeSvc;
839  friend class IOVDbSvc;
840  friend class IOVSvcTool;
841  friend class SGDeleteAlg;
842  friend
843  void
845 
849 
851  friend class SG::VarHandleBase;
852  friend
853  PyObject*
857  StatusCode typeless_record( DataObject* obj, const std::string& key,
858  const void* const raw_ptr,
859  bool allowMods, bool resetOnly=true,
860  bool noHist=false );
863  DataObject* obj, const std::string& key,
864  const void* const raw_ptr,
865  bool allowMods,
866  bool noHist=false,
867  const std::type_info* tinfo=0);
868 
869  // Helper for record.
870  template <typename T, typename TKEY>
871  StatusCode record1(DataObject* obj, T* pObject, const TKEY& key,
872  bool allowMods, bool resetOnly=true, bool noHist=false);
873 
874  // Helper for overwrite.
875  template <typename T, typename TKEY>
876  StatusCode overwrite1(DataObject* obj, T* pObject, const TKEY& key,
877  bool allowMods, bool noHist=false);
878 
879  bool isSymLinked(const CLID& linkID, SG::DataProxy* dp);
880 
882 
883  StatusCode addAlias(const std::string& aliasKey, SG::DataProxy* dp);
884 
886  std::string createKey(const CLID& dataID);
887 
890  const std::string& gK,
891  DataObject* pDObj,
892  bool allowMods,
893  bool resetOnly);
894 
896  void recycle(DataObject* pBadDObj);
898  void emptyTrash();
899 
905  StatusCode removeProxy(SG::DataProxy* proxy, const void* pTrans,
906  bool forceRemove=false);
910  void t2pRemove(const void* const pTrans);
911 
913  void msg_update_handler(Gaudi::Details::PropertyBase& outputLevel);
914 
916  void addAutoSymLinks (const std::string& key, CLID clid, SG::DataProxy* dp,
917  const std::type_info* tinfo,
918  bool warn_nobib = true);
919 
920  bool m_DumpStore;
922  bool m_DumpArena;
923 
926 
929 
930  struct BadListItem
931  : public DataObjID
932  {
933  public:
934  BadListItem (CLID clid, const std::string& key, const std::string& algo)
935  : DataObjID (clid, key), m_algo (algo)
936  {}
937  std::string m_algo;
938  };
939  typedef std::unordered_set<BadListItem, DataObjID_Hasher> BadItemList;
940 
943  // Thread-safe, since they're protected by m_badMutex.
944  mutable BadItemList m_badRetrieves ATLAS_THREAD_SAFE;
945  mutable BadItemList m_badRecords ATLAS_THREAD_SAFE;
946 
949  typedef std::lock_guard<mutex_t> lock_t;
951 
952 
958  void rememberBadRetrieve (CLID clid, const std::string& key) const;
959 
960 
966  void rememberBadRecord (CLID clid, const std::string& key) const;
967 
968 
975  void rememberBad (BadItemList& bad,
976  CLID clid,
977  const std::string& key) const;
978 
979 
985  void printBadList (const BadItemList& bad,
986  const std::string& what) const;
987 
988 
994  template <class DOBJ>
995  bool associateAux (DOBJ*,
996  const std::string& key,
997  bool ignoreMissing=true) const;
998  template <class DOBJ>
999  bool associateAux (const DOBJ*,
1000  const std::string& key,
1001  bool ignoreMissing=true) const;
1002 
1003  template <class DOBJ, class AUXSTORE>
1005  const std::string& key,
1006  const AUXSTORE*) const;
1007  template <class DOBJ>
1008  bool associateAux_impl(DOBJ* /*ptr*/,
1009  const std::string& /*key*/,
1010  const SG::NoAuxStore*) const;
1011 
1012 
1013 private:
1016 };
1017 
1018 
1020 void SG_dump (StoreGateSvc* sg);
1021 void SG_dump (StoreGateSvc* sg, const char* fname);
1022 
1023 
1024 #include "StoreGate/StoreGateSvc.icc"
1025 
1026 
1027 //- PyGate: StoreGate access from python -------------------------------------
1028 template< class T >
1029 struct PyGate {
1030  // default object retrieval
1031  static const T* retrieve( StoreGateSvc* psg ) {
1032  const T* obj = 0;
1033  if ( StatusCode::SUCCESS == psg->retrieve( obj ) )
1034  return obj;
1035  return 0;
1036  }
1037 
1038  // object retrieval with string key
1039  static const T* retrieve( StoreGateSvc* psg, const std::string& key ) {
1040  const T* obj = 0;
1041  if ( StatusCode::SUCCESS == psg->retrieve( obj, key ) )
1042  return obj;
1043  return 0;
1044  }
1045 };
1046 
1047 #endif // STOREGATE_STOREGATESVC_H
StoreGateSvc::transientSwap
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...
Definition: StoreGateSvc.cxx:332
IOVDbSvc
Athena service for Interval Of Validity database. The IOVDbSvc may be in one of three time states whi...
Definition: IOVDbSvc.h:83
StoreGateSvc::record
StatusCode record(T *p2BRegistered, const TKEY &key)
Record an object with a key.
bad
@ bad
Definition: SUSYToolsTester.cxx:100
common.sgkey
def sgkey(tool)
Definition: common.py:1028
IStringPool
Abstract interface for looking up strings/CLIDs in a pool.
Definition: IStringPool.h:28
StoreGateSvc::typeCount
int typeCount() const
Return the number of instances of an object of type T int i = p_store->typeCount<T>(); Note that th...
TileDCSDataPlotter.dp
dp
Definition: TileDCSDataPlotter.py:840
StoreGateSvc::contains
bool contains(const TKEY &key) const
Look up a keyed object in TDS (compare also tryRetrieve) returns false if object not available in TDS...
StoreGateSvc::createKey
std::string createKey(const CLID &dataID)
creates a key internally if none specified by client
StoreGateSvc::addSymLink
StatusCode addSymLink(const CLID &linkid, SG::DataProxy *dp)
StoreGateSvc::tryRetrieve
T * tryRetrieve(const TKEY &key) const
Variant of the above which doesn't print a warning message.
StoreGateSvc::setSlot
static void setSlot(SG::HiveEventSlot *pSlot)
set the hive event slot pointer: used by the event loop mgrs
Definition: StoreGateSvc.cxx:62
StoreGateSvc::retrieve
T * retrieve() const
Variant of the above which doesn't return a status code.
StoreGateSvc::clearProxyPayload
void clearProxyPayload(SG::DataProxy *)
use to reset a proxy (clearing the data object it contains) Unlike DataProxy::reset this method corre...
Definition: StoreGateSvc.cxx:436
StoreGateSvc::associateAux_impl
bool associateAux_impl(DOBJ *, const std::string &, const SG::NoAuxStore *) const
IHiveStore.h
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
StoreGateSvc::retrieve
T * retrieve(const TKEY &key) const
Variant of the above which doesn't return a status code.
StoreGateSvc::interfaceID
static const InterfaceID & interfaceID()
Should rather be in IStoreGateSvc.h if we had one.
Definition: StoreGateSvc.cxx:467
StoreGateSvc::stop
virtual StatusCode stop() override
Service start.
Definition: StoreGateSvc.cxx:183
StoreGateSvc::keys
void keys(const CLID &id, std::vector< std::string > &vkeys, bool includeAlias=false, bool onlyValid=true) const
provide list of all StoreGate keys associated with an object.
StoreGateSvc::BadListItem::BadListItem
BadListItem(CLID clid, const std::string &key, const std::string &algo)
Definition: StoreGateSvc.h:934
StoreGateSvc::setProxyProviderSvc
void setProxyProviderSvc(IProxyProviderSvc *pPPSvc)
associate ProxyProviderSvc to this store
StoreGateSvc::setAlias
StatusCode setAlias(const T *p2BAliased, const TKEY &key, const AKEY &aliasKey)
make an alias to a DataObject (provide data type and old key)
EventInfoWrite.EventSelector
EventSelector
Definition: EventInfoWrite.py:49
StoreGateSvc::handle
virtual void handle(const Incident &) override final
Definition: StoreGateSvc.cxx:199
BeamSpot::mutex
std::mutex mutex
Definition: InDetBeamSpotVertex.cxx:18
StoreGateSvc::retrieve
StatusCode retrieve(T *&ptr, const TKEY &key) const
Retrieve an object with "key", into a T*.
StoreGateSvc::msg_update_handler
void msg_update_handler(Gaudi::Details::PropertyBase &outputLevel)
callback for output level property
StoreGateSvc::m_storeID
StoreID::type m_storeID
Cache store type in the facade class.
Definition: StoreGateSvc.h:925
SGObjectWithVersion.h
associate a data object with its VersionedKey
PyGate
Definition: StoreGateSvc.h:1029
StoreGateSvc::tryRetrieve
T * tryRetrieve() const
Variant of the above which doesn't print a warning message.
StoreGateSvc::overwrite
StatusCode overwrite(T *p2BRegistered, const TKEY &key)
Record an object with a key, overwriting any existing object with same key.
StoreGateSvc::StoreGateSvc
StoreGateSvc(const StoreGateSvc &)
StoreGateSvc::overwrite
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...
StoreGateSvc::makeCurrent
void makeCurrent()
The current store is becoming the active store.
Definition: StoreGateSvc.cxx:496
StoreGateSvc::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
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
taskman.template
dictionary template
Definition: taskman.py:317
SGDeleteAlg
an algorithm that resets the data objects listed in a SG::Folder
Definition: SGDeleteAlg.h:38
StoreGateSvc::ATLAS_THREAD_SAFE
BadItemList m_badRetrieves ATLAS_THREAD_SAFE
Remember calls to retrieve and record for a MT store, so we can warn about them during finalize().
Definition: StoreGateSvc.h:944
ReadCellNoiseFromCoolCompare.obj2
obj2
Definition: ReadCellNoiseFromCoolCompare.py:303
StoreGateSvc::m_ActivateHistory
bool m_ActivateHistory
property: activate the history service
Definition: StoreGateSvc.h:921
StoreGateSvc::m_DumpStore
bool m_DumpStore
property Dump: triggers dump() at EndEvent
Definition: StoreGateSvc.h:920
StoreGateSvc::printBadList
void printBadList(const BadItemList &bad, const std::string &what) const
Print out a list of bad calls during finalization.
Definition: StoreGateSvc.cxx:555
StoreGateSvc::typeless_overwrite
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
Definition: StoreGateSvc.cxx:348
StoreGateSvc::commitNewDataObjects
virtual void commitNewDataObjects() override final
Reset handles added since the last call to commit.
Definition: StoreGateSvc.cxx:94
StoreGateSvc::currentStore
SGImplSvc * currentStore() const
returns pointer to the current SGImplSvc
StoreGateSvc::clid
CLID clid(const TKEY &key) const
Retrieve the main CLID of the object recorded in StoreGate with the given "key" WARNING: slow!
StoreGateSvc::associateAux
bool associateAux(const DOBJ *, const std::string &key, bool ignoreMissing=true) const
StoreGateSvc::typeCount
int typeCount(const CLID &id) const
Return the number of instances of type T (input CLID)
PyGate::retrieve
static const T * retrieve(StoreGateSvc *psg)
Definition: StoreGateSvc.h:1031
StoreGateSvc::m_pPPSHandle
ServiceHandle< IProxyProviderSvc > m_pPPSHandle
property
Definition: StoreGateSvc.h:810
StoreGateSvc::clids
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"...
SGIterator.h
A standard conforming forward iterator over items in StoreGate.
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
StoreGateSvc.icc
StoreGateSvc::keys
void keys(std::vector< std::string > &vkeys, bool includeAlias=false, bool onlyValid=true) const
provide list of all StoreGate keys associated with an object.
xAODMaker
Definition: StoreGateSvc.h:72
IStringPool::sgkey_t
SG::sgkey_t sgkey_t
Type of the keys.
Definition: IStringPool.h:34
IOVSVC_CALLBACK_ARGS
#define IOVSVC_CALLBACK_ARGS
short hand for IOVSvc call back argument list, to be used when no access to formal arguments is neede...
Definition: IOVSvcDefs.h:24
StoreGateSvc::rememberBadRetrieve
void rememberBadRetrieve(CLID clid, const std::string &key) const
Remember that retrieve() was called for a MT store.
DataHandle.h
SG::WPtr
T * WPtr
Definition: SGWPtr.h:17
IProxyDict
A proxy dictionary.
Definition: AthenaKernel/AthenaKernel/IProxyDict.h:47
HiveEventSlot
A structure created by HiveMgrSvc and used by SGHiveStoreSvc to forward the StoreGateSvc method to a ...
StoreGateSvc::removeProxy
StatusCode removeProxy(SG::DataProxy *proxy, const void *pTrans, bool forceRemove=false)
remove proxy from store, unless it is reset only.
Definition: StoreGateSvc.cxx:501
StoreGateSvc::record
StatusCode record(std::unique_ptr< T > pUnique, const TKEY &key)
Record an object with a key, take ownership of the unique_ptr obj.
StoreGateSvc::record
StatusCode record(const T *p2BRegistered, const TKEY &key)
Record a const object with a key.
ProxyMap.h
StoreGateSvc::storeID
StoreID::type storeID() const
get store ID. request forwarded to DataStore:
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
StoreGateSvc::remap_impl
void remap_impl(sgkey_t source, sgkey_t target, off_t index_offset)
Declare a remapping.
Definition: StoreGateSvc.cxx:410
PileUpMergeSvc
the preferred mechanism to access information from the different event stores in a pileup job.
Definition: PileUpMergeSvc.h:58
StoreGateSvc::transientContains
bool transientContains(const CLID &id, const TKEY &key) const
Look up a transient data object in TDS only by CLID.
StoreGateSvc::retrieve
StatusCode retrieve(const T *&ptr) const
Retrieve the default object into a const T*.
StoreGateSvc::retrieveAllVersions
StatusCode retrieveAllVersions(std::list< SG::ObjectWithVersion< T > > &allVersions, const TKEY &requestedKey) const
Retrieve all versions of a given T,KEY combination sets allVersions, a ref to a vector of ObjectWithV...
StoreGateSvc::proxyRange
StatusCode proxyRange(const CLID &id, SG::ConstProxyIterator &beg, SG::ConstProxyIterator &end) const
return a range to all proxies of a given CLID
Definition: StoreGateSvc.cxx:423
StoreGateSvc::mutex_t
std::mutex mutex_t
Protect access to m_bad* members.
Definition: StoreGateSvc.h:948
StoreGateSvc::m_defaultStore
SGImplSvc * m_defaultStore
Definition: StoreGateSvc.h:809
AthenaInternal
Definition: AthenaPythonDict.h:31
SG::NoAuxStore
Mark that there's no associated AuxStore class.
Definition: AuxStore_traits.h:53
StoreGateSvc::emptyTrash
void emptyTrash()
throw away bad objects
Definition: StoreGateSvc.cxx:462
StoreGateSvc::m_DumpArena
bool m_DumpArena
DumpArena Property flag : trigger m_arena->report() at clearStore.
Definition: StoreGateSvc.h:922
StoreGateSvc::setAlias
StatusCode setAlias(const T *p2BAliased, const AKEY &aliasKey)
make an alias to a DataObject (provide only valid pointer)
StoreGateSvc::finalize
virtual StatusCode finalize() override
Definition: StoreGateSvc.cxx:206
StoreGateSvc::retrieve
StatusCode retrieve(const T *&ptr, const TKEY &key) const
Retrieve an object with "key", into a const T*.
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:125
StoreGateSvc::queryInterface
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvInterface) override
Definition: StoreGateSvc.cxx:471
H
#define H(x, y, z)
Definition: MD5.cxx:114
StoreGateSvc::releaseObject
void releaseObject(const CLID &id, const std::string &key)
release object held by proxy, if any.
Definition: StoreGateSvc.cxx:431
StoreGateSvc::record1
StatusCode record1(DataObject *obj, T *pObject, const TKEY &key, bool allowMods, bool resetOnly=true, bool noHist=false)
StoreGateSvc::operator=
StoreGateSvc & operator=(const StoreGateSvc &)
StoreGateSvc::tryConstRetrieve
const T * tryConstRetrieve(const TKEY &key) const
StoreGateSvc::initialize
virtual StatusCode initialize() override
Service initialization.
Definition: StoreGateSvc.cxx:119
StoreGateSvc::dump
std::string dump() const
dump objects in store.
Definition: StoreGateSvc.cxx:376
StoreGateSvc::regHandle
StatusCode regHandle(DataHandle< H > &handle, const TKEY &key)
non-const method - will return an error
StoreGateSvc::BadItemList
std::unordered_set< BadListItem, DataObjID_Hasher > BadItemList
Definition: StoreGateSvc.h:939
StoreGateSvc::overwrite
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.
StoreGateSvc::m_incSvc
ServiceHandle< IIncidentSvc > m_incSvc
property
Definition: StoreGateSvc.h:811
StoreGateSvc::BadListItem::m_algo
std::string m_algo
Definition: StoreGateSvc.h:937
StoreGateSvc::record
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.
StoreGateSvc::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.
PyObject
_object PyObject
Definition: StoreGateSvc.h:83
IResetable.h
StoreGateSvc::overwrite1
StatusCode overwrite1(DataObject *obj, T *pObject, const TKEY &key, bool allowMods, bool noHist=false)
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
vector
Definition: MultiHisto.h:13
SGImplSvc.h
StoreGateSvc::retrieve
StatusCode retrieve(T *&ptr) const
Retrieve the default object into a T*.
StoreGateSvc::retrieve
StatusCode retrieve(SG::ConstIterator< T > &begin, SG::ConstIterator< T > &end) const
Retrieve all objects of type T: returns an SG::ConstIterator range.
StoreGateSvc::currentStoreGate
static StoreGateSvc * currentStoreGate()
get current StoreGate
Definition: StoreGateSvc.cxx:69
StoreGateSvc::setDefaultStore
void setDefaultStore(SGImplSvc *pStore)
set pointer to default event store: used by ActiveStoreSvc
Definition: StoreGateSvc.cxx:55
DataProxy
DataProxy provides the registry services for StoreGate.
Definition: DataProxy.h:31
StringPool.h
Maintain a mapping of strings to 64-bit ints.
HiveMgrSvc
A service that manages a multi-event collection of StoreGateSvc It implements the IHiveWhiteBoard int...
Definition: SGHiveMgrSvc.h:22
StoreGateSvc::keyToString
virtual const std::string * keyToString(sgkey_t key) const override final
Find the string corresponding to a given key.
StoreGateSvc::loadEventProxies
StatusCode loadEventProxies()
load proxies at begin event
Definition: StoreGateSvc.cxx:442
StoreGateSvc::setAlias
StatusCode setAlias(SG::DataProxy *proxy, const std::string &aliasKey)
make an alias to a DataObject (provide valid proxy)
SGImplSvc
The Athena Transient Store API.
Definition: SGImplSvc.h:112
StoreID
defines an enum used by address providers to decide what kind of StoreGateSvc they are providing addr...
Definition: StoreID.h:18
StoreGateSvc::rememberBadRecord
void rememberBadRecord(CLID clid, const std::string &key) const
Remember that retrieve() was called for a MT store.
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
StoreGateSvc::clearStore
virtual StatusCode clearStore(bool forceRemove=false) override final
clear DataStore contents: called by the event loop mgrs
Definition: StoreGateSvc.cxx:450
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
StoreGateSvc::proxy_exact
virtual SG::DataProxy * proxy_exact(SG::sgkey_t sgkey) const override final
Get proxy given a hashed key+clid.
StoreGateSvc::registerKey
virtual void registerKey(sgkey_t key, const std::string &str, CLID clidid) override final
Remember an additional mapping from key to string/CLID.
Definition: StoreGateSvc.cxx:404
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
StoreGateSvc::ATLAS_NOT_THREAD_SAFE
StatusCode bind ATLAS_NOT_THREAD_SAFE(const DataHandle< T > &handle, const TKEY &key)
A "once-per-job" retrieve that binds a data object to a DataHandle, typically a data member of an Alg...
StoreGateSvc::overwrite
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.
StoreGateSvc::transientContains
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...
StoreGateSvc::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: StoreGateSvc.cxx:340
StoreGateSvc::stringToKey
virtual sgkey_t stringToKey(const std::string &str, CLID clid) override final
Find the key for a string/CLID pair.
Definition: StoreGateSvc.cxx:389
StoreGateSvc::clids
std::vector< CLID > clids() const
Return all CLIDs in the store.
Definition: StoreGateSvc.cxx:305
StoreID.h
IOVSvcTool
Definition: IOVSvcTool.h:70
IProxyDict.h
StoreGateSvc::createObj
virtual StatusCode createObj(IConverter *cvt, IOpaqueAddress *addr, DataObject *&refpObject) override
Call converter to create an object, with locking.
Definition: StoreGateSvc.cxx:518
StoreGateSvc::rememberBad
void rememberBad(BadItemList &bad, CLID clid, const std::string &key) const
Remember that retrieve or record was called for a MT store.
Definition: StoreGateSvc.cxx:532
python.ExitCodes.what
def what(code)
Definition: ExitCodes.py:73
WriteBchToCool.beg
beg
Definition: WriteBchToCool.py:69
StoreGateSvc::proxy
virtual SG::DataProxy * proxy(const void *const pTransient) const override final
get proxy for a given data object address in memory
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
IProxyProviderSvc
Definition: IProxyProviderSvc.h:34
StoreGateSvc::lock_t
std::lock_guard< mutex_t > lock_t
Definition: StoreGateSvc.h:949
StoreGateSvc::symLink
StatusCode symLink(const T *p2BRegistered, TLINK *p2BLinked)
make a soft link to the object T* already registered (non-const)
StoreGateSvc::t2pRemove
void t2pRemove(const void *const pTrans)
forwarded to DataStore
StoreGateSvc::setConst
StatusCode setConst(const void *pointer)
prevent downstream clients from modifying the pointed-at dobj
Definition: StoreGateSvc.cxx:112
StoreGateSvc::t2pRegister
StatusCode t2pRegister(const void *const pTrans, SG::DataProxy *const pPers)
forwarded to DataStore
StoreGateSvc::symLink
StatusCode symLink(const T *p2BRegistered, const TLINK *p2BLinked)
make a soft link to the object T* already registered (const link)
xAODMaker::AuxStoreWrapper
Algorithm preparing auxiliary store objects for slimming.
Definition: AuxStoreWrapper.h:41
StoreGateSvc::symLink
StatusCode symLink(const CLID id, const TKEY &key, const CLID linkid)
make a soft link to the object pointed by id/key
DataHandle
an iterator over instances of a given type in StoreGateSvc. It d-casts and caches locally the pointed...
Definition: DataHandle.h:42
IHiveStoreMgr
the interface through which HiveWB control StoreGate instances
Definition: IHiveStoreMgr.h:24
StoreGateSvc::ATLAS_THREAD_SAFE
BadItemList m_badRecords ATLAS_THREAD_SAFE
Definition: StoreGateSvc.h:945
StoreGateSvc::recordAddress
StatusCode recordAddress(const std::string &skey, IOpaqueAddress *pAddress, bool clearAddressFlag=true)
Create a proxy object using an IOpaqueAddress and a transient key.
python.Dumpers.typename
def typename(t)
Definition: Dumpers.py:194
AthenaInternal::py_sg_clearProxyPayload
void py_sg_clearProxyPayload(StoreGateSvc *self, SG::DataProxy *)
Definition: StoreGatePyExt.cxx:458
StoreGateSvc::accessData
DataObject * accessData(const CLID &id) const
find proxy and access its data. Returns 0 to flag failure
Definition: StoreGateSvc.cxx:321
StoreGateSvc::retrieve
StatusCode retrieve(const T *&ptr, const std::string &key) const
Retrieve an object with "key", into a const T*.
StoreGateSvc::tryConstRetrieve
const T * tryConstRetrieve() const
IIOVSvc.h
python.TrigPSCPythonDbSetup.outputLevel
outputLevel
Definition: TrigPSCPythonDbSetup.py:30
python.AthDsoLogger.fname
string fname
Definition: AthDsoLogger.py:67
StoreGateSvc::retrieveUniquePrivateCopy
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...
StoreGateSvc::recordObject
virtual SG::DataProxy * recordObject(SG::DataObjectSharedPtr< DataObject > obj, const std::string &key, bool allowMods, bool returnExisting) override final
Record an object in the store.
Definition: StoreGateSvc.cxx:287
StoreGateSvc::proxies
virtual std::vector< const SG::DataProxy * > proxies() const override final
return the list of all current proxies in store
Definition: StoreGateSvc.cxx:298
Arena.h
Collection of memory allocators with a common lifetime, plus subsystem summary.
StoreGateSvc::tryELRemap
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.
Definition: StoreGateSvc.cxx:417
StoreGateSvc::remap
void remap(CLID clid, const TKEY &source, const TKEY &target, off_t index_offset)
Declare a remapping.
PyGate::retrieve
static const T * retrieve(StoreGateSvc *psg, const std::string &key)
Definition: StoreGateSvc.h:1039
StoreGateSvc::sourceID
virtual SG::SourceID sourceID(const std::string &key="EventSelector") const override
Return the metadata source ID for the current event slot.
StoreGateSvc::removeDataAndProxy
StatusCode removeDataAndProxy(const T *pObject)
Remove pObject and its proxy no matter what.
StoreGateSvc::record
StatusCode record(std::unique_ptr< const T > pUnique, const TKEY &key)
Record a const object with a key.
SG_dump
void SG_dump(StoreGateSvc *sg)
These are intended to be easy to call from the debugger.
Definition: StoreGateSvc.cxx:571
StoreID::type
type
Definition: StoreID.h:24
StoreGateSvc::associateAux_impl
bool associateAux_impl(DOBJ *ptr, const std::string &key, const AUXSTORE *) const
AthenaOutputStream
algorithm that marks for write data objects in SG
Definition: AthenaOutputStream.h:55
StoreGateSvc::m_algContextSvc
ServiceHandle< IAlgContextSvc > m_algContextSvc
Algorithm context, for tracking bad calls.
Definition: StoreGateSvc.h:928
copySelective.target
string target
Definition: copySelective.py:37
StoreGateSvc::recordAddress
StatusCode recordAddress(IOpaqueAddress *pAddress, bool clearAddressFlag=true)
Create a proxy object using an IOpaqueAddress.
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
StoreGateSvc::setStoreID
void setStoreID(StoreID::type id)
set store ID. request forwarded to DataStore:
Definition: StoreGateSvc.cxx:359
SG::SourceID
std::string SourceID
Definition: AthenaKernel/AthenaKernel/SourceID.h:23
IHiveStoreMgr.h
SGWPtr.h
StoreGateSvc::retrieveHighestVersion
StatusCode retrieveHighestVersion(SG::ObjectWithVersion< T > &dobjWithVersion, const TKEY &requestedKey) const
Retrieve version with highest cycle number for a given T,KEY combination If there is only one availab...
Gaudi
=============================================================================
Definition: CaloGPUClusterAndCellDataMonitorOptions.h:273
StoreGateSvc::remove
StatusCode remove(const T *pObject)
Remove pObject, will remove its proxy if not reset only.
StoreGateSvc::associateAux
bool associateAux(DOBJ *, const std::string &key, bool ignoreMissing=true) const
try to associate a data object to its auxiliary store if ignoreMissing=false
StoreGateSvc::retrieve
StatusCode retrieve(T *&ptr, const std::string &key) const
Retrieve an object with "key", into a T*.
copySelective.source
string source
Definition: copySelective.py:32
str
Definition: BTagTrackIpAccessor.cxx:11
IOVSvcDefs.h
defines and typedefs for IOVSvc
StoreGateSvc::hiveProxyDict
virtual ::IProxyDict * hiveProxyDict() override final
implements IHiveStore interface
Definition: StoreGateSvc.h:479
StoreGateSvc::transientProxy
SG::DataProxy * transientProxy(const CLID &id, const std::string &key) const
get proxy with given id and key.
Definition: StoreGateSvc.cxx:314
StoreGateSvc::proxyProviderSvc
IProxyProviderSvc * proxyProviderSvc()
Return current ProxyProviderSvc.
StoreGateSvc::addToStore
virtual StatusCode addToStore(CLID id, SG::DataProxy *proxy) override final
Raw addition of a proxy to the store.
Definition: StoreGateSvc.cxx:260
SG::ObjectWithVersion
associate a data object with its VersionedKey The object is held by a ReadHandle to delay its retriev...
Definition: SGVersionedKey.h:17
DefaultKey.h
checker_macros.h
Define macros for attributes used to control the static checker.
python.PyAthena.obj
obj
Definition: PyAthena.py:132
SG::DataProxy
Definition: DataProxy.h:44
PyObject
_object PyObject
Definition: IPyComponent.h:26
StoreGateSvc::addAlias
StatusCode addAlias(const std::string &aliasKey, SG::DataProxy *dp)
SGHiveEventSlot.h
StoreGateSvc::m_badMutex
mutex_t m_badMutex
Definition: StoreGateSvc.h:950
StoreGateSvc::create
SG::WPtr< T > create(const TKEY &key, ARGS... constructorArgs)
Create an object with one of its constructors and record it with a key.
StoreGateSvc::isSymLinked
bool isSymLinked(const CLID &linkID, SG::DataProxy *dp)
IHiveStore
the interface that provides access to the current hive store
Definition: IHiveStore.h:23
StoreGateSvc::BadListItem
Definition: StoreGateSvc.h:932
StoreGateSvc::recycle
void recycle(DataObject *pBadDObj)
put a bad (unrecordable) dobj away
SG::ConstIterator
Definition: SGIterator.h:163
CLASS_DEF.h
macros to associate a CLID to a type
StoreGateSvc::currentSlot
static SG::HiveEventSlot * currentSlot()
Definition: StoreGateSvc.cxx:86
AthenaInternal::recordObjectToStore
PyObject * recordObjectToStore(StoreGateSvc *, PyObject *, PyObject *, bool, bool, bool)
record object to storegate
Definition: StoreGatePyExt.cxx:476
SG::ConstProxyIterator
ProxyMap::const_iterator ConstProxyIterator
Definition: ProxyMap.h:28
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
StoreGateSvc::record
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.
ServiceHandle
Definition: ClusterMakerTool.h:37
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
StoreGateSvc::contains
bool contains(const CLID &id, const TKEY &key) const
Look up a keyed object in TDS by CLID.