| The Gaudi Framework v32r1 (f65d50dc)

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

`#include <GaudiKernel/Property.h>`

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

## Public Member Functions
| GaudiHandleProperty (std::string name, GaudiHandleBase &ref)
GaudiHandleProperty & | operator= (const GaudiHandleBase &value)
GaudiHandleProperty * | clone () const override
| clones the current property More...
bool | load (PropertyBase &destination) const override
bool | assign (const PropertyBase &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 GaudiHandleBase & | value () const
bool | setValue (const GaudiHandleBase &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
GaudiHandleBase * | 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

Definition at line 845 of file Property.h.

## Constructor & Destructor Documentation

## ◆ GaudiHandleProperty()

GaudiHandleProperty::GaudiHandleProperty | ( | std::string | name,
|  | GaudiHandleBase & | ref
| ) |  |

Definition at line 103 of file Property.cpp.

104 : PropertyWithHandlers( std::move( name_ ), typeid( GaudiHandleBase ) ), m_pValue( &ref ) {
105 m_pValue->setPropertyName( name() );
106 }
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
GaudiHandleProperty::m_pValue
GaudiHandleBase * m_pValue
Pointer to the real property.
Definition: Property.h:876
std::move
T move(T... args)
GaudiHandleInfo::setPropertyName
void setPropertyName(std::string propName)
set name as used in declareProperty(name,gaudiHandle).
Definition: GaudiHandle.h:50
GaudiHandleBase
Base class to handles to be used in lieu of naked pointers to various Gaudi components.
Definition: GaudiHandle.h:89

## Member Function Documentation

## ◆ assign()

bool GaudiHandleProperty::assign | ( | const PropertyBase & | source | ) |
| inline override

Definition at line 858 of file Property.h.

858 { return fromString( source.toString() ).isSuccess(); }
GaudiHandleProperty::fromString
StatusCode fromString(const std::string &s) override
string -> value
Definition: Property.cpp:123

## ◆ clone()

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

clones the current property

Implements Gaudi::Details::PropertyBase.

Definition at line 854 of file Property.h.

854 { return new GaudiHandleProperty( *this ); }
GaudiHandleProperty::GaudiHandleProperty
GaudiHandleProperty(std::string name, GaudiHandleBase &ref)
Definition: Property.cpp:103

## ◆ fromString()

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

string -> value

Implements Gaudi::Details::PropertyBase.

Definition at line 123 of file Property.cpp.

123 {
124 m_pValue->setTypeAndName( s );
125 useUpdateHandler();
126 return StatusCode::SUCCESS;
127 }
GaudiHandleBase::setTypeAndName
void setTypeAndName(std::string myTypeAndName)
The component "type/name" string.
Definition: GaudiHandle.cpp:9
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
GaudiHandleProperty::m_pValue
GaudiHandleBase * m_pValue
Pointer to the real property.
Definition: Property.h:876
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

## ◆ load()

bool GaudiHandleProperty::load | ( | PropertyBase & | destination | ) | const
| inline override

Definition at line 856 of file Property.h.

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

## ◆ operator=()

GaudiHandleProperty& GaudiHandleProperty::operator= | ( | const GaudiHandleBase & | value | ) |
| inline

Definition at line 849 of file Property.h.

849 {
850 setValue( value );
851 return *this;
852 }
GaudiHandleProperty::value
const GaudiHandleBase & value() const
Definition: Property.h:866
GaudiHandleProperty::setValue
bool setValue(const GaudiHandleBase &value)
Definition: Property.cpp:108

## ◆ setValue()

bool GaudiHandleProperty::setValue | ( | const GaudiHandleBase & | value | ) |

Definition at line 108 of file Property.cpp.

108 {
109 m_pValue->setTypeAndName( value.typeAndName() );
110 return useUpdateHandler();
111 }
GaudiHandleBase::setTypeAndName
void setTypeAndName(std::string myTypeAndName)
The component "type/name" string.
Definition: GaudiHandle.cpp:9
GaudiHandleBase::typeAndName
std::string typeAndName() const
The full type and name: "type/name".
Definition: GaudiHandle.h:115
GaudiHandleProperty::m_pValue
GaudiHandleBase * m_pValue
Pointer to the real property.
Definition: Property.h:876
PropertyWithHandlers<>::useUpdateHandler
bool useUpdateHandler() override
use the call-back function at update, if available
Definition: Property.h:832
GaudiHandleProperty::value
const GaudiHandleBase & value() const
Definition: Property.h:866

## ◆ toStream()

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

value -> stream

Implements Gaudi::Details::PropertyBase.

Definition at line 118 of file Property.cpp.

118 {
119 useReadHandler();
120 out << m_pValue->typeAndName();
121 }
GaudiHandleBase::typeAndName
std::string typeAndName() const
The full type and name: "type/name".
Definition: GaudiHandle.h:115
GaudiHandleProperty::m_pValue
GaudiHandleBase * m_pValue
Pointer to the real property.
Definition: Property.h:876
PropertyWithHandlers<>::useReadHandler
void useReadHandler() const
use the call-back function at reading, if available
Definition: Property.h:829

## ◆ toString()

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

value -> string

Implements Gaudi::Details::PropertyBase.

Definition at line 113 of file Property.cpp.

113 {
114 useReadHandler();
115 return m_pValue->typeAndName();
116 }
GaudiHandleBase::typeAndName
std::string typeAndName() const
The full type and name: "type/name".
Definition: GaudiHandle.h:115
GaudiHandleProperty::m_pValue
GaudiHandleBase * m_pValue
Pointer to the real property.
Definition: Property.h:876
PropertyWithHandlers<>::useReadHandler
void useReadHandler() const
use the call-back function at reading, if available
Definition: Property.h:829

## ◆ value()

const GaudiHandleBase& GaudiHandleProperty::value | ( |  | ) | const
| inline

Definition at line 866 of file Property.h.

866 {
867 useReadHandler();
868 return *m_pValue;
869 }
GaudiHandleProperty::m_pValue
GaudiHandleBase * m_pValue
Pointer to the real property.
Definition: Property.h:876
PropertyWithHandlers<>::useReadHandler
void useReadHandler() const
use the call-back function at reading, if available
Definition: Property.h:829

## Member Data Documentation

## ◆ m_pValue

GaudiHandleBase* GaudiHandleProperty::m_pValue
| private

Pointer to the real property.

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

Definition at line 876 of file Property.h.

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

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