ATLAS Offline Software
CondHandleKey.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef STOREGATE_CONDHANDLEKEY_H
6 #define STOREGATE_CONDHANDLEKEY_H 1
7 
10 #include "StoreGate/StoreGateSvc.h"
12 #include "GaudiKernel/ServiceHandle.h"
13 #include "GaudiKernel/MsgStream.h"
14 #include "GaudiKernel/IClassIDSvc.h"
15 
16 namespace SG {
17 
18  template <class T>
19  class CondHandleKey : public VarHandleKey {
20 
21  public:
22  CondHandleKey( const std::string& key,
23  const std::string& dbKey,
25 
26 // CondHandleKey& operator= (const std::string& sgkey);
27 
28  StatusCode initialize(bool used = true);
30 
31  const std::string& dbKey() const { return m_dbKey; }
32  void setDbKey(const std::string& dbKey) { m_dbKey = dbKey; }
33 
34 
42  virtual StatusCode start() override;
43 
44 
45  protected:
46  bool isInit() const { return m_isInit; }
47 
48  // Deliberately returning a non-const pointer here from a const
49  // member function. We don't own the CondCont, we just reference it.
50  // The Handle<> classes need to get a non-const CondCont from a
51  // const HandleKey<>.
52  CondCont<T>* getCC ATLAS_NOT_CONST_THREAD_SAFE () const { return m_cc; }
53 
54  StoreGateSvc* getCS() const;
55 
56  private:
57 
60 
61  std::string m_dbKey{""};
62 
63  bool m_isInit {false};
64 
65  };
66 
67 
68 }
69 
71 
72 #endif
used
VarHandleKey.h
A property holding a SG store/key/clid from which a VarHandle is made.
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
CondCont.h
Hold mappings of ranges to condition objects.
SG::CondHandleKey::m_isInit
bool m_isInit
Definition: CondHandleKey.h:63
SG::CondHandleKey::m_cs
ServiceHandle< StoreGateSvc > m_cs
Definition: CondHandleKey.h:58
SG::CondHandleKey::CondHandleKey
CondHandleKey(const std::string &key, const std::string &dbKey, Gaudi::DataHandle::Mode a)
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
SG::CondHandleKey::m_cc
CondCont< T > * m_cc
Definition: CondHandleKey.h:59
SG::CondHandleKey::ATLAS_NOT_CONST_THREAD_SAFE
CondCont< T > *getCC ATLAS_NOT_CONST_THREAD_SAFE() const
Definition: CondHandleKey.h:52
SG::AllowEmptyEnum
AllowEmptyEnum
Definition: StoreGate/StoreGate/VarHandleKey.h:29
SG::CondHandleKey::initialize
StatusCode initialize(AllowEmptyEnum)
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:125
SG::CondHandleKey
Definition: CondHandleKey.h:19
SG::CondHandleKey::isInit
bool isInit() const
Definition: CondHandleKey.h:46
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CondHandleKey.icc
SG::CondHandleKey::m_dbKey
std::string m_dbKey
Definition: CondHandleKey.h:61
SG::CondHandleKey::start
virtual StatusCode start() override
Called by the owning algorithm during the START transition.
EventContainers::Mode
Mode
Definition: IdentifiableContainerBase.h:13
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
SG::VarHandleKey
A property holding a SG store/key/clid from which a VarHandle is made.
Definition: StoreGate/StoreGate/VarHandleKey.h:62
a
TList * a
Definition: liststreamerinfos.cxx:10
CondCont
Hold mapping of ranges to condition objects.
Definition: CondCont.h:811
SG::CondHandleKey::getCS
StoreGateSvc * getCS() const
checker_macros.h
Define macros for attributes used to control the static checker.
SG::CondHandleKey::dbKey
const std::string & dbKey() const
Definition: CondHandleKey.h:31
StoreGateSvc.h
SG::CondHandleKey::setDbKey
void setDbKey(const std::string &dbKey)
Definition: CondHandleKey.h:32
ServiceHandle< StoreGateSvc >