The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
PropertyWithHandlers< Handler > Class Template Reference

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

#include </builds/gaudi/Gaudi/GaudiKernel/include/Gaudi/Property.h>

Inheritance diagram for PropertyWithHandlers< Handler >:
Collaboration diagram for PropertyWithHandlers< Handler >:

Public Member Functions

PropertyBasedeclareReadHandler (std::function< void(PropertyBase &)> fun) override
 set new callback for reading
 
PropertyBasedeclareUpdateHandler (std::function< void(PropertyBase &)> fun) override
 set new callback for update
 
const std::function< void(PropertyBase &)> readCallBack () const override
 get a reference to the readCallBack
 
const std::function< void(PropertyBase &)> updateCallBack () const override
 get a reference to the updateCallBack
 
void useReadHandler () const
 use the call-back function at reading, if available
 
bool useUpdateHandler () override
 use the call-back function at update, if available
 
- Public Member Functions inherited from Gaudi::Details::PropertyBase
const std::string name () const
 property name
 
std::string documentation () const
 property documentation
 
std::string semantics () const
 property semantics
 
const std::type_info * type_info () const
 property type-info
 
std::string type () const
 property type
 
virtual bool load (PropertyBase &dest) const =0
 export the property value to the destination
 
virtual bool assign (const PropertyBase &source)=0
 import the property value form the source
 
virtual std::string toString () const =0
 value -> string
 
virtual void toStream (std::ostream &out) const =0
 value -> stream
 
virtual StatusCode fromString (const std::string &value)=0
 string -> value
 
virtual PropertyBasedeclareReadHandler (std::function< void(PropertyBase &)> fun)=0
 set new callback for reading
 
virtual PropertyBasedeclareUpdateHandler (std::function< void(PropertyBase &)> fun)=0
 set new callback for update
 
template<class HT>
PropertyBasedeclareReadHandler (void(HT::*MF)(PropertyBase &), HT *instance)
 
template<class HT>
PropertyBasedeclareUpdateHandler (void(HT::*MF)(PropertyBase &), HT *instance)
 
virtual ~PropertyBase ()
 virtual destructor
 
void setName (std::string value)
 set the new value for the property name
 
void setDocumentation (std::string value)
 set the documentation string
 
void setSemantics (std::string value)
 set the semantics string
 
virtual std::ostream & fillStream (std::ostream &) const
 the printout of the property value
 
virtual PropertyBaseclone () const =0
 clones the current property
 
void setOwnerType (const std::type_info &ownerType)
 set the type of the owner class (used for documentation)
 
template<class OWNER>
void setOwnerType ()
 set the type of the owner class (used for documentation)
 
const std::type_info * ownerType () const
 get the type of the owner class (used for documentation)
 
std::string ownerTypeName () const
 get the string for the type of the owner class (used for documentation)
 

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="", std::string semantics="")
 constructor from the property name and the type
 
 PropertyBase (std::string name, const std::type_info &type)
 constructor from the property name and the type
 
 PropertyBase (const PropertyBase &)=default
 copy constructor
 
PropertyBaseoperator= (const PropertyBase &)=default
 assignment operator
 

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 530 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)
inlineoverride

set new callback for reading

Definition at line 537 of file Property.h.

537 {
538 m_handlers.setReadHandler( std::move( fun ) );
539 return *this;
540 }
Helper class to simplify the migration old properties deriving directly from PropertyBase.
Definition Property.h:530

◆ declareUpdateHandler()

template<typename Handler = typename Gaudi::Details::Property::UpdateHandler>
PropertyBase & PropertyWithHandlers< Handler >::declareUpdateHandler ( std::function< void(PropertyBase &)> fun)
inlineoverride

set new callback for update

Definition at line 542 of file Property.h.

542 {
543 m_handlers.setUpdateHandler( std::move( fun ) );
544 return *this;
545 }

◆ readCallBack()

template<typename Handler = typename Gaudi::Details::Property::UpdateHandler>
const std::function< void(PropertyBase &)> PropertyWithHandlers< Handler >::readCallBack ( ) const
inlineoverridevirtual

get a reference to the readCallBack

Implements Gaudi::Details::PropertyBase.

Definition at line 548 of file Property.h.

548{ return m_handlers.getReadHandler(); }

◆ updateCallBack()

template<typename Handler = typename Gaudi::Details::Property::UpdateHandler>
const std::function< void(PropertyBase &)> PropertyWithHandlers< Handler >::updateCallBack ( ) const
inlineoverridevirtual

get a reference to the updateCallBack

Implements Gaudi::Details::PropertyBase.

Definition at line 550 of file Property.h.

550{ return m_handlers.getUpdateHandler(); }

◆ 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 553 of file Property.h.

553{ m_handlers.useReadHandler( *this ); }

◆ useUpdateHandler()

template<typename Handler = typename Gaudi::Details::Property::UpdateHandler>
bool PropertyWithHandlers< Handler >::useUpdateHandler ( )
inlineoverridevirtual

use the call-back function at update, if available

Implements Gaudi::Details::PropertyBase.

Definition at line 556 of file Property.h.

556 {
557 m_handlers.useUpdateHandler( *this );
558 return true;
559 }

Member Data Documentation

◆ m_handlers

template<typename Handler = typename Gaudi::Details::Property::UpdateHandler>
Handler PropertyWithHandlers< Handler >::m_handlers
private

Definition at line 531 of file Property.h.


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