| The Gaudi Framework v32r1 (f65d50dc)

Public Member Functions | Private Attributes | List of all members
PropertyWithHandlers< Handler > Class Template Reference

Helper class to simplify the migration old properties deriving directly from PropertyBase. More...

`#include <GaudiKernel/Property.h>`

Inheritance diagram for PropertyWithHandlers< Handler >:
[legend]
Collaboration diagram for PropertyWithHandlers< Handler >:
[legend]

## Public Member Functions
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 std::string | toString () const =0
| value -> string More...
virtual void | toStream (std::ostream &out) const =0
| value -> stream More...
virtual StatusCode | fromString (const std::string &value)=0
| string -> value 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...
virtual PropertyBase * | clone () const =0
| clones the current property 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
Handler | m_handlers

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

### template<typename Handler = typename Gaudi::Details::Property::UpdateHandler>
class PropertyWithHandlers< Handler >

Helper class to simplify the migration old properties deriving directly from PropertyBase.

Definition at line 806 of file Property.h.

## Member Function Documentation

## ◆ declareReadHandler()

template<typename Handler = typename Gaudi::Details::Property::UpdateHandler>

PropertyBase& PropertyWithHandlers< Handler >::declareReadHandler | ( | std::function< void(PropertyBase &)> | fun | ) |
| inline override

set new callback for reading

Definition at line 813 of file Property.h.

813 {
814 m_handlers.setReadHandler( std::move( fun ) );
815 return *this;
816 }
std::move
T move(T... args)
PropertyWithHandlers::m_handlers
Handler m_handlers
Definition: Property.h:807

## ◆ declareUpdateHandler()

template<typename Handler = typename Gaudi::Details::Property::UpdateHandler>

PropertyBase& PropertyWithHandlers< Handler >::declareUpdateHandler | ( | std::function< void(PropertyBase &)> | fun | ) |
| inline override

set new callback for update

Definition at line 818 of file Property.h.

818 {
819 m_handlers.setUpdateHandler( std::move( fun ) );
820 return *this;
821 }
std::move
T move(T... args)
PropertyWithHandlers::m_handlers
Handler m_handlers
Definition: Property.h:807

## ◆ readCallBack()

template<typename Handler = typename Gaudi::Details::Property::UpdateHandler>

const std::function<void( PropertyBase& )> PropertyWithHandlers< Handler >::readCallBack | ( |  | ) | const
| inline override virtual

get a reference to the readCallBack

Implements Gaudi::Details::PropertyBase.

Definition at line 824 of file Property.h.

824 { return m_handlers.getReadHandler(); }
PropertyWithHandlers::m_handlers
Handler m_handlers
Definition: Property.h:807

## ◆ updateCallBack()

template<typename Handler = typename Gaudi::Details::Property::UpdateHandler>

const std::function<void( PropertyBase& )> PropertyWithHandlers< Handler >::updateCallBack | ( |  | ) | const
| inline override virtual

get a reference to the updateCallBack

Implements Gaudi::Details::PropertyBase.

Definition at line 826 of file Property.h.

826 { return m_handlers.getUpdateHandler(); }
PropertyWithHandlers::m_handlers
Handler m_handlers
Definition: Property.h:807

## ◆ useReadHandler()

template<typename Handler = typename Gaudi::Details::Property::UpdateHandler>

void PropertyWithHandlers< Handler >::useReadHandler | ( |  | ) | const
| inline

use the call-back function at reading, if available

Definition at line 829 of file Property.h.

829 { m_handlers.useReadHandler( *this ); }
PropertyWithHandlers::m_handlers
Handler m_handlers
Definition: Property.h:807

## ◆ useUpdateHandler()

template<typename Handler = typename Gaudi::Details::Property::UpdateHandler>

bool PropertyWithHandlers< Handler >::useUpdateHandler | ( |  | ) |
| inline override virtual

use the call-back function at update, if available

Implements Gaudi::Details::PropertyBase.

Definition at line 832 of file Property.h.

832 {
833 m_handlers.useUpdateHandler( *this );
834 return true;
835 }
PropertyWithHandlers::m_handlers
Handler m_handlers
Definition: Property.h:807

## Member Data Documentation

## ◆ m_handlers

template<typename Handler = typename Gaudi::Details::Property::UpdateHandler>

Handler PropertyWithHandlers< Handler >::m_handlers
| private

Definition at line 807 of file Property.h.

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

- GaudiKernel/GaudiKernel/Property.h