ATLAS Offline Software
Loading...
Searching...
No Matches
VarHandleKeyArrayProperty.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5// STL includes
6#include <sstream>
7#include <map>
8#include <boost/tokenizer.hpp>
9
10// StoreGate includes
12
13namespace SG {
14
15
23 : PropertyWithHandlers( name, typeid( ref ) ),
24 m_pValue( &ref )
25 {
26}
27
28
41
42
51{
52 return new VarHandleKeyArrayProperty( *this );
53}
54
55
64bool
65VarHandleKeyArrayProperty::load( Gaudi::Details::PropertyBase& destination ) const
66{
67 return destination.assign( *this );
68}
69
70
79bool
80VarHandleKeyArrayProperty::assign( const Gaudi::Details::PropertyBase& source )
81{
82 return fromString( source.toString() ).isSuccess();
83}
84
85
89std::string
91{
92 useReadHandler();
93 std::ostringstream o;
95 return o.str();
96}
97
98
103void
105{
106 useReadHandler();
107 out << this->toString();
108}
109
110
117StatusCode
119{
120 if (!Gaudi::Parsers::parse(*m_pValue, s).isSuccess()) {
121 return StatusCode::FAILURE;
122 }
123 return useUpdateHandler()
124 ? StatusCode::SUCCESS
125 : StatusCode::FAILURE;
126}
127
128
134{
135 useReadHandler();
136 return *m_pValue;
137}
138
139
146bool
148{
149 m_pValue->operator=(value);
150 return useUpdateHandler();
151}
152
153
154} // namespace SG
const boost::regex ref(r_ef)
class to handle Properties for VarHandleKeyArray
std::string toString() const override
Return a string representation of the value object.
SG::VarHandleKeyArray * m_pValue
Pointer to the real property.
VarHandleKeyArrayProperty(const std::string &name, SG::VarHandleKeyArray &ref)
Constructor with parameters.
bool setValue(const SG::VarHandleKeyArray &value)
Set the value object for this Property.
void toStream(std::ostream &out) const override
Write a string representation of the value object to a stream.
VarHandleKeyArrayProperty * clone() const override
Return a new copy of this Property object.
bool load(Gaudi::Details::PropertyBase &destination) const override
Set the value of another Property.
StatusCode fromString(const std::string &s) override
Set this value object from a string.
const SG::VarHandleKeyArray & value() const
Return the value object for this Property.
bool assign(const Gaudi::Details::PropertyBase &source) override
Set the value of this Property from another.
VarHandleKeyArrayProperty & operator=(const SG::VarHandleKeyArray &value)
Assignment operator.
StatusCode parse(std::tuple< Tup... > &tup, const Gaudi::Parsers::InputData &input)
std::ostream & toStream(const SG::VarHandleKeyArray &v, std::ostream &o)
Gaudi function used to convert a property to a string.
Forward declaration.