| The Gaudi Framework v32r1 (f65d50dc)

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)
DataObjectHandleProperty * | 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 DataObjectHandleBase & | value () const
bool | setValue (const DataObjectHandleBase &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
DataObjectHandleBase * | 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

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::DataObjectHandleProperty | ( | const std::string & | name,
|  | DataObjectHandleBase & | ref
| ) |  |

Definition at line 26 of file DataObjectHandleProperty.cpp.

27 : PropertyWithHandlers( name, typeid( DataObjectHandleBase ) ), m_pValue( &ref ) {}
DataObjectHandleProperty::m_pValue
DataObjectHandleBase * m_pValue
Pointer to the real property.
Definition: DataObjectHandleProperty.h:41
Gaudi::Details::PropertyBase::name
const std::string name() const
property name
Definition: Property.h:36
PropertyWithHandlers
Helper class to simplify the migration old properties deriving directly from PropertyBase.
Definition: Property.h:806
compareRootHistos.ref
string ref
Definition: compareRootHistos.py:14
DataObjectHandleBase
DataObjectHandleBase GaudiKernel/DataObjectHandleBase.h.
Definition: DataObjectHandleBase.h:26

## Member Function Documentation

## ◆ assign()

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

Definition at line 73 of file DataObjectHandleProperty.cpp.

73 { return fromString( source.toString() ).isSuccess(); }
DataObjectHandleProperty::fromString
StatusCode fromString(const std::string &s) override
string -> value
Definition: DataObjectHandleProperty.cpp:31

## ◆ clone()

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

clones the current property

Implements Gaudi::Details::PropertyBase.

Definition at line 65 of file DataObjectHandleProperty.cpp.

65 { return new DataObjectHandleProperty( *this ); }
DataObjectHandleProperty::DataObjectHandleProperty
DataObjectHandleProperty(const std::string &name, DataObjectHandleBase &ref)
Definition: DataObjectHandleProperty.cpp:26

## ◆ fromString()

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

string -> value

Implements Gaudi::Details::PropertyBase.

Definition at line 31 of file DataObjectHandleProperty.cpp.

31 {
32 if ( !Gaudi::Parsers::parse( *m_pValue, s ).isSuccess() ) { return StatusCode::FAILURE; }
33 return useUpdateHandler() ? StatusCode::SUCCESS : StatusCode::FAILURE;
34 }
DataObjectHandleProperty::m_pValue
DataObjectHandleBase * m_pValue
Pointer to the real property.
Definition: DataObjectHandleProperty.h:41
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
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
PropertyWithHandlers<>::useUpdateHandler
bool useUpdateHandler() override
use the call-back function at update, if available
Definition: Property.h:832
gaudirun.s
string s
Definition: gaudirun.py:316
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86

## ◆ load()

bool DataObjectHandleProperty::load | ( | Property & | destination | ) | const
| override

Definition at line 69 of file DataObjectHandleProperty.cpp.

69 { return destination.assign( *this ); }

## ◆ operator=()

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

Definition at line 58 of file DataObjectHandleProperty.cpp.

58 {
59 setValue( value );
60 return *this;
61 }
DataObjectHandleProperty::setValue
bool setValue(const DataObjectHandleBase &value)
Definition: DataObjectHandleProperty.cpp:38
DataObjectHandleProperty::value
const DataObjectHandleBase & value() const
Definition: DataObjectHandleProperty.cpp:77

## ◆ setValue()

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

Definition at line 38 of file DataObjectHandleProperty.cpp.

38 {
39 *m_pValue = value;
40 return useUpdateHandler();
41 }
DataObjectHandleProperty::m_pValue
DataObjectHandleBase * m_pValue
Pointer to the real property.
Definition: DataObjectHandleProperty.h:41
DataObjectHandleProperty::value
const DataObjectHandleBase & value() const
Definition: DataObjectHandleProperty.cpp:77
PropertyWithHandlers<>::useUpdateHandler
bool useUpdateHandler() override
use the call-back function at update, if available
Definition: Property.h:832

## ◆ toStream()

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

value -> stream

Implements Gaudi::Details::PropertyBase.

Definition at line 51 of file DataObjectHandleProperty.cpp.

51 {
52 // implicitly invokes useReadHandler()
53 out << toString();
54 }
DataObjectHandleProperty::toString
std::string toString() const override
value -> string
Definition: DataObjectHandleProperty.cpp:45

## ◆ toString()

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

value -> string

Implements Gaudi::Details::PropertyBase.

Definition at line 45 of file DataObjectHandleProperty.cpp.

45 {
46 useReadHandler();
47 return m_pValue->toString();
48 }
DataObjectHandleProperty::m_pValue
DataObjectHandleBase * m_pValue
Pointer to the real property.
Definition: DataObjectHandleProperty.h:41
DataObjectHandleBase::toString
std::string toString() const
Definition: DataObjectHandleBase.cpp:109
PropertyWithHandlers<>::useReadHandler
void useReadHandler() const
use the call-back function at reading, if available
Definition: Property.h:829

## ◆ value()

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

Definition at line 77 of file DataObjectHandleProperty.cpp.

77 {
78 useReadHandler();
79 return *m_pValue;
80 }
DataObjectHandleProperty::m_pValue
DataObjectHandleBase * m_pValue
Pointer to the real property.
Definition: DataObjectHandleProperty.h:41
PropertyWithHandlers<>::useReadHandler
void useReadHandler() const
use the call-back function at reading, if available
Definition: Property.h:829

## Member Data Documentation

## ◆ m_pValue

DataObjectHandleBase* DataObjectHandleProperty::m_pValue
| private

Pointer to the real property.

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

Definition at line 41 of file DataObjectHandleProperty.h.

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

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