| The Gaudi Framework v28r2-patches (bc4ad17a)

- 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)
| ~DataObjIDProperty () override
DataObjIDProperty * | clone () const override
| clones the current property More...
bool | load (Property &destination) const override
bool | assign (const Property &source) override
std::string | toString () const override
| value -> string More...
void | toStream (std::ostream &out) const override
| value -> stream More...
StatusCode | fromString (const std::string &s) override
| string -> value More...
const DataObjID & | value () const
bool | setValue (const DataObjID &value)
Public Member Functions inherited from PropertyWithHandlers<>
PropertyBase & | declareReadHandler (std::function< void(PropertyBase &)> fun) override
| set new callback for reading More...
PropertyBase & | declareUpdateHandler (std::function< void(PropertyBase &)> fun) override
| set new callback for update More...
const std::function< void(PropertyBase &)> | readCallBack () const override
| get a reference to the readCallBack More...
const std::function< void(PropertyBase &)> | updateCallBack () const override
| get a reference to the updateCallBack More...
void | useReadHandler () const
| use the call-back function at reading, if available More...
bool | useUpdateHandler () override
| use the call-back function at update, if available More...
Public Member Functions inherited from Gaudi::Details::PropertyBase
const std::string | name () const
| property name More...
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...
virtual bool | load (PropertyBase &dest) const =0
| export the property value to the destination More...
virtual bool | assign (const PropertyBase &source)=0
| import the property value form the source More...
virtual PropertyBase & | declareReadHandler (std::function< void(PropertyBase &)> fun)=0
| set new callback for reading More...
virtual PropertyBase & | declareUpdateHandler (std::function< void(PropertyBase &)> fun)=0
| set new callback for update More...
template<class HT >
PropertyBase & | declareReadHandler (void(HT::*MF)(PropertyBase &), HT *instance)
template<class HT >
PropertyBase & | declareUpdateHandler (void(HT::*MF)(PropertyBase &), HT *instance)
virtual | ~PropertyBase ()=default
| virtual destructor More...
void | setName (std::string value)
| set the new value for the property name More...
void | setDocumentation (std::string value)
| set the documentation string More...
virtual std::ostream & | fillStream (std::ostream &) const
| the printout of the property value More...
void | setOwnerType (const std::type_info &ownerType)
| set the type of the owner class (used for documentation) More...
template<class OWNER >
void | setOwnerType ()
| set the type of the owner class (used for documentation) More...
const std::type_info * | ownerType () const
| get the type of the owner class (used for documentation) More...
std::string | ownerTypeName () const
| get the string for the type of the owner class (used for documentation) More...

## Private Attributes
DataObjID * | m_pValue
| Pointer to the real property. More...

## Additional Inherited Members
Protected Member Functions inherited from Gaudi::Details::PropertyBase
| PropertyBase (const std::type_info &type, std::string name="", std::string doc="")
| constructor from the property name and the type More...
| PropertyBase (std::string name, const std::type_info &type)
| constructor from the property name and the type More...
| PropertyBase (const PropertyBase &)=default
| copy constructor More...
PropertyBase & | operator= (const PropertyBase &)=default
| assignment operator More...

## 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 26 of file DataObjIDProperty.h.

## Constructor & Destructor Documentation

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

Definition at line 174 of file DataObjIDProperty.cpp.

176 : PropertyWithHandlers( name, typeid( DataObjID ) ),
177 m_pValue( &ref )
178 {}
DataObjID
Definition: DataObjID.h:38
PropertyWithHandlers
Helper class to simplify the migration old properties deriving directly from PropertyBase.
Definition: Property.h:751
DataObjIDProperty::m_pValue
DataObjID * m_pValue
Pointer to the real property.
Definition: DataObjIDProperty.h:46

DataObjIDProperty::~DataObjIDProperty | ( |  | ) |
| override

Definition at line 182 of file DataObjIDProperty.cpp.

183 {}

## Member Function Documentation

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

Definition at line 75 of file DataObjIDProperty.h.

76 {
77 return fromString( source.toString() ).isSuccess();
78 }
DataObjIDProperty::fromString
StatusCode fromString(const std::string &s) override
string -> value
Definition: DataObjIDProperty.cpp:188

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

clones the current property

Implements Gaudi::Details::PropertyBase.

Definition at line 68 of file DataObjIDProperty.h.

68 { return new DataObjIDProperty( *this ); }
DataObjIDProperty::DataObjIDProperty
DataObjIDProperty(const std::string &name, DataObjID &ref)
Definition: DataObjIDProperty.cpp:174

StatusCode DataObjIDProperty::fromString | ( | const std::string & | value | ) |
| override virtual

string -> value

Implements Gaudi::Details::PropertyBase.

Definition at line 188 of file DataObjIDProperty.cpp.

189 {
190 if (!Gaudi::Parsers::parse(*m_pValue, s).isSuccess()) {
191 return StatusCode::FAILURE;
192 }
193 return useUpdateHandler()
194 ? StatusCode::SUCCESS
195 : StatusCode::FAILURE;
196 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode::FAILURE
Definition: StatusCode.h:29
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:46
PropertyWithHandlers<>::useUpdateHandler
bool useUpdateHandler() override
use the call-back function at update, if available
Definition: Property.h:780
gaudirun.s
string s
Definition: gaudirun.py:245

bool DataObjIDProperty::load | ( | Property & | destination | ) | const
| inline override

Definition at line 70 of file DataObjIDProperty.h.

71 {
72 return destination.assign( *this );
73 }

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

Definition at line 62 of file DataObjIDProperty.h.

63 {
64 setValue( value );
65 return *this;
66 }
DataObjIDProperty::setValue
bool setValue(const DataObjID &value)
Definition: DataObjIDProperty.cpp:201

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

Definition at line 201 of file DataObjIDProperty.cpp.

202 {
203 m_pValue->operator=(value);
204 return useUpdateHandler();
205 }
DataObjIDProperty::m_pValue
DataObjID * m_pValue
Pointer to the real property.
Definition: DataObjIDProperty.h:46
DataObjIDProperty::value
const DataObjID & value() const
Definition: DataObjIDProperty.h:80
PropertyWithHandlers<>::useUpdateHandler
bool useUpdateHandler() override
use the call-back function at update, if available
Definition: Property.h:780

void DataObjIDProperty::toStream | ( | std::ostream & | out | ) | const
| override virtual

value -> stream

Implements Gaudi::Details::PropertyBase.

Definition at line 220 of file DataObjIDProperty.cpp.

221 {
222 useReadHandler();
223 out << this->toString();
224 }
DataObjIDProperty::toString
std::string toString() const override
value -> string
Definition: DataObjIDProperty.cpp:210
PropertyWithHandlers<>::useReadHandler
void useReadHandler() const
use the call-back function at reading, if available
Definition: Property.h:777

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

value -> string

Implements Gaudi::Details::PropertyBase.

Definition at line 210 of file DataObjIDProperty.cpp.

211 {
212 useReadHandler();
213 std::ostringstream o;
214 Gaudi::Utils::toStream(*m_pValue, o);
215 return o.str();
216 }
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:315
DataObjIDProperty::m_pValue
DataObjID * m_pValue
Pointer to the real property.
Definition: DataObjIDProperty.h:46
std::ostringstream
STL class.
std::ostringstream::str
T str(T...args)
PropertyWithHandlers<>::useReadHandler
void useReadHandler() const
use the call-back function at reading, if available
Definition: Property.h:777

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

Definition at line 80 of file DataObjIDProperty.h.

81 {
82 useReadHandler();
83 return *m_pValue;
84 }
DataObjIDProperty::m_pValue
DataObjID * m_pValue
Pointer to the real property.
Definition: DataObjIDProperty.h:46
PropertyWithHandlers<>::useReadHandler
void useReadHandler() const
use the call-back function at reading, if available
Definition: Property.h:777

## 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 46 of file DataObjIDProperty.h.

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

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