ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
Gaudi::Property< SG::ReadHandle< T > & > Class Template Reference

#include <VarHandleProperty.h>

Inheritance diagram for Gaudi::Property< SG::ReadHandle< T > & >:
Collaboration diagram for Gaudi::Property< SG::ReadHandle< T > & >:

Public Member Functions

 Property (const std::string &name, SG::ReadHandle< T > &value)
 
virtual ~Property ()
 
virtual VarHandleKeyPropertyclone () const override
 Return a new copy of this Property object. More...
 
virtual bool load (Gaudi::Details::PropertyBase &destination) const override
 Set the value of another Property. More...
 
virtual bool assign (const Gaudi::Details::PropertyBase &source) override
 Set the value of this Property from another. More...
 
virtual std::string toString () const override
 Return a string representation of the value object. More...
 
virtual void toStream (std::ostream &out) const override
 Write a string representation of the value object to a stream. More...
 
virtual StatusCode fromString (const std::string &s) override
 Set this value object from a string. More...
 
const SG::VarHandleKeyvalue () const
 Return the value object for this Property. More...
 
bool setValue (const SG::VarHandleKey &value)
 Set the value object for this Property. More...
 

Private Attributes

SG::VarHandleKeym_pValue
 Pointer to the real property. More...
 

Detailed Description

template<typename T>
class Gaudi::Property< SG::ReadHandle< T > & >

Definition at line 35 of file VarHandleProperty.h.

Constructor & Destructor Documentation

◆ Property()

template<typename T >
Gaudi::Property< SG::ReadHandle< T > & >::Property ( const std::string &  name,
SG::ReadHandle< T > &  value 
)
inline

Definition at line 37 of file VarHandleProperty.h.

37  :

◆ ~Property()

template<typename T >
virtual Gaudi::Property< SG::ReadHandle< T > & >::~Property ( )
inlinevirtual

Definition at line 39 of file VarHandleProperty.h.

39 {}

Member Function Documentation

◆ assign()

bool SG::VarHandleKeyProperty::assign ( const Gaudi::Details::PropertyBase &  source)
overridevirtualinherited

Set the value of this Property from another.

Parameters
destinationThe Property from which the value should be copied.

The value object of this source is copied to that of this Property by converting to a string and back again. Returns true on success, false on failure.

Definition at line 139 of file VarHandleKeyProperty.cxx.

140 {
141  return fromString( source.toString() ).isSuccess();
142 }

◆ clone()

VarHandleKeyProperty * SG::VarHandleKeyProperty::clone ( ) const
overridevirtualinherited

Return a new copy of this Property object.

The new object will be associated with the same value object as the original.

Definition at line 109 of file VarHandleKeyProperty.cxx.

110 {
111  return new VarHandleKeyProperty( *this );
112 }

◆ fromString()

StatusCode SG::VarHandleKeyProperty::fromString ( const std::string &  s)
overridevirtualinherited

Set this value object from a string.

Parameters
sString from which to initialize the value.

Returns failure if the conversion does not succeed.

Definition at line 177 of file VarHandleKeyProperty.cxx.

178 {
179  if (!Gaudi::Parsers::parse(*m_pValue, s).isSuccess()) {
180  return StatusCode::FAILURE;
181  }
182  return useUpdateHandler()
183  ? StatusCode::SUCCESS
184  : StatusCode::FAILURE;
185 }

◆ load()

bool SG::VarHandleKeyProperty::load ( Gaudi::Details::PropertyBase &  destination) const
overridevirtualinherited

Set the value of another Property.

Parameters
destinationThe Property whose value is changed.

The value object of this Property is copied to that of destination by converting to a string and back again. Returns true on success, false on failure.

Definition at line 124 of file VarHandleKeyProperty.cxx.

125 {
126  return destination.assign( *this );
127 }

◆ setValue()

bool SG::VarHandleKeyProperty::setValue ( const SG::VarHandleKey value)
inherited

Set the value object for this Property.

Parameters
valueValue from which to copy.

Return true on success; false if the update handler failed.

Definition at line 206 of file VarHandleKeyProperty.cxx.

207 {
208  m_pValue->operator=(value);
209  return useUpdateHandler();
210 }

◆ toStream()

void SG::VarHandleKeyProperty::toStream ( std::ostream &  out) const
overridevirtualinherited

Write a string representation of the value object to a stream.

Parameters
outStream to which to write.

Definition at line 163 of file VarHandleKeyProperty.cxx.

164 {
165  useReadHandler();
166  out << this->toString();
167 }

◆ toString()

std::string SG::VarHandleKeyProperty::toString ( ) const
overridevirtualinherited

Return a string representation of the value object.

Definition at line 149 of file VarHandleKeyProperty.cxx.

150 {
151  useReadHandler();
152  std::ostringstream o;
154  return o.str();
155 }

◆ value()

const SG::VarHandleKey & SG::VarHandleKeyProperty::value ( ) const
inherited

Return the value object for this Property.

Definition at line 192 of file VarHandleKeyProperty.cxx.

193 {
194  useReadHandler();
195  return *m_pValue;
196 }

Member Data Documentation

◆ m_pValue

SG::VarHandleKey* SG::VarHandleKeyProperty::m_pValue
privateinherited

Pointer to the real property.

Reference would be better, but Reflex does not support references yet

Definition at line 173 of file VarHandleKeyProperty.h.


The documentation for this class was generated from the following file:
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
Gaudi::Parsers::parse
StatusCode parse(std::tuple< Tup... > &tup, const Gaudi::Parsers::InputData &input)
Definition: CaloGPUClusterAndCellDataMonitorOptions.h:284
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
SG::VarHandleKeyProperty::m_pValue
SG::VarHandleKey * m_pValue
Pointer to the real property.
Definition: VarHandleKeyProperty.h:173
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
Gaudi::Utils::toStream
std::ostream &GAUDI_API toStream(const SG::VarHandleKeyArray &v, std::ostream &o)
Gaudi function used to convert a property to a string.
Definition: StoreGate/src/VarHandleKeyArray.cxx:49
SG::VarHandleKeyProperty::VarHandleKeyProperty
VarHandleKeyProperty(const std::string &name, SG::VarHandleKey &ref)
Constructor with parameters.
Definition: VarHandleKeyProperty.cxx:80
SG::VarHandleKeyProperty::value
const SG::VarHandleKey & value() const
Return the value object for this Property.
Definition: VarHandleKeyProperty.cxx:192
SG::VarHandleKeyProperty
VarHandleKeyProperty is the class which wraps a SG::VarHandleKey.
Definition: VarHandleKeyProperty.h:81
SG::VarHandleKeyProperty::fromString
virtual StatusCode fromString(const std::string &s) override
Set this value object from a string.
Definition: VarHandleKeyProperty.cxx:177
SG::VarHandleKeyProperty::toString
virtual std::string toString() const override
Return a string representation of the value object.
Definition: VarHandleKeyProperty.cxx:149