DataObjIDCollProperty Class Reference

#include <GaudiKernel/DataObjIDProperty.h>

Inheritance diagram for DataObjIDCollProperty:
Collaboration diagram for DataObjIDCollProperty:

Public Member Functions

 DataObjIDCollProperty (const std::string &name, DataObjIDColl &ref)
 
DataObjIDCollPropertyoperator= (const DataObjIDColl &value)
 
virtual ~DataObjIDCollProperty ()
 
virtual DataObjIDCollPropertyclone () const
 clone: "virtual constructor" More...
 
virtual bool load (Property &destination) const
 export the property value to the destination More...
 
virtual bool assign (const Property &source)
 import the property value form the source More...
 
virtual std::string toString () const
 value -> string More...
 
virtual void toStream (std::ostream &out) const
 value -> stream More...
 
virtual StatusCode fromString (const std::string &s)
 string -> value More...
 
const DataObjIDCollvalue () const
 
bool setValue (const DataObjIDColl &value)
 
- Public Member Functions inherited from Property
const std::stringname () const
 property name More...
 
const std::stringdocumentation () const
 property documentation More...
 
const std::type_infotype_info () const
 property type-info More...
 
std::string type () const
 property type More...
 
const std::function< void(Property &)> & readCallBack () const
 get a reference to the readCallBack More...
 
const std::function< void(Property &)> & updateCallBack () const
 get a reference to the updateCallBack More...
 
virtual PropertydeclareReadHandler (std::function< void(Property &)> fun)
 set new callback for reading More...
 
virtual PropertydeclareUpdateHandler (std::function< void(Property &)> fun)
 set new callback for update More...
 
template<class HT >
PropertydeclareReadHandler (void(HT::*MF)(Property &), HT *instance)
 
template<class HT >
PropertydeclareUpdateHandler (void(HT::*MF)(Property &), HT *instance)
 
virtual void useReadHandler () const
 use the call-back function at reading More...
 
virtual bool useUpdateHandler ()
 use the call-back function at update More...
 
virtual ~Property ()=default
 virtual destructor More...
 
void setName (std::string value)
 set the new value for the property name More...
 
void setDocumentation (std::string documentation)
 set the documentation string More...
 
virtual std::ostreamfillStream (std::ostream &) const
 the printout of the property value More...
 

Private Attributes

DataObjIDCollm_pValue
 Pointer to the real property. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Property
 Property (const std::type_info &type, std::string name="")
 constructor from the property name and the type More...
 
 Property (std::string name, const std::type_info &type)
 constructor from the property name and the type More...
 
 Property (const Property &)=default
 copy constructor More...
 
Propertyoperator= (const Property &)=default
 assignment operator More...
 
- Protected Attributes inherited from Property
std::function< void(Property &)> m_readCallBack
 
std::function< void(Property &)> m_updateCallBack
 

Detailed Description

Definition at line 104 of file DataObjIDProperty.h.

Constructor & Destructor Documentation

DataObjIDCollProperty::DataObjIDCollProperty ( const std::string name,
DataObjIDColl ref 
)

Definition at line 227 of file DataObjIDProperty.cpp.

229  : Property( name, typeid( DataObjIDColl ) ),
230  m_pValue( &ref )
231 {}
DataObjIDColl * m_pValue
Pointer to the real property.
DataObjIDCollProperty::~DataObjIDCollProperty ( )
virtual

Definition at line 235 of file DataObjIDProperty.cpp.

236 {}

Member Function Documentation

bool DataObjIDCollProperty::assign ( const Property source)
inlinevirtual

import the property value form the source

Implements Property.

Definition at line 165 of file DataObjIDProperty.h.

166 {
167  return fromString( source.toString() ).isSuccess();
168 }
virtual StatusCode fromString(const std::string &s)
string -> value
virtual std::string toString() const =0
value -> string
DataObjIDCollProperty * DataObjIDCollProperty::clone ( ) const
inlinevirtual

clone: "virtual constructor"

Implements Property.

Definition at line 151 of file DataObjIDProperty.h.

152 {
153  return new DataObjIDCollProperty( *this );
154 }
DataObjIDCollProperty(const std::string &name, DataObjIDColl &ref)
StatusCode DataObjIDCollProperty::fromString ( const std::string value)
virtual

string -> value

Implements Property.

Definition at line 241 of file DataObjIDProperty.cpp.

242 {
243  if (!Gaudi::Parsers::parse(*m_pValue, s).isSuccess()) {
244  return StatusCode::FAILURE;
245  }
246  return useUpdateHandler()
249 }
StatusCode parse(GaudiUtils::HashMap< K, V > &result, const std::string &input)
Basic parser for the types of HashMap used in DODBasicMapper.
virtual bool useUpdateHandler()
use the call-back function at update
Definition: Property.cpp:92
string s
Definition: gaudirun.py:245
DataObjIDColl * m_pValue
Pointer to the real property.
bool DataObjIDCollProperty::load ( Property dest) const
inlinevirtual

export the property value to the destination

Implements Property.

Definition at line 158 of file DataObjIDProperty.h.

159 {
160  return destination.assign( *this );
161 }
DataObjIDCollProperty & DataObjIDCollProperty::operator= ( const DataObjIDColl value)
inline

Definition at line 143 of file DataObjIDProperty.h.

144 {
145  setValue( value );
146  return *this;
147 }
bool setValue(const DataObjIDColl &value)
bool DataObjIDCollProperty::setValue ( const DataObjIDColl value)

Definition at line 254 of file DataObjIDProperty.cpp.

255 {
256  m_pValue->operator=(value);
257  return useUpdateHandler();
258 }
virtual bool useUpdateHandler()
use the call-back function at update
Definition: Property.cpp:92
DataObjIDColl * m_pValue
Pointer to the real property.
const DataObjIDColl & value() const
void DataObjIDCollProperty::toStream ( std::ostream out) const
virtual

value -> stream

Implements Property.

Definition at line 273 of file DataObjIDProperty.cpp.

274 {
275  useReadHandler();
276  out << this->toString();
277 }
virtual void useReadHandler() const
use the call-back function at reading
Definition: Property.cpp:80
virtual std::string toString() const
value -> string
std::string DataObjIDCollProperty::toString ( ) const
virtual

value -> string

Implements Property.

Definition at line 263 of file DataObjIDProperty.cpp.

264 {
265  useReadHandler();
268  return o.str();
269 }
virtual void useReadHandler() const
use the call-back function at reading
Definition: Property.cpp:80
std::ostream & toStream(ITERATOR first, ITERATOR last, std::ostream &s, const std::string &open, const std::string &close, const std::string &delim)
the helper function to print the sequence
Definition: ToStream.h:319
DataObjIDColl * m_pValue
Pointer to the real property.
const DataObjIDColl & DataObjIDCollProperty::value ( ) const
inline

Definition at line 172 of file DataObjIDProperty.h.

173 {
174  useReadHandler();
175  return *m_pValue;
176 }
virtual void useReadHandler() const
use the call-back function at reading
Definition: Property.cpp:80
DataObjIDColl * m_pValue
Pointer to the real property.

Member Data Documentation

DataObjIDColl* DataObjIDCollProperty::m_pValue
private

Pointer to the real property.

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

Definition at line 124 of file DataObjIDProperty.h.


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