| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Private Attributes | List of all members
DataObjIDProperty Class Reference

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

`#include <GaudiKernel/DataObjIDProperty.h>`

Inheritance diagram for DataObjIDProperty:
[legend]
Collaboration diagram for DataObjIDProperty:
[legend]

## Public Member Functions
| DataObjIDProperty (const std::string &name, DataObjID &ref)
DataObjIDProperty & | operator= (const DataObjID &value)
virtual | ~DataObjIDProperty ()
virtual DataObjIDProperty * | clone () 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 DataObjID & | value () const
bool | setValue (const DataObjID &value)
Public Member Functions inherited from Property
const std::string & | name () const
| property name More...
const std::string & | documentation () const
| property documentation More...
const std::type_info * | type_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 Property & | declareReadHandler (std::function< void(Property &)> fun)
| set new callback for reading More...
virtual Property & | declareUpdateHandler (std::function< void(Property &)> fun)
| set new callback for update More...
template<class HT >
Property & | declareReadHandler (void(HT::*MF)(Property &), HT *instance)
template<class HT >
Property & | declareUpdateHandler (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::ostream & | fillStream (std::ostream &) const
| the printout of the property value More...

## Private Attributes
DataObjID * | m_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...
Property & | operator= (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
Definition: DataObjID.h:38
DataObjIDProperty::m_pValue
DataObjID * m_pValue
Pointer to the real property.
Definition: DataObjIDProperty.h:48
Property::Property
Property()

DataObjIDProperty::~DataObjIDProperty | ( |  | ) |
| virtual

Definition at line 179 of file DataObjIDProperty.cpp.

180 {}

## Member Function Documentation

bool DataObjIDProperty::assign | ( | const Property & | source | ) |
| inline virtual

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 }
Property::toString
virtual std::string toString() const =0
value -> string
DataObjIDProperty::fromString
virtual StatusCode fromString(const std::string &s)
string -> value
Definition: DataObjIDProperty.cpp:185

DataObjIDProperty * DataObjIDProperty::clone | ( |  | ) | const
| inline virtual

clone: "virtual constructor"

Implements Property.

Definition at line 75 of file DataObjIDProperty.h.

76 {
77 return new DataObjIDProperty( *this );
78 }
DataObjIDProperty::DataObjIDProperty
DataObjIDProperty(const std::string &name, DataObjID &ref)
Definition: DataObjIDProperty.cpp:171

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()
191 ? StatusCode::SUCCESS
192 : StatusCode::FAILURE;
193 }
Gaudi::Parsers::parse
StatusCode parse(GaudiUtils::HashMap< K, V > &result, const std::string &input)
Basic parser for the types of HashMap used in DODBasicMapper.
Definition: DODBasicMapper.cpp:11
DataObjIDProperty::m_pValue
DataObjID * m_pValue
Pointer to the real property.
Definition: DataObjIDProperty.h:48
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
Property::useUpdateHandler
virtual bool useUpdateHandler()
use the call-back function at update
Definition: Property.cpp:92
gaudirun.s
string s
Definition: gaudirun.py:245

bool DataObjIDProperty::load | ( | Property & | dest | ) | const
| inline virtual

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 }
DataObjIDProperty::setValue
bool setValue(const DataObjID &value)
Definition: DataObjIDProperty.cpp:198

bool DataObjIDProperty::setValue | ( | const DataObjID & | value | ) |

Definition at line 198 of file DataObjIDProperty.cpp.

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

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 }
Property::useReadHandler
virtual void useReadHandler() const
use the call-back function at reading
Definition: Property.cpp:80
DataObjIDProperty::toString
virtual std::string toString() const
value -> string
Definition: DataObjIDProperty.cpp:207

std::string DataObjIDProperty::toString | ( |  | ) | const
| virtual

value -> string

Implements Property.

Definition at line 207 of file DataObjIDProperty.cpp.

208 {
209 useReadHandler();
210 std::ostringstream o;
211 Gaudi::Utils::toStream(*m_pValue, o);
212 return o.str();
213 }
Property::useReadHandler
virtual void useReadHandler() const
use the call-back function at reading
Definition: Property.cpp:80
DataObjIDProperty::m_pValue
DataObjID * m_pValue
Pointer to the real property.
Definition: DataObjIDProperty.h:48
Gaudi::Utils::toStream
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
std::ostringstream
STL class.
std::ostringstream::str
T str(T...args)

const DataObjID & DataObjIDProperty::value | ( |  | ) | const
| inline

Definition at line 96 of file DataObjIDProperty.h.

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

## 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:

- GaudiKernel/GaudiKernel/DataObjIDProperty.h
- GaudiKernel/src/Lib/DataObjIDProperty.cpp