ATLAS Offline Software
Loading...
Searching...
No Matches
SG::VarHandleKeyProperty Class Reference

VarHandleKeyProperty is the class which wraps a SG::VarHandleKey. More...

#include <VarHandleKeyProperty.h>

Inherits DataHandleProperty.

Inherited by Gaudi::Property< SG::ReadCondHandle< T > & >, Gaudi::Property< SG::ReadHandle< T > & >, Gaudi::Property< SG::UpdateHandle< T > & >, Gaudi::Property< SG::VarHandleBase & >, Gaudi::Property< SG::WriteCondHandle< T > & >, Gaudi::Property< SG::WriteHandle< T > & >, Gaudi::Property<::SG::ReadCondHandleKey< T > & >, Gaudi::Property<::SG::ReadDecorHandleKey< T > & >, Gaudi::Property<::SG::ReadHandleKey< T > & >, Gaudi::Property<::SG::UpdateHandleKey< T > & >, Gaudi::Property<::SG::VarHandleKey & >, Gaudi::Property<::SG::WriteCondHandleKey< T > & >, Gaudi::Property<::SG::WriteDecorHandleKey< T > & >, and Gaudi::Property<::SG::WriteHandleKey< T > & >.

Collaboration diagram for SG::VarHandleKeyProperty:

Public Member Functions

 VarHandleKeyProperty (const std::string &name, SG::VarHandleKey &ref)
 Constructor with parameters.
VarHandleKeyPropertyoperator= (const SG::VarHandleKey &value)
 Assignment operator.
virtual VarHandleKeyPropertyclone () const override
 Return a new copy of this Property object.
virtual bool load (Gaudi::Details::PropertyBase &destination) const override
 Set the value of another Property.
virtual bool assign (const Gaudi::Details::PropertyBase &source) override
 Set the value of this Property from another.
virtual std::string toString () const override
 Return a string representation of the value object.
virtual void toStream (std::ostream &out) const override
 Write a string representation of the value object to a stream.
virtual StatusCode fromString (const std::string &s) override
 Set this value object from a string.
const SG::VarHandleKeyvalue () const
 Return the value object for this Property.
bool setValue (const SG::VarHandleKey &value)
 Set the value object for this Property.

Private Attributes

SG::VarHandleKeym_pValue
 Pointer to the real property.

Detailed Description

VarHandleKeyProperty is the class which wraps a SG::VarHandleKey.

The Property object refers to an instance of SG::VarHandleKey (the value object) and provides generic methods for manipulating it.

Definition at line 78 of file VarHandleKeyProperty.h.

Constructor & Destructor Documentation

◆ VarHandleKeyProperty()

SG::VarHandleKeyProperty::VarHandleKeyProperty ( const std::string & name,
SG::VarHandleKey & ref )

Constructor with parameters.

Parameters
nameName of the property.
refObject which this property is setting (the value object).
nameName of the property.
refObject which this property is setting.

Definition at line 80 of file VarHandleKeyProperty.cxx.

82 : DataHandleProperty( name, ref ),
83 m_pValue( &ref )
84{
85}
const boost::regex ref(r_ef)
SG::VarHandleKey * m_pValue
Pointer to the real property.

Member Function Documentation

◆ assign()

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

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}
virtual StatusCode fromString(const std::string &s) override
Set this value object from a string.

◆ clone()

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

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}
VarHandleKeyProperty(const std::string &name, SG::VarHandleKey &ref)
Constructor with parameters.

◆ fromString()

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

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}
StatusCode parse(std::tuple< Tup... > &tup, const Gaudi::Parsers::InputData &input)

◆ load()

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

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}

◆ operator=()

VarHandleKeyProperty & SG::VarHandleKeyProperty::operator= ( const SG::VarHandleKey & value)

Assignment operator.

Parameters
valueValue from which to assign.

Copy the value object which we control from another value object.

Definition at line 95 of file VarHandleKeyProperty.cxx.

96{
97 setValue( value );
98 return *this;
99}
bool setValue(const SG::VarHandleKey &value)
Set the value object for this Property.
const SG::VarHandleKey & value() const
Return the value object for this Property.

◆ setValue()

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

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
overridevirtual

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}
virtual std::string toString() const override
Return a string representation of the value object.

◆ toString()

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

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}
std::ostream & toStream(const SG::VarHandleKeyArray &v, std::ostream &o)
Gaudi function used to convert a property to a string.

◆ value()

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

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
private

Pointer to the real property.

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

Definition at line 171 of file VarHandleKeyProperty.h.


The documentation for this class was generated from the following files: