PropertyWithHandlers Class Reference

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

#include <GaudiKernel/Property.h>

Inheritance diagram for PropertyWithHandlers:
Collaboration diagram for PropertyWithHandlers:

Public Member Functions

PropertyBasedeclareReadHandler (std::function< void(PropertyBase &)> fun) override
 set new callback for reading More...
 
PropertyBasedeclareUpdateHandler (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_infotype_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 PropertyBasedeclareReadHandler (std::function< void(PropertyBase &)> fun)=0
 set new callback for reading More...
 
virtual PropertyBasedeclareUpdateHandler (std::function< void(PropertyBase &)> fun)=0
 set new callback for update More...
 
template<class HT >
PropertyBasedeclareReadHandler (void(HT::*MF)(PropertyBase &), HT *instance)
 
template<class HT >
PropertyBasedeclareUpdateHandler (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::ostreamfillStream (std::ostream &) const
 the printout of the property value More...
 
virtual PropertyBaseclone () 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_infoownerType () 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

Gaudi::Details::Property::ReadUpdateHandler 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...
 
PropertyBaseoperator= (const PropertyBase &)=default
 assignment operator More...
 

Detailed Description

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

Definition at line 738 of file Property.h.

Member Function Documentation

PropertyBase& PropertyWithHandlers::declareReadHandler ( std::function< void(PropertyBase &)>  fun)
inlineoverride

set new callback for reading

Definition at line 746 of file Property.h.

747  {
749  return *this;
750  }
Gaudi::Details::Property::ReadUpdateHandler m_handlers
Definition: Property.h:740
T move(T...args)
void setReadHandler(std::function< void(PropertyBase &)> fun)
Definition: Property.h:273
PropertyBase& PropertyWithHandlers::declareUpdateHandler ( std::function< void(PropertyBase &)>  fun)
inlineoverride

set new callback for update

Definition at line 752 of file Property.h.

753  {
755  return *this;
756  }
Gaudi::Details::Property::ReadUpdateHandler m_handlers
Definition: Property.h:740
T move(T...args)
void setUpdateHandler(std::function< void(PropertyBase &)> fun)
Definition: Property.h:288
const std::function<void( PropertyBase& )> PropertyWithHandlers::readCallBack ( ) const
inlineoverridevirtual

get a reference to the readCallBack

Implements Gaudi::Details::PropertyBase.

Definition at line 759 of file Property.h.

759 { return m_handlers.getReadHandler(); }
Gaudi::Details::Property::ReadUpdateHandler m_handlers
Definition: Property.h:740
std::function< void(PropertyBase &)> getReadHandler() const
Definition: Property.h:274
const std::function<void( PropertyBase& )> PropertyWithHandlers::updateCallBack ( ) const
inlineoverridevirtual

get a reference to the updateCallBack

Implements Gaudi::Details::PropertyBase.

Definition at line 761 of file Property.h.

761 { return m_handlers.getUpdateHandler(); }
Gaudi::Details::Property::ReadUpdateHandler m_handlers
Definition: Property.h:740
std::function< void(PropertyBase &)> getUpdateHandler() const
Definition: Property.h:289
void PropertyWithHandlers::useReadHandler ( ) const
inline

use the call-back function at reading, if available

Definition at line 764 of file Property.h.

764 { m_handlers.useReadHandler( *this ); }
Gaudi::Details::Property::ReadUpdateHandler m_handlers
Definition: Property.h:740
void useReadHandler(const PropertyBase &p) const
Definition: Property.h:267
bool PropertyWithHandlers::useUpdateHandler ( )
inlineoverridevirtual

use the call-back function at update, if available

Implements Gaudi::Details::PropertyBase.

Definition at line 767 of file Property.h.

768  {
769  m_handlers.useUpdateHandler( *this );
770  return true;
771  }
Gaudi::Details::Property::ReadUpdateHandler m_handlers
Definition: Property.h:740
void useUpdateHandler(PropertyBase &p)
Definition: Property.h:278

Member Data Documentation

Gaudi::Details::Property::ReadUpdateHandler PropertyWithHandlers::m_handlers
private

Definition at line 740 of file Property.h.


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