ATLAS Offline Software
StoreGate/StoreGate/WriteDecorHandleKey.h
Go to the documentation of this file.
1 // This file's extension implies that it's C, but it's really -*- C++ -*-.
2 /*
3  * Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration.
4  */
14 #ifndef STOREGATE_WRITEDECORHANDLEKEY_H
15 #define STOREGATE_WRITEDECORHANDLEKEY_H
16 
17 
20 
21 
22 class AthAlgorithm;
24 class AthAlgTool;
25 
26 
27 namespace SG {
28 
29 
86 template <class T>
88  : public WriteHandleKey<T>
89 {
90 public:
92 
93 
103  WriteDecorHandleKey (const std::string& key = "",
104  const std::string& storeName = StoreID::storeName(StoreID::EVENT_STORE));
105 
106 
116  explicit
118  const std::string& decorKey = "",
119  const std::string& storeName = StoreID::storeName(StoreID::EVENT_STORE));
120 
121 
135  template <class OWNER,
137  WriteDecorHandleKey( OWNER* owner,
138  const std::string& name,
139  const std::string& key = {},
140  const std::string& doc = "");
141 
152  template <class OWNER,
154  WriteDecorHandleKey( OWNER* owner,
155  const std::string& name,
156  const VarHandleKey& contKey,
157  const std::string& decorKey = {},
158  const std::string& doc = "");
159 
160 
169  WriteDecorHandleKey& operator= (const std::string& sgkey);
170 
171 
183  virtual StatusCode assign (const std::string& sgkey) override;
184 
185 
193  StatusCode initialize (bool used = true);
194 
195 
200 
201 
210  void renounce();
211 
212 
216  bool renounced() const;
217 
218 
219 private:
220  friend class ::AthAlgorithm;
221  friend class ::AthReentrantAlgorithm;
222  friend class ::AthAlgTool;
223 
227  virtual std::string pythonRepr() const override;
228 
235 
238 
240  const VarHandleKey* m_contKey = nullptr;
241 
244  bool m_renounced = false;
245 };
246 
247 
248 } // namespace SG
249 
250 
252 
253 
254 #endif // not STOREGATE_WRITEDECORHANDLEKEY_H
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
SG::WriteDecorHandleKey
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Definition: StoreGate/StoreGate/WriteDecorHandleKey.h:89
used
common.sgkey
def sgkey(tool)
Definition: common.py:1028
SG::WriteDecorHandleKey::m_renounced
bool m_renounced
True if this key has been the target of a renounce().
Definition: StoreGate/StoreGate/WriteDecorHandleKey.h:244
WriteDecorHandleKey.icc
SG::WriteDecorHandleKey::Base
WriteHandleKey< T > Base
Definition: StoreGate/StoreGate/WriteDecorHandleKey.h:91
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
SG::WriteDecorHandleKey::renounce
void renounce()
Declare that this item does not participate in scheduling.
SG::WriteDecorHandleKey::assign
virtual StatusCode assign(const std::string &sgkey) override
Change the key of the object to which we're referring.
SG::WriteDecorHandleKey::contHandleKey_nc
ReadHandleKey< T > & contHandleKey_nc()
Return the handle key for the container.
SG::WriteDecorHandleKey::WriteDecorHandleKey
WriteDecorHandleKey(const VarHandleKey &contKey, const std::string &decorKey="", const std::string &storeName=StoreID::storeName(StoreID::EVENT_STORE))
Constructor with associated container.
athena.value
value
Definition: athena.py:122
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
SG::WriteDecorHandleKey::renounced
bool renounced() const
Return the renounced flag.
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
SG::WriteDecorHandleKey::WriteDecorHandleKey
WriteDecorHandleKey(const std::string &key="", const std::string &storeName=StoreID::storeName(StoreID::EVENT_STORE))
Constructor.
SG::WriteDecorHandleKey::m_contHandleKey
ReadHandleKey< T > m_contHandleKey
The container handle.
Definition: StoreGate/StoreGate/WriteDecorHandleKey.h:237
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
SG::WriteDecorHandleKey::WriteDecorHandleKey
WriteDecorHandleKey(OWNER *owner, const std::string &name, const std::string &key={}, const std::string &doc="")
auto-declaring Property Constructor.
SG::WriteDecorHandleKey::pythonRepr
virtual std::string pythonRepr() const override
Python representation of Handle.
AthAlgorithm
Definition: AthAlgorithm.h:47
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
SG::VarHandleKey
A property holding a SG store/key/clid from which a VarHandle is made.
Definition: StoreGate/StoreGate/VarHandleKey.h:62
SG::WriteDecorHandleKey::contHandleKey
const ReadHandleKey< T > & contHandleKey() const
Return the handle key for the container.
SG::WriteDecorHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
SG::WriteDecorHandleKey::m_contKey
const VarHandleKey * m_contKey
Optional container on which decorations are applied.
Definition: StoreGate/StoreGate/WriteDecorHandleKey.h:240
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
SG::WriteDecorHandleKey::operator=
WriteDecorHandleKey & operator=(const std::string &sgkey)
Change the key of the object to which we're referring.
SG::WriteDecorHandleKey::WriteDecorHandleKey
WriteDecorHandleKey(OWNER *owner, const std::string &name, const VarHandleKey &contKey, const std::string &decorKey={}, const std::string &doc="")
auto-declaring Property Constructor.
StoreID::EVENT_STORE
@ EVENT_STORE
Definition: StoreID.h:26
AthAlgTool
Definition: AthAlgTool.h:26
StoreID::storeName
static const std::string & storeName(const StoreID::type &s)
Definition: StoreID.cxx:77