ATLAS Offline Software
AthToolSupport/AsgDataHandles/AsgDataHandles/VarHandleKey.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 /*
4  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
5 */
6 
15 #ifndef ASG_DATA_HANDLES_VAR_HANDLE_KEY_H
16 #define ASG_DATA_HANDLES_VAR_HANDLE_KEY_H
17 
18 #ifndef XAOD_STANDALONE
19 #include <StoreGate/VarHandleKey.h>
20 #else
21 
23 #include <string>
24 
25 namespace SG {
26 
27 
28 enum AllowEmptyEnum {
29  AllowEmpty = 1
30 };
31 
32 
33 class VarHandleBase;
34 
35 
41 class VarHandleKey
42 {
43 public:
61  explicit VarHandleKey (const std::string& sgkey);
62  // VarHandleKey (CLID clid,
63  // const std::string& sgkey,
64  // Gaudi::DataHandle::Mode a,
65  // const std::string& storeName = StoreID::storeName(StoreID::EVENT_STORE),
66  // bool isCond = false);
67 
68 
69 
73  virtual ~VarHandleKey () noexcept = default;
74 
75 
76 
89  VarHandleKey& operator= (const std::string& sgkey);
90 
91 
103  virtual StatusCode assign (const std::string& sgkey);
104 
105 
114  StatusCode initialize (bool used = true);
115 
116 
127 
128 
132  const std::string& key() const;
133 
134 
138  bool empty() const;
139 
140 
144  bool isEventStore() const;
145 
146 private:
147 
148 
149 // /**
150 // * @brief Handle assignment/construction from a string key.
151 // * @param sgkey The StoreGate key for the referenced object.
152 // *
153 // * The provided key may actually start with the name of the store,
154 // * separated by a "+": "MyStore+Obj". If no "+" is present,
155 // * the store named by @c storeName is used. A key name that starts
156 // * with a slash is interpreted as a hierarchical key name,
157 // * not an empty store name.
158 // *
159 // * see implementation comments for further details
160 // */
161 // void parseKey (const std::string& sgkey, const std::string& storeName);
162 
163 
164 // /**
165 // * @brief Update the name of the store to which we're referring.
166 // * @param name The new store name.
167 // */
168 // void updateHandle (const std::string& name);
169 
171  std::string m_sgKey;
172 
174  bool m_isEventStore = true;
175 };
176 
177 
178 } // namespace SG
179 
180 namespace std {
181  ostream& operator<<(ostream& s, const SG::VarHandleKey& m);
182 }
183 
184 
186 
187 #endif
188 
189 #endif
used
common.sgkey
def sgkey(tool)
Definition: common.py:1028
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
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
SG::VarHandleKey::m_isEventStore
bool m_isEventStore
Cache test for whether we're referencing the event store.
Definition: StoreGate/StoreGate/VarHandleKey.h:253
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
SG::VarHandleKey::empty
bool empty() const
Test if the key is blank.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:150
SG::VarHandleKey::VarHandleKey
VarHandleKey(CLID clid, const std::string &sgkey, Gaudi::DataHandle::Mode a, const std::string &storeName=StoreID::storeName(StoreID::EVENT_STORE), bool isCond=false)
Constructor.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:38
VarHandleKey.icc
SG::AllowEmptyEnum
AllowEmptyEnum
Definition: StoreGate/StoreGate/VarHandleKey.h:29
SG::VarHandleKey::assign
virtual StatusCode assign(const std::string &sgkey)
Change the key of the object to which we're referring.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:88
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
SG::VarHandleKey::isEventStore
bool isEventStore() const
Does this key reference the primary event store?
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
SG::VarHandleKey::m_sgKey
std::string m_sgKey
StoreGate key, that doesn't include the storename.
Definition: StoreGate/StoreGate/VarHandleKey.h:247
StatusCode.h
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
SG::VarHandleKey
A property holding a SG store/key/clid from which a VarHandle is made.
Definition: StoreGate/StoreGate/VarHandleKey.h:62
python.CaloScaleNoiseConfig.default
default
Definition: CaloScaleNoiseConfig.py:79
SG::AllowEmpty
@ AllowEmpty
Definition: StoreGate/StoreGate/VarHandleKey.h:30
SG::operator<<
std::ostream & operator<<(std::ostream &os, const ArenaAllocatorBase::Stats::Stat &stat)
Format a statistic structure.
Definition: ArenaAllocatorBase.cxx:62