ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
StoreGate
src
VarHandleKeyArrayProperty.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// STL includes
6
#include <sstream>
7
#include <map>
8
9
// StoreGate includes
10
#include "
StoreGate/VarHandleKeyArrayProperty.h
"
11
12
namespace
SG
{
13
14
20
VarHandleKeyArrayProperty::VarHandleKeyArrayProperty
(
const
std::string& name,
21
SG::VarHandleKeyArray
&
ref
)
22
: PropertyWithHandlers( name, typeid(
ref
) ),
23
m_pValue
( &
ref
)
24
{
25
}
26
27
34
VarHandleKeyArrayProperty
&
35
VarHandleKeyArrayProperty::operator=
(
const
SG::VarHandleKeyArray
&
value
)
36
{
37
setValue
(
value
);
38
return
*
this
;
39
}
40
41
48
VarHandleKeyArrayProperty
*
49
VarHandleKeyArrayProperty::clone
()
const
50
{
51
return
new
VarHandleKeyArrayProperty
( *
this
);
52
}
53
54
63
bool
64
VarHandleKeyArrayProperty::load
( Gaudi::Details::PropertyBase& destination )
const
65
{
66
return
destination.assign( *
this
);
67
}
68
69
78
bool
79
VarHandleKeyArrayProperty::assign
(
const
Gaudi::Details::PropertyBase& source )
80
{
81
return
fromString
( source.toString() ).isSuccess();
82
}
83
84
88
std::string
89
VarHandleKeyArrayProperty::toString
( )
const
90
{
91
useReadHandler();
92
std::ostringstream o;
93
Gaudi::Utils::toStream
(*
m_pValue
, o);
94
return
o.str();
95
}
96
97
102
void
103
VarHandleKeyArrayProperty::toStream
(std::ostream& out)
const
104
{
105
useReadHandler();
106
out << this->
toString
();
107
}
108
109
116
StatusCode
117
VarHandleKeyArrayProperty::fromString
(
const
std::string& s)
118
{
119
if
(!
Gaudi::Parsers::parse
(*
m_pValue
, s).isSuccess()) {
120
return
StatusCode::FAILURE;
121
}
122
return
useUpdateHandler()
123
? StatusCode::SUCCESS
124
: StatusCode::FAILURE;
125
}
126
127
131
const
SG::VarHandleKeyArray
&
132
VarHandleKeyArrayProperty::value
()
const
133
{
134
useReadHandler();
135
return
*
m_pValue
;
136
}
137
138
145
bool
146
VarHandleKeyArrayProperty::setValue
(
const
SG::VarHandleKeyArray
&
value
)
147
{
148
m_pValue
->operator=(
value
);
149
return
useUpdateHandler();
150
}
151
152
153
}
// namespace SG
ref
const std::regex ref(r_ef)
VarHandleKeyArrayProperty.h
class to handle Properties for VarHandleKeyArray
SG::VarHandleKeyArrayProperty
Definition
VarHandleKeyArrayProperty.h:35
SG::VarHandleKeyArrayProperty::toString
std::string toString() const override
Return a string representation of the value object.
Definition
VarHandleKeyArrayProperty.cxx:89
SG::VarHandleKeyArrayProperty::m_pValue
SG::VarHandleKeyArray * m_pValue
Pointer to the real property.
Definition
VarHandleKeyArrayProperty.h:64
SG::VarHandleKeyArrayProperty::VarHandleKeyArrayProperty
VarHandleKeyArrayProperty(const std::string &name, SG::VarHandleKeyArray &ref)
Constructor with parameters.
Definition
VarHandleKeyArrayProperty.cxx:20
SG::VarHandleKeyArrayProperty::setValue
bool setValue(const SG::VarHandleKeyArray &value)
Set the value object for this Property.
Definition
VarHandleKeyArrayProperty.cxx:146
SG::VarHandleKeyArrayProperty::toStream
void toStream(std::ostream &out) const override
Write a string representation of the value object to a stream.
Definition
VarHandleKeyArrayProperty.cxx:103
SG::VarHandleKeyArrayProperty::clone
VarHandleKeyArrayProperty * clone() const override
Return a new copy of this Property object.
Definition
VarHandleKeyArrayProperty.cxx:49
SG::VarHandleKeyArrayProperty::load
bool load(Gaudi::Details::PropertyBase &destination) const override
Set the value of another Property.
Definition
VarHandleKeyArrayProperty.cxx:64
SG::VarHandleKeyArrayProperty::fromString
StatusCode fromString(const std::string &s) override
Set this value object from a string.
Definition
VarHandleKeyArrayProperty.cxx:117
SG::VarHandleKeyArrayProperty::value
const SG::VarHandleKeyArray & value() const
Return the value object for this Property.
Definition
VarHandleKeyArrayProperty.cxx:132
SG::VarHandleKeyArrayProperty::assign
bool assign(const Gaudi::Details::PropertyBase &source) override
Set the value of this Property from another.
Definition
VarHandleKeyArrayProperty.cxx:79
SG::VarHandleKeyArrayProperty::operator=
VarHandleKeyArrayProperty & operator=(const SG::VarHandleKeyArray &value)
Assignment operator.
Definition
VarHandleKeyArrayProperty.cxx:35
SG::VarHandleKeyArray
Definition
StoreGate/StoreGate/VarHandleKeyArray.h:28
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
SG
Forward declaration.
Definition
CaloCellPacker_400_500.h:32
Generated on
for ATLAS Offline Software by
1.17.0