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

DataObjectHandleProperty.h GaudiKernel/DataObjectHandleProperty.h. More...

`#include <GaudiKernel/DataObjectHandleProperty.h>`

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

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

DataObjectHandleProperty.h GaudiKernel/DataObjectHandleProperty.h.

Helper class to manage DataObjectHandles and DataObjectHandleColls as properties

Author
  Charles Leggett

Date
  2015-09-01

Definition at line 23 of file DataObjectHandleProperty.h.

## Constructor & Destructor Documentation

DataObjectHandleProperty::DataObjectHandleProperty | ( | const std::string & | name,
|  | DataObjectHandleBase & | ref
| ) |  |

Definition at line 106 of file DataObjectHandleProperty.cpp.

108 : Property( name, typeid( DataObjectHandleBase ) ),
109 m_pValue( &ref )
110 {}
DataObjectHandleProperty::m_pValue
DataObjectHandleBase * m_pValue
Pointer to the real property.
Definition: DataObjectHandleProperty.h:45
Property::Property
Property()
DataObjectHandleBase
DataObjectHandleBase GaudiKernel/DataObjectHandleBase.h.
Definition: DataObjectHandleBase.h:24

DataObjectHandleProperty::~DataObjectHandleProperty | ( |  | ) |
| virtual

Definition at line 114 of file DataObjectHandleProperty.cpp.

115 {}

## Member Function Documentation

bool DataObjectHandleProperty::assign | ( | const Property & | source | ) |
| virtual

import the property value form the source

Implements Property.

Definition at line 194 of file DataObjectHandleProperty.cpp.

195 {
196 return fromString( source.toString() ).isSuccess();
197 }
Property::toString
virtual std::string toString() const =0
value -> string
DataObjectHandleProperty::fromString
virtual StatusCode fromString(const std::string &s)
string -> value
Definition: DataObjectHandleProperty.cpp:120

DataObjectHandleProperty * DataObjectHandleProperty::clone | ( |  | ) | const
| virtual

clone: "virtual constructor"

Implements Property.

Definition at line 178 of file DataObjectHandleProperty.cpp.

179 {
180 return new DataObjectHandleProperty( *this );
181 }
DataObjectHandleProperty::DataObjectHandleProperty
DataObjectHandleProperty(const std::string &name, DataObjectHandleBase &ref)
Definition: DataObjectHandleProperty.cpp:106

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

string -> value

Implements Property.

Definition at line 120 of file DataObjectHandleProperty.cpp.

121 {
122 if (!Gaudi::Parsers::parse(*m_pValue, s).isSuccess()) {
123 return StatusCode::FAILURE;
124 }
125 return useUpdateHandler()
126 ? StatusCode::SUCCESS
127 : StatusCode::FAILURE;
128 }
DataObjectHandleProperty::m_pValue
DataObjectHandleBase * m_pValue
Pointer to the real property.
Definition: DataObjectHandleProperty.h:45
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

bool DataObjectHandleProperty::load | ( | Property & | dest | ) | const
| virtual

export the property value to the destination

Implements Property.

Definition at line 186 of file DataObjectHandleProperty.cpp.

187 {
188 return destination.assign( *this );
189 }

DataObjectHandleProperty & DataObjectHandleProperty::operator= | ( | const DataObjectHandleBase & | value | ) |

Definition at line 169 of file DataObjectHandleProperty.cpp.

170 {
171 setValue( value );
172 return *this;
173 }
DataObjectHandleProperty::setValue
bool setValue(const DataObjectHandleBase &value)
Definition: DataObjectHandleProperty.cpp:141

const std::string DataObjectHandleProperty::pythonRepr | ( |  | ) | const

Definition at line 132 of file DataObjectHandleProperty.cpp.

132 {
133 // std::cerr << "DataObjectHandleProperty::pythonRepr() " << std::endl;
134 return "DataObjectHandleBase(\"" + toString() + "\")";
135 }
DataObjectHandleProperty::toString
virtual std::string toString() const
value -> string
Definition: DataObjectHandleProperty.cpp:150

bool DataObjectHandleProperty::setValue | ( | const DataObjectHandleBase & | value | ) |

Definition at line 141 of file DataObjectHandleProperty.cpp.

142 {
143 m_pValue->operator=(value);
144 return useUpdateHandler();
145 }
DataObjectHandleProperty::m_pValue
DataObjectHandleBase * m_pValue
Pointer to the real property.
Definition: DataObjectHandleProperty.h:45
Property::useUpdateHandler
virtual bool useUpdateHandler()
use the call-back function at update
Definition: Property.cpp:92
DataObjectHandleProperty::value
const DataObjectHandleBase & value() const
Definition: DataObjectHandleProperty.cpp:202

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

value -> stream

Implements Property.

Definition at line 160 of file DataObjectHandleProperty.cpp.

161 {
162 useReadHandler();
163 out << this->toString();
164 }
Property::useReadHandler
virtual void useReadHandler() const
use the call-back function at reading
Definition: Property.cpp:80
DataObjectHandleProperty::toString
virtual std::string toString() const
value -> string
Definition: DataObjectHandleProperty.cpp:150

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

value -> string

Implements Property.

Definition at line 150 of file DataObjectHandleProperty.cpp.

151 {
152 useReadHandler();
153 std::ostringstream o;
154 Gaudi::Utils::toStream(*m_pValue, o);
155 return o.str();
156 }
Property::useReadHandler
virtual void useReadHandler() const
use the call-back function at reading
Definition: Property.cpp:80
DataObjectHandleProperty::m_pValue
DataObjectHandleBase * m_pValue
Pointer to the real property.
Definition: DataObjectHandleProperty.h:45
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 DataObjectHandleBase & DataObjectHandleProperty::value | ( |  | ) | const

Definition at line 202 of file DataObjectHandleProperty.cpp.

203 {
204 useReadHandler();
205 return *m_pValue;
206 }
Property::useReadHandler
virtual void useReadHandler() const
use the call-back function at reading
Definition: Property.cpp:80
DataObjectHandleProperty::m_pValue
DataObjectHandleBase * m_pValue
Pointer to the real property.
Definition: DataObjectHandleProperty.h:45

## Member Data Documentation

DataObjectHandleBase* DataObjectHandleProperty::m_pValue
| private

Pointer to the real property.

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

Definition at line 45 of file DataObjectHandleProperty.h.

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

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