| 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
DataObjIDCollProperty Class Reference

`#include <GaudiKernel/DataObjIDProperty.h>`

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

## Public Member Functions
| DataObjIDCollProperty (const std::string &name, DataObjIDColl &ref)
DataObjIDCollProperty & | operator= (const DataObjIDColl &value)
virtual | ~DataObjIDCollProperty ()
virtual DataObjIDCollProperty * | 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 DataObjIDColl & | value () const
bool | setValue (const DataObjIDColl &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
DataObjIDColl * | 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

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 {}
Property::Property
Property()
std::unordered_set< DataObjID, DataObjID_Hasher >
DataObjIDCollProperty::m_pValue
DataObjIDColl * m_pValue
Pointer to the real property.
Definition: DataObjIDProperty.h:124

DataObjIDCollProperty::~DataObjIDCollProperty | ( |  | ) |
| virtual

Definition at line 235 of file DataObjIDProperty.cpp.

236 {}

## Member Function Documentation

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

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

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

clone: "virtual constructor"

Implements Property.

Definition at line 151 of file DataObjIDProperty.h.

152 {
153 return new DataObjIDCollProperty( *this );
154 }
DataObjIDCollProperty::DataObjIDCollProperty
DataObjIDCollProperty(const std::string &name, DataObjIDColl &ref)
Definition: DataObjIDProperty.cpp:227

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()
247 ? StatusCode::SUCCESS
248 : StatusCode::FAILURE;
249 }
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
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
DataObjIDCollProperty::m_pValue
DataObjIDColl * m_pValue
Pointer to the real property.
Definition: DataObjIDProperty.h:124

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

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

bool DataObjIDCollProperty::setValue | ( | const DataObjIDColl & | value | ) |

Definition at line 254 of file DataObjIDProperty.cpp.

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

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

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

value -> string

Implements Property.

Definition at line 263 of file DataObjIDProperty.cpp.

264 {
265 useReadHandler();
266 std::ostringstream o;
267 Gaudi::Utils::toStream(*m_pValue, o);
268 return o.str();
269 }
Property::useReadHandler
virtual void useReadHandler() const
use the call-back function at reading
Definition: Property.cpp:80
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)
DataObjIDCollProperty::m_pValue
DataObjIDColl * m_pValue
Pointer to the real property.
Definition: DataObjIDProperty.h:124

const DataObjIDColl & DataObjIDCollProperty::value | ( |  | ) | const
| inline

Definition at line 172 of file DataObjIDProperty.h.

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

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

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