ATLAS Offline Software
AthToolSupport/AsgDataHandles/AsgDataHandles/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-2020 CERN for the benefit of the ATLAS collaboration.
4  */
5 
15 #ifndef ASG_DATA_HANDLES_WRITE_DECOR_HANDLE_KEY_H
16 #define ASG_DATA_HANDLES_WRITE_DECOR_HANDLE_KEY_H
17 
18 #ifndef XAOD_STANDALONE
20 #else
21 
22 
26 
27 
28 // class AthAlgorithm;
29 // class AthReentrantAlgorithm;
30 // class AthAlgTool;
31 
32 
33 namespace SG {
34 
35 
36 /*
37  * @brief Property holding a SG store/key/clid/attr name from which a
38  * WriteDecorHandle is made.
39  *
40  * See StoreGate/WriteDecorHandleKey for details.
41  *
42  * This currently (24 Aug 20) contains a number of commented out
43  * members that were part of the original handle implementation, but
44  * have not yet been implemented in the standalone version. The plan
45  * is to either implement or remove them, depending on what is needed
46  * in AnalysisBase as we add more packages.
47  *
48  */
49 template <class T>
50 class WriteDecorHandleKey
51  : public WriteHandleKey<T>
52 {
53 public:
54  typedef WriteHandleKey<T> Base;
55 
56 
66  explicit WriteDecorHandleKey (const std::string& key = ""/*,
67  const std::string& storeName = StoreID::storeName(StoreID::EVENT_STORE)*/);
68 
69 
83  template <class OWNER, class K>
84  WriteDecorHandleKey (OWNER* owner,
85  const std::string& name,
86  const K& key = {},
87  const std::string& doc = "");
88 
89 
98  WriteDecorHandleKey& operator= (const std::string& sgkey);
99 
100 
112  virtual StatusCode assign (const std::string& sgkey) override;
113 
114 
122  StatusCode initialize (bool used = true);
123 
124 
128  const ReadHandleKey<T>& contHandleKey() const;
129 
130 
131 // private:
132 // friend class ::AthAlgorithm;
133 // friend class ::AthReentrantAlgorithm;
134 // friend class ::AthAlgTool;
135 
136 // /**
137 // * @brief Return the handle key for the container.
138 // *
139 // * Should be used only by AthAlgorithm/AthAlgTool.
140 // */
141 // ReadHandleKey<T>& contHandleKey_nc();
142 
143 
145  ReadHandleKey<T> m_contHandleKey;
146 };
147 
148 
149 } // namespace SG
150 
151 
153 
154 #endif
155 
156 #endif
used
common.sgkey
def sgkey(tool)
Definition: common.py:1028
SG::WriteDecorHandleKey::Base
WriteHandleKey< T > Base
Definition: StoreGate/StoreGate/WriteDecorHandleKey.h:91
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
SG::WriteDecorHandleKey::assign
virtual StatusCode assign(const std::string &sgkey) override
Change the key of the object to which we're referring.
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
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
WriteDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
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:195
SG::WriteDecorHandleKey::contHandleKey
const ReadHandleKey< T > & contHandleKey() const
Return the handle key for the container.
DecorKeyHelpers.h
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.
WriteDecorHandleKey.icc
SG::WriteDecorHandleKey::operator=
WriteDecorHandleKey & operator=(const std::string &sgkey)
Change the key of the object to which we're referring.