DataObjIDProperty Class Reference

DataObjIDProperty.h GaudiKernel/DataObjProperty.h. More...

#include <GaudiKernel/DataObjIDProperty.h>

Inheritance diagram for DataObjIDProperty:
Collaboration diagram for DataObjIDProperty:

Public Member Functions

 DataObjIDProperty (const std::string &name, DataObjID &ref)
 
DataObjIDPropertyoperator= (const DataObjID &value)
 
virtual ~DataObjIDProperty ()
 
virtual DataObjIDPropertyclone () 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 DataObjIDvalue () const
 
bool setValue (const DataObjID &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

DataObjIDm_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

DataObjIDProperty.h GaudiKernel/DataObjProperty.h.

Helper class to manage DataObjIDs and DataObjIDColls as properties

TODO: DataObjIDCollProperty implementation

Author
Charles Leggett
Date
2015-09-01

Definition at line 28 of file DataObjIDProperty.h.

Constructor & Destructor Documentation

DataObjIDProperty::DataObjIDProperty ( const std::string name,
DataObjID ref 
)

Definition at line 171 of file DataObjIDProperty.cpp.

173  : Property( name, typeid( DataObjID ) ),
174  m_pValue( &ref )
175 {}
DataObjID * m_pValue
Pointer to the real property.
DataObjIDProperty::~DataObjIDProperty ( )
virtual

Definition at line 179 of file DataObjIDProperty.cpp.

180 {}

Member Function Documentation

bool DataObjIDProperty::assign ( const Property source)
inlinevirtual

import the property value form the source

Implements Property.

Definition at line 89 of file DataObjIDProperty.h.

90 {
91  return fromString( source.toString() ).isSuccess();
92 }
virtual std::string toString() const =0
value -> string
virtual StatusCode fromString(const std::string &s)
string -> value
DataObjIDProperty * DataObjIDProperty::clone ( ) const
inlinevirtual

clone: "virtual constructor"

Implements Property.

Definition at line 75 of file DataObjIDProperty.h.

76 {
77  return new DataObjIDProperty( *this );
78 }
DataObjIDProperty(const std::string &name, DataObjID &ref)
StatusCode DataObjIDProperty::fromString ( const std::string value)
virtual

string -> value

Implements Property.

Definition at line 185 of file DataObjIDProperty.cpp.

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

export the property value to the destination

Implements Property.

Definition at line 82 of file DataObjIDProperty.h.

83 {
84  return destination.assign( *this );
85 }
DataObjIDProperty & DataObjIDProperty::operator= ( const DataObjID value)
inline

Definition at line 67 of file DataObjIDProperty.h.

68 {
69  setValue( value );
70  return *this;
71 }
bool setValue(const DataObjID &value)
bool DataObjIDProperty::setValue ( const DataObjID value)

Definition at line 198 of file DataObjIDProperty.cpp.

199 {
200  m_pValue->operator=(value);
201  return useUpdateHandler();
202 }
DataObjID * m_pValue
Pointer to the real property.
virtual bool useUpdateHandler()
use the call-back function at update
Definition: Property.cpp:92
const DataObjID & value() const
void DataObjIDProperty::toStream ( std::ostream out) const
virtual

value -> stream

Implements Property.

Definition at line 217 of file DataObjIDProperty.cpp.

218 {
219  useReadHandler();
220  out << this->toString();
221 }
virtual void useReadHandler() const
use the call-back function at reading
Definition: Property.cpp:80
virtual std::string toString() const
value -> string
std::string DataObjIDProperty::toString ( ) const
virtual

value -> string

Implements Property.

Definition at line 207 of file DataObjIDProperty.cpp.

208 {
209  useReadHandler();
212  return o.str();
213 }
virtual void useReadHandler() const
use the call-back function at reading
Definition: Property.cpp:80
DataObjID * m_pValue
Pointer to the real property.
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
const DataObjID & DataObjIDProperty::value ( ) const
inline

Definition at line 96 of file DataObjIDProperty.h.

97 {
99  return *m_pValue;
100 }
virtual void useReadHandler() const
use the call-back function at reading
Definition: Property.cpp:80
DataObjID * m_pValue
Pointer to the real property.

Member Data Documentation

DataObjID* DataObjIDProperty::m_pValue
private

Pointer to the real property.

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

Definition at line 48 of file DataObjIDProperty.h.


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