ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
StoreGate
src
VarHandleKeyProperty.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
11
12
// STL includes
13
#include <sstream>
14
#include <map>
15
16
// StoreGate includes
17
#include "
StoreGate/VarHandleKeyProperty.h
"
18
19
static
const
char
*
const
storeSeparator
=
"+"
;
20
21
namespace
Gaudi
{
22
namespace
Parsers {
23
24
34
StatusCode
35
parse
(
SG::VarHandleKey
& v,
const
std::string& s)
36
{
37
std::string prop;
38
StatusCode
sc
=
Gaudi::Parsers::parse
(prop, s);
39
if
(
sc
.isSuccess())
40
sc
= v.assign (prop);
41
return
sc
;
42
}
43
44
}
//> ns Parsers
45
46
namespace
Utils
{
47
48
58
std::ostream&
59
toStream
(
const
SG::VarHandleKey
& v, std::ostream& o)
60
{
61
o <<
"'"
<< v.storeHandle().name() <<
storeSeparator
<< v.key() <<
"'"
;
62
return
o;
63
}
64
65
}
//> ns Utils
66
67
}
//> ns Gaudi
68
69
70
namespace
SG
{
71
72
78
VarHandleKeyProperty::VarHandleKeyProperty
(
const
std::string& name,
79
SG::VarHandleKey
&
ref
)
80
: DataHandleProperty( name,
ref
),
81
m_pValue
( &
ref
)
82
{
83
}
84
85
87
* @brief Assignment operator.
88
* @param value Value from which to assign.
89
*
90
* Copy the value object which we control from another value object.
91
*/
92
VarHandleKeyProperty
&
93
VarHandleKeyProperty::operator=
(
const
SG::VarHandleKey
&
value
)
94
{
95
setValue
(
value
);
96
return
*
this
;
97
}
98
99
106
VarHandleKeyProperty
*
107
VarHandleKeyProperty::clone
()
const
108
{
109
return
new
VarHandleKeyProperty
( *
this
);
110
}
111
112
121
bool
122
VarHandleKeyProperty::load
( Gaudi::Details::PropertyBase& destination )
const
123
{
124
return
destination.assign( *
this
);
125
}
126
127
136
bool
137
VarHandleKeyProperty::assign
(
const
Gaudi::Details::PropertyBase& source )
138
{
139
return
fromString
( source.toString() ).isSuccess();
140
}
141
142
146
std::string
147
VarHandleKeyProperty::toString
( )
const
148
{
149
useReadHandler();
150
std::ostringstream o;
151
Gaudi::Utils::toStream
(*
m_pValue
, o);
152
return
o.str();
153
}
154
155
160
void
161
VarHandleKeyProperty::toStream
(std::ostream& out)
const
162
{
163
useReadHandler();
164
out << this->
toString
();
165
}
166
167
174
StatusCode
175
VarHandleKeyProperty::fromString
(
const
std::string& s)
176
{
177
if
(!
Gaudi::Parsers::parse
(*
m_pValue
, s).isSuccess()) {
178
return
StatusCode::FAILURE;
179
}
180
return
useUpdateHandler()
181
? StatusCode::SUCCESS
182
: StatusCode::FAILURE;
183
}
184
185
189
const
SG::VarHandleKey
&
190
VarHandleKeyProperty::value
()
const
191
{
192
useReadHandler();
193
return
*
m_pValue
;
194
}
195
196
203
bool
204
VarHandleKeyProperty::setValue
(
const
SG::VarHandleKey
&
value
)
205
{
206
m_pValue
->operator=(
value
);
207
return
useUpdateHandler();
208
}
209
210
211
}
// namespace SG
ref
const std::regex ref(r_ef)
sc
static Double_t sc
Definition
LArPhysWaveHECTool.cxx:37
storeSeparator
constexpr char const storeSeparator
Definition
StoreGate/src/VarHandleKey.cxx:25
VarHandleKeyProperty.h
Handle Gaudi property setting for VarHandleKey.
Gaudi::Property<::SG::VarHandleKey & >::VarHandleKeyProperty
VarHandleKeyProperty(const std::string &name, SG::VarHandleKey &ref)
Constructor with parameters.
Definition
VarHandleKeyProperty.cxx:78
SG::VarHandleKeyProperty
VarHandleKeyProperty is the class which wraps a SG::VarHandleKey.
Definition
VarHandleKeyProperty.h:79
SG::VarHandleKeyProperty::setValue
bool setValue(const SG::VarHandleKey &value)
Set the value object for this Property.
Definition
VarHandleKeyProperty.cxx:204
SG::VarHandleKeyProperty::VarHandleKeyProperty
VarHandleKeyProperty(const std::string &name, SG::VarHandleKey &ref)
Constructor with parameters.
Definition
VarHandleKeyProperty.cxx:78
SG::VarHandleKeyProperty::clone
virtual VarHandleKeyProperty * clone() const override
Return a new copy of this Property object.
Definition
VarHandleKeyProperty.cxx:107
SG::VarHandleKeyProperty::operator=
VarHandleKeyProperty & operator=(const SG::VarHandleKey &value)
Assignment operator.
Definition
VarHandleKeyProperty.cxx:93
SG::VarHandleKeyProperty::value
const SG::VarHandleKey & value() const
Return the value object for this Property.
Definition
VarHandleKeyProperty.cxx:190
SG::VarHandleKeyProperty::load
virtual bool load(Gaudi::Details::PropertyBase &destination) const override
Set the value of another Property.
Definition
VarHandleKeyProperty.cxx:122
SG::VarHandleKeyProperty::fromString
virtual StatusCode fromString(const std::string &s) override
Set this value object from a string.
Definition
VarHandleKeyProperty.cxx:175
SG::VarHandleKeyProperty::toStream
virtual void toStream(std::ostream &out) const override
Write a string representation of the value object to a stream.
Definition
VarHandleKeyProperty.cxx:161
SG::VarHandleKeyProperty::assign
virtual bool assign(const Gaudi::Details::PropertyBase &source) override
Set the value of this Property from another.
Definition
VarHandleKeyProperty.cxx:137
SG::VarHandleKeyProperty::m_pValue
SG::VarHandleKey * m_pValue
Pointer to the real property.
Definition
VarHandleKeyProperty.h:171
SG::VarHandleKeyProperty::toString
virtual std::string toString() const override
Return a string representation of the value object.
Definition
VarHandleKeyProperty.cxx:147
SG::VarHandleKey
A property holding a SG store/key/clid from which a VarHandle is made.
Definition
StoreGate/StoreGate/VarHandleKey.h:59
Gaudi::Parsers::parse
StatusCode parse(std::tuple< Tup... > &tup, const Gaudi::Parsers::InputData &input)
Definition
CaloGPUClusterAndCellDataMonitorOptions.h:284
Gaudi::Utils::toStream
std::ostream & toStream(const SG::VarHandleKeyArray &v, std::ostream &o)
Gaudi function used to convert a property to a string.
Definition
StoreGate/src/VarHandleKeyArray.cxx:47
Gaudi
=============================================================================
Definition
CaloGPUClusterAndCellDataMonitorOptions.h:273
SG
Forward declaration.
Definition
CaloCellPacker_400_500.h:32
Utils
Definition
ProxyContainer.h:28
Generated on
for ATLAS Offline Software by
1.17.0