| 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
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
| clone: "virtual constructor" More...
bool | load (Property &destination) const override
| export the property value to the destination More...
bool | assign (const Property &source) override
| import the property value form the source More...
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 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
GaudiHandleBase * | 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 783 of file Property.h.

## Constructor & Destructor Documentation

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

Definition at line 170 of file Property.cpp.

171 : Property( std::move(name_), typeid( GaudiHandleBase ) ), m_pValue( &ref )
172 {
173 m_pValue->setPropertyName( name() );
174 }
Property::name
const std::string & name() const
property name
Definition: Property.h:45
GaudiHandleProperty::m_pValue
GaudiHandleBase * m_pValue
Pointer to the real property.
Definition: Property.h:808
Property::Property
Property()
std::move
T move(T...args)
GaudiHandleInfo::setPropertyName
void setPropertyName(std::string propName)
set name as used in declareProperty(name,gaudiHandle).
Definition: GaudiHandle.h:44
GaudiHandleBase
Base class to handles to be used in lieu of naked pointers to various Gaudi components.
Definition: GaudiHandle.h:93

## Member Function Documentation

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

import the property value form the source

Implements Property.

Definition at line 828 of file Property.h.

828 {
829 return fromString( source.toString() ).isSuccess();
830 }
Property::toString
virtual std::string toString() const =0
value -> string
GaudiHandleProperty::fromString
StatusCode fromString(const std::string &s) override
string -> value
Definition: Property.cpp:191

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

clone: "virtual constructor"

Implements Property.

Definition at line 820 of file Property.h.

820 {
821 return new GaudiHandleProperty( *this );
822 }
GaudiHandleProperty::GaudiHandleProperty
GaudiHandleProperty(std::string name, GaudiHandleBase &ref)
Definition: Property.cpp:170

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

string -> value

Implements Property.

Definition at line 191 of file Property.cpp.

191 {
192 m_pValue->setTypeAndName( s );
193 return useUpdateHandler()?StatusCode::SUCCESS:StatusCode::FAILURE;
194 }
GaudiHandleBase::setTypeAndName
void setTypeAndName(std::string myTypeAndName)
The component "type/name" string.
Definition: GaudiHandle.cpp:9
GaudiHandleProperty::m_pValue
GaudiHandleBase * m_pValue
Pointer to the real property.
Definition: Property.h:808
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 GaudiHandleProperty::load | ( | Property & | dest | ) | const
| inline override virtual

export the property value to the destination

Implements Property.

Definition at line 824 of file Property.h.

824 {
825 return destination.assign( *this );
826 }

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

Definition at line 815 of file Property.h.

815 {
816 setValue( value );
817 return *this;
818 }
GaudiHandleProperty::setValue
bool setValue(const GaudiHandleBase &value)
Definition: Property.cpp:176

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

Definition at line 176 of file Property.cpp.

176 {
177 m_pValue->setTypeAndName( value.typeAndName() );
178 return useUpdateHandler();
179 }
GaudiHandleBase::setTypeAndName
void setTypeAndName(std::string myTypeAndName)
The component "type/name" string.
Definition: GaudiHandle.cpp:9
GaudiHandleProperty::m_pValue
GaudiHandleBase * m_pValue
Pointer to the real property.
Definition: Property.h:808
Property::useUpdateHandler
virtual bool useUpdateHandler()
use the call-back function at update
Definition: Property.cpp:92
GaudiHandleBase::typeAndName
std::string typeAndName() const
The full type and name: "type/name".
Definition: GaudiHandle.h:120

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

value -> stream

Implements Property.

Definition at line 186 of file Property.cpp.

186 {
187 useReadHandler();
188 out << m_pValue->typeAndName();
189 }
Property::useReadHandler
virtual void useReadHandler() const
use the call-back function at reading
Definition: Property.cpp:80
GaudiHandleProperty::m_pValue
GaudiHandleBase * m_pValue
Pointer to the real property.
Definition: Property.h:808
GaudiHandleBase::typeAndName
std::string typeAndName() const
The full type and name: "type/name".
Definition: GaudiHandle.h:120

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

value -> string

Implements Property.

Definition at line 181 of file Property.cpp.

181 {
182 useReadHandler();
183 return m_pValue->typeAndName();
184 }
Property::useReadHandler
virtual void useReadHandler() const
use the call-back function at reading
Definition: Property.cpp:80
GaudiHandleProperty::m_pValue
GaudiHandleBase * m_pValue
Pointer to the real property.
Definition: Property.h:808
GaudiHandleBase::typeAndName
std::string typeAndName() const
The full type and name: "type/name".
Definition: GaudiHandle.h:120

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

Definition at line 832 of file Property.h.

832 {
833 useReadHandler();
834 return *m_pValue;
835 }
Property::useReadHandler
virtual void useReadHandler() const
use the call-back function at reading
Definition: Property.cpp:80
GaudiHandleProperty::m_pValue
GaudiHandleBase * m_pValue
Pointer to the real property.
Definition: Property.h:808

## Member Data Documentation

GaudiHandleBase* GaudiHandleProperty::m_pValue
| private

Pointer to the real property.

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

Definition at line 808 of file Property.h.

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

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