ATLAS Offline Software
Loading...
Searching...
No Matches
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
13
14
15#ifndef ASG_DATA_HANDLES_VAR_HANDLE_KEY_H
16#define ASG_DATA_HANDLES_VAR_HANDLE_KEY_H
17
18#ifndef XAOD_STANDALONE
20#else
21
23#include <string>
24
25namespace SG {
26
27
28enum AllowEmptyEnum {
29 AllowEmpty = 1
30};
31
32
33class VarHandleBase;
34
35
41class VarHandleKey
42{
43public:
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
126 StatusCode initialize (AllowEmptyEnum);
127
128
132 const std::string& key() const;
133
134
138 bool empty() const;
139
140
144 bool isEventStore() const;
145
146private:
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
180namespace std {
181 ostream& operator<<(ostream& s, const SG::VarHandleKey& m);
182}
183
184
186
187#endif
188
189#endif
A property holding a SG store/key/clid from which a VarHandle is made.
Base class for VarHandle types.
A property holding a SG store/key/clid from which a VarHandle is made.
bool isEventStore() const
Does this key reference the primary event store?
const std::string & key() const
Return the StoreGate ID for the referenced object.
virtual StatusCode assign(const std::string &sgkey)
Change the key of the object to which we're referring.
std::string m_sgKey
StoreGate key, that doesn't include the storename.
bool m_isEventStore
Cache test for whether we're referencing the event store.
VarHandleKey(CLID clid, const std::string &sgkey, Gaudi::DataHandle::Mode a, const std::string &storeName=StoreID::storeName(StoreID::EVENT_STORE), bool isCond=false)
Constructor.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
bool empty() const
Test if the key is blank.
Forward declaration.
std::ostream & operator<<(std::ostream &os, const ArenaAllocatorBase::Stats::Stat &stat)
Format a statistic structure.
#define private