ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
SG::VarHandleKeyArrayProperty Class Reference

#include <VarHandleKeyArrayProperty.h>

Inheritance diagram for SG::VarHandleKeyArrayProperty:
Collaboration diagram for SG::VarHandleKeyArrayProperty:

Public Member Functions

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

Private Attributes

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

Detailed Description

Definition at line 33 of file VarHandleKeyArrayProperty.h.

Constructor & Destructor Documentation

◆ VarHandleKeyArrayProperty()

SG::VarHandleKeyArrayProperty::VarHandleKeyArrayProperty ( const std::string &  name,
SG::VarHandleKeyArray ref 
)

Constructor with parameters.

Parameters
nameName of the property.
refObject which this property is setting.

Definition at line 21 of file VarHandleKeyArrayProperty.cxx.

23  : PropertyWithHandlers( name, typeid( SG::VarHandleKeyArray ) ),
24  m_pValue( &ref )
25  {
26 }

Member Function Documentation

◆ assign()

bool SG::VarHandleKeyArrayProperty::assign ( const Gaudi::Details::PropertyBase &  source)
override

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 80 of file VarHandleKeyArrayProperty.cxx.

81 {
82  return fromString( source.toString() ).isSuccess();
83 }

◆ clone()

VarHandleKeyArrayProperty * SG::VarHandleKeyArrayProperty::clone ( ) const
override

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 50 of file VarHandleKeyArrayProperty.cxx.

51 {
52  return new VarHandleKeyArrayProperty( *this );
53 }

◆ fromString()

StatusCode SG::VarHandleKeyArrayProperty::fromString ( const std::string &  s)
override

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 118 of file VarHandleKeyArrayProperty.cxx.

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 }

◆ load()

bool SG::VarHandleKeyArrayProperty::load ( Gaudi::Details::PropertyBase &  destination) const
override

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 65 of file VarHandleKeyArrayProperty.cxx.

66 {
67  return destination.assign( *this );
68 }

◆ operator=()

VarHandleKeyArrayProperty & SG::VarHandleKeyArrayProperty::operator= ( const SG::VarHandleKeyArray value)

Assignment operator.

Parameters
valueValue from which to assign.

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

Definition at line 36 of file VarHandleKeyArrayProperty.cxx.

37 {
38  setValue( value );
39  return *this;
40 }

◆ setValue()

bool SG::VarHandleKeyArrayProperty::setValue ( const SG::VarHandleKeyArray 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 147 of file VarHandleKeyArrayProperty.cxx.

148 {
149  m_pValue->operator=(value);
150  return useUpdateHandler();
151 }

◆ toStream()

void SG::VarHandleKeyArrayProperty::toStream ( std::ostream &  out) const
override

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

Parameters
outStream to which to write.

Definition at line 104 of file VarHandleKeyArrayProperty.cxx.

105 {
106  useReadHandler();
107  out << this->toString();
108 }

◆ toString()

std::string SG::VarHandleKeyArrayProperty::toString ( ) const
override

Return a string representation of the value object.

Definition at line 90 of file VarHandleKeyArrayProperty.cxx.

91 {
92  useReadHandler();
93  std::ostringstream o;
95  return o.str();
96 }

◆ value()

const SG::VarHandleKeyArray & SG::VarHandleKeyArrayProperty::value ( ) const

Return the value object for this Property.

Definition at line 133 of file VarHandleKeyArrayProperty.cxx.

134 {
135  useReadHandler();
136  return *m_pValue;
137 }

Member Data Documentation

◆ m_pValue

SG::VarHandleKeyArray* SG::VarHandleKeyArrayProperty::m_pValue
private

Pointer to the real property.

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

Definition at line 64 of file VarHandleKeyArrayProperty.h.


The documentation for this class was generated from the following files:
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
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::VarHandleKeyArrayProperty::toString
std::string toString() const override
Return a string representation of the value object.
Definition: VarHandleKeyArrayProperty.cxx:90
SG::VarHandleKeyArrayProperty::value
const SG::VarHandleKeyArray & value() const
Return the value object for this Property.
Definition: VarHandleKeyArrayProperty.cxx:133
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::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