ATLAS Offline Software
VarHandleKeyArrayProperty.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 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 
13 namespace SG {
14 
15 
23  : PropertyWithHandlers( name, typeid( SG::VarHandleKeyArray ) ),
24  m_pValue( &ref )
25  {
26 }
27 
28 
37 {
38  setValue( value );
39  return *this;
40 }
41 
42 
51 {
52  return new VarHandleKeyArrayProperty( *this );
53 }
54 
55 
64 bool
65 VarHandleKeyArrayProperty::load( Gaudi::Details::PropertyBase& destination ) const
66 {
67  return destination.assign( *this );
68 }
69 
70 
79 bool
80 VarHandleKeyArrayProperty::assign( const Gaudi::Details::PropertyBase& source )
81 {
82  return fromString( source.toString() ).isSuccess();
83 }
84 
85 
89 std::string
91 {
92  useReadHandler();
93  std::ostringstream o;
95  return o.str();
96 }
97 
98 
103 void
105 {
106  useReadHandler();
107  out << this->toString();
108 }
109 
110 
117 StatusCode
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 
132 const SG::VarHandleKeyArray&
134 {
135  useReadHandler();
136  return *m_pValue;
137 }
138 
139 
146 bool
148 {
149  m_pValue->operator=(value);
150  return useUpdateHandler();
151 }
152 
153 
154 } // namespace SG
SG::VarHandleKeyArrayProperty::setValue
bool setValue(const SG::VarHandleKeyArray &value)
Set the value object for this Property.
Definition: VarHandleKeyArrayProperty.cxx:147
SG::VarHandleKeyArrayProperty::VarHandleKeyArrayProperty
VarHandleKeyArrayProperty(const std::string &name, SG::VarHandleKeyArray &ref)
Constructor with parameters.
Definition: VarHandleKeyArrayProperty.cxx:21
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
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::VarHandleKeyArrayProperty::clone
VarHandleKeyArrayProperty * clone() const override
Return a new copy of this Property object.
Definition: VarHandleKeyArrayProperty.cxx:50
SG::VarHandleKeyArrayProperty::assign
bool assign(const Gaudi::Details::PropertyBase &source) override
Set the value of this Property from another.
Definition: VarHandleKeyArrayProperty.cxx:80
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
athena.value
value
Definition: athena.py:124
SG::VarHandleKeyArrayProperty::toString
std::string toString() const override
Return a string representation of the value object.
Definition: VarHandleKeyArrayProperty.cxx:90
VarHandleKeyArrayProperty.h
class to handle Properties for VarHandleKeyArray
SG::VarHandleKeyArrayProperty::value
const SG::VarHandleKeyArray & value() const
Return the value object for this Property.
Definition: VarHandleKeyArrayProperty.cxx:133
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
SG::VarHandleKeyArrayProperty::load
bool load(Gaudi::Details::PropertyBase &destination) const override
Set the value of another Property.
Definition: VarHandleKeyArrayProperty.cxx:65
SG::VarHandleKeyArrayProperty
Definition: VarHandleKeyArrayProperty.h:35
SG::VarHandleKeyArrayProperty::m_pValue
SG::VarHandleKeyArray * m_pValue
Pointer to the real property.
Definition: VarHandleKeyArrayProperty.h:64
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
SG::VarHandleKeyArrayProperty::operator=
VarHandleKeyArrayProperty & operator=(const SG::VarHandleKeyArray &value)
Assignment operator.
Definition: VarHandleKeyArrayProperty.cxx:36
SG::VarHandleKeyArrayProperty::toStream
void toStream(std::ostream &out) const override
Write a string representation of the value object to a stream.
Definition: VarHandleKeyArrayProperty.cxx:104
SG::VarHandleKeyArrayProperty::fromString
StatusCode fromString(const std::string &s) override
Set this value object from a string.
Definition: VarHandleKeyArrayProperty.cxx:118
ref
const boost::regex ref(r_ef)
copySelective.source
string source
Definition: copySelective.py:32
SG::VarHandleKeyArray
Definition: StoreGate/StoreGate/VarHandleKeyArray.h:28