ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
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. More...
 
VarHandleKeyPropertyoperator= (const SG::VarHandleKey &value)
 Assignment operator. More...
 
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

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 }

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 }

◆ 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 }

◆ 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 }

◆ 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 }

◆ 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 }

◆ 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 }

◆ 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:
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
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
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
SG::VarHandleKeyProperty::m_pValue
SG::VarHandleKey * m_pValue
Pointer to the real property.
Definition: VarHandleKeyProperty.h:171
SG::VarHandleKeyProperty::setValue
bool setValue(const SG::VarHandleKey &value)
Set the value object for this Property.
Definition: VarHandleKeyProperty.cxx:206
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
SG::VarHandleKeyProperty::VarHandleKeyProperty
VarHandleKeyProperty(const std::string &name, SG::VarHandleKey &ref)
Constructor with parameters.
Definition: VarHandleKeyProperty.cxx:80
ref
const boost::regex ref(r_ef)
SG::VarHandleKeyProperty::value
const SG::VarHandleKey & value() const
Return the value object for this Property.
Definition: VarHandleKeyProperty.cxx:192
copySelective.source
string source
Definition: copySelective.py:32
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