ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthToolSupport
AsgDataHandles
Root
AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// $Id$
12
13
14
#include "
AsgDataHandles/VarHandleKey.h
"
15
// #include "AsgDataHandles/exceptions.h"
16
17
#include <iostream>
18
19
namespace
SG
{
20
21
38
VarHandleKey::VarHandleKey
(
const
std::string& sgkey)
39
:
m_sgKey
(sgkey)
40
{
41
}
42
// VarHandleKey::VarHandleKey (CLID clid,
43
// const std::string& sgkey,
44
// Gaudi::DataHandle::Mode a,
45
// const std::string& storeName /*= "StoreGateSvc"*/,
46
// bool isCond /*= false*/)
47
// : Gaudi::DataHandle (DataObjID (clid, sgkey), isCond, a),
48
// m_storeHandle (storeName, "VarHandleKey")
49
// {
50
// parseKey (sgkey, storeName);
51
// m_isEventStore = (m_storeHandle.name() == StoreID::storeName(StoreID::EVENT_STORE) ||
52
// m_storeHandle.name() == StoreID::storeName(StoreID::PILEUP_STORE));
53
// }
54
55
68
VarHandleKey
&
VarHandleKey::operator=
(
const
std::string& sgkey)
69
{
70
if
(
assign
(sgkey).isFailure ()) {
71
throw
std::runtime_error (std::string(
"Could not assign VarHandleKey with key "
) + sgkey);
72
}
73
return
*
this
;
74
}
75
76
88
StatusCode
VarHandleKey::assign
(
const
std::string& sgkey)
89
{
90
m_sgKey
= sgkey;
91
return
StatusCode::SUCCESS;
92
}
93
94
103
StatusCode
VarHandleKey::initialize
(
bool
used
/*= true*/
)
104
{
105
if
(!
used
) {
106
m_sgKey
=
""
;
107
return
StatusCode::SUCCESS;
108
}
109
110
if
(
key
() ==
""
) {
111
// REPORT_ERROR (StatusCode::FAILURE)
112
// << "Cannot initialize a Read/Write/Update handle with a null key.";
113
return
StatusCode::FAILURE;
114
}
115
116
return
StatusCode::SUCCESS;
117
}
118
119
129
StatusCode
VarHandleKey::initialize
(
AllowEmptyEnum
)
130
{
131
if
(
key
().
empty
()) {
132
return
StatusCode::SUCCESS;
133
}
134
return
initialize
(
true
);
135
}
136
137
141
const
std::string&
VarHandleKey::key
()
const
142
{
143
return
m_sgKey
;
144
}
145
146
150
bool
VarHandleKey::empty
()
const
151
{
152
return
m_sgKey
.empty();
153
}
154
155
}
// namespace SG
156
157
namespace
std
{
158
ostream&
operator<<
(ostream& s,
const
SG::VarHandleKey
& m) {
159
// s << "'" << m.objKey() << "'";
160
s <<
"'"
<< m.key() <<
"'"
;
161
return
s;
162
}
163
}
VarHandleKey.h
A property holding a SG store/key/clid from which a VarHandle is made.
SG::VarHandleKey
A property holding a SG store/key/clid from which a VarHandle is made.
Definition
StoreGate/StoreGate/VarHandleKey.h:59
SG::VarHandleKey::operator=
VarHandleKey & operator=(const std::string &sgkey)
Change the key of the object to which we're referring.
Definition
AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:68
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition
AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
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
SG::VarHandleKey::m_sgKey
std::string m_sgKey
StoreGate key, that doesn't include the storename.
Definition
StoreGate/StoreGate/VarHandleKey.h:246
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
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::empty
bool empty() const
Test if the key is blank.
Definition
AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:150
used
holding In fact this class is here in order to allow STL container for all features This class is sho...
SG
Forward declaration.
Definition
CaloCellPacker_400_500.h:32
SG::AllowEmptyEnum
AllowEmptyEnum
Definition
StoreGate/StoreGate/VarHandleKey.h:26
std
STL namespace.
std::operator<<
ostream & operator<<(ostream &s, const SG::VarHandleKey &m)
Definition
AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:158
initialize
void initialize()
Definition
run_EoverP.cxx:894
Generated on
for ATLAS Offline Software by
1.17.0