GaudiHandleProperty Class Reference

#include </tmp/marcocle/lhcb-release/1122/GAUDI/GAUDI_v27r0/InstallArea/x86_64-slc6-gcc49-opt/include/GaudiKernel/Property.h>

Inheritance diagram for GaudiHandleProperty:
Collaboration diagram for GaudiHandleProperty:

Public Member Functions

 GaudiHandleProperty (std::string name, GaudiHandleBase &ref)
 
GaudiHandlePropertyoperator= (const GaudiHandleBase &value)
 
GaudiHandlePropertyclone () 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 GaudiHandleBasevalue () const
 
bool setValue (const GaudiHandleBase &value)
 
 GaudiHandleProperty (std::string name, GaudiHandleBase &ref)
 
GaudiHandlePropertyoperator= (const GaudiHandleBase &value)
 
GaudiHandlePropertyclone () 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 GaudiHandleBasevalue () 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 PropertydeclareReadHandler (std::function< void(Property &)> fun)
 set new callback for reading More...
 
virtual PropertydeclareUpdateHandler (std::function< void(Property &)> fun)
 set new callback for update More...
 
template<class HT >
PropertydeclareReadHandler (void(HT::*MF)(Property &), HT *instance)
 
template<class HT >
PropertydeclareUpdateHandler (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...
 
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 PropertydeclareReadHandler (std::function< void(Property &)> fun)
 set new callback for reading More...
 
virtual PropertydeclareUpdateHandler (std::function< void(Property &)> fun)
 set new callback for update More...
 
template<class HT >
PropertydeclareReadHandler (void(HT::*MF)(Property &), HT *instance)
 
template<class HT >
PropertydeclareUpdateHandler (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

GaudiHandleBasem_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...
 
Propertyoperator= (const Property &)=default
 assignment operator More...
 
 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...
 
Propertyoperator= (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 {
174 }
const std::string & name() const
property name
Definition: Property.h:45
void setPropertyName(std::string propName)
set name as used in declareProperty(name,gaudiHandle).
Definition: GaudiHandle.h:44
GaudiHandleBase * m_pValue
Pointer to the real property.
Definition: Property.h:808
Base class to handles to be used in lieu of naked pointers to various Gaudi components.
Definition: GaudiHandle.h:93
GaudiHandleProperty::GaudiHandleProperty ( std::string  name,
GaudiHandleBase ref 
)

Member Function Documentation

bool GaudiHandleProperty::assign ( const Property source)
inlineoverridevirtual

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 }
virtual std::string toString() const =0
value -> string
StatusCode fromString(const std::string &s) override
string -> value
Definition: Property.cpp:191
bool GaudiHandleProperty::assign ( const Property source)
overridevirtual

import the property value form the source

Implements Property.

GaudiHandleProperty * GaudiHandleProperty::clone ( ) const
inlineoverridevirtual

clone: "virtual constructor"

Implements Property.

Definition at line 820 of file Property.h.

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

clone: "virtual constructor"

Implements Property.

StatusCode GaudiHandleProperty::fromString ( const std::string &  value)
overridevirtual

string -> value

Implements Property.

StatusCode GaudiHandleProperty::fromString ( const std::string &  value)
overridevirtual

string -> value

Implements Property.

Definition at line 191 of file Property.cpp.

191  {
194 }
void setTypeAndName(std::string myTypeAndName)
The component "type/name" string.
Definition: GaudiHandle.cpp:9
virtual bool useUpdateHandler()
use the call-back function at update
Definition: Property.cpp:92
string s
Definition: gaudirun.py:245
GaudiHandleBase * m_pValue
Pointer to the real property.
Definition: Property.h:808
bool GaudiHandleProperty::load ( Property dest) const
overridevirtual

export the property value to the destination

Implements Property.

bool GaudiHandleProperty::load ( Property dest) const
inlineoverridevirtual

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 }
bool setValue(const GaudiHandleBase &value)
Definition: Property.cpp:176
GaudiHandleProperty& GaudiHandleProperty::operator= ( const GaudiHandleBase value)
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 }
void setTypeAndName(std::string myTypeAndName)
The component "type/name" string.
Definition: GaudiHandle.cpp:9
virtual bool useUpdateHandler()
use the call-back function at update
Definition: Property.cpp:92
GaudiHandleBase * m_pValue
Pointer to the real property.
Definition: Property.h:808
std::string typeAndName() const
The full type and name: "type/name".
Definition: GaudiHandle.h:120
bool GaudiHandleProperty::setValue ( const GaudiHandleBase value)
void GaudiHandleProperty::toStream ( std::ostream &  out) const
overridevirtual

value -> stream

Implements Property.

void GaudiHandleProperty::toStream ( std::ostream &  out) const
overridevirtual

value -> stream

Implements Property.

Definition at line 186 of file Property.cpp.

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

value -> string

Implements Property.

Definition at line 181 of file Property.cpp.

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

value -> string

Implements Property.

const GaudiHandleBase & GaudiHandleProperty::value ( ) const
inline

Definition at line 832 of file Property.h.

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

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: