DataHandleProperty Class Reference

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

Inheritance diagram for DataHandleProperty:
Collaboration diagram for DataHandleProperty:

Public Member Functions

 DataHandleProperty (const std::string &name, Gaudi::DataHandle &ref)
 Constructor with parameters: More...
 
DataHandlePropertyoperator= (const Gaudi::DataHandle &value)
 Assignment operator: More...
 
virtual ~DataHandleProperty ()
 Destructor: More...
 
virtual DataHandlePropertyclone () const
 clone: "virtual constructor" More...
 
virtual bool load (Property &destination) const
 export the property value to the destination More...
 
virtual bool assign (const Property &source)
 import the property value form the source More...
 
virtual std::string toString () const
 value -> string More...
 
virtual void toStream (std::ostream &out) const
 value -> stream More...
 
virtual StatusCode fromString (const std::string &s)
 string -> value More...
 
const Gaudi::DataHandlevalue () const
 
bool setValue (const Gaudi::DataHandle &value)
 
 DataHandleProperty (const std::string &name, Gaudi::DataHandle &ref)
 Constructor with parameters: More...
 
DataHandlePropertyoperator= (const Gaudi::DataHandle &value)
 Assignment operator: More...
 
virtual ~DataHandleProperty ()
 Destructor: More...
 
virtual DataHandlePropertyclone () const
 clone: "virtual constructor" More...
 
virtual bool load (Property &destination) const
 export the property value to the destination More...
 
virtual bool assign (const Property &source)
 import the property value form the source More...
 
virtual std::string toString () const
 value -> string More...
 
virtual void toStream (std::ostream &out) const
 value -> stream More...
 
virtual StatusCode fromString (const std::string &s)
 string -> value More...
 
const Gaudi::DataHandlevalue () const
 
bool setValue (const Gaudi::DataHandle &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

Gaudi::DataHandlem_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 85 of file DataHandle.h.

Constructor & Destructor Documentation

DataHandleProperty::DataHandleProperty ( const std::string &  name,
Gaudi::DataHandle ref 
)

Constructor with parameters:

Definition at line 42 of file DataHandle.cpp.

44  : Property( name, typeid( DataHandle ) ),
45  m_pValue( &ref )
46 {}
const std::string & name() const
property name
Definition: Property.h:45
Gaudi::DataHandle * m_pValue
Pointer to the real property.
Definition: DataHandle.h:117
DataHandleProperty::~DataHandleProperty ( )
virtual

Destructor:

Definition at line 48 of file DataHandle.cpp.

49 {}
DataHandleProperty::DataHandleProperty ( const std::string &  name,
Gaudi::DataHandle ref 
)

Constructor with parameters:

virtual DataHandleProperty::~DataHandleProperty ( )
virtual

Destructor:

Member Function Documentation

bool DataHandleProperty::assign ( const Property source)
inlinevirtual

import the property value form the source

Implements Property.

Definition at line 144 of file DataHandle.h.

145 {
146  return fromString( source.toString() ).isSuccess();
147 }
virtual std::string toString() const =0
value -> string
virtual StatusCode fromString(const std::string &s)
string -> value
Definition: DataHandle.cpp:52
virtual bool DataHandleProperty::assign ( const Property source)
virtual

import the property value form the source

Implements Property.

DataHandleProperty * DataHandleProperty::clone ( ) const
inlinevirtual

clone: "virtual constructor"

Implements Property.

Definition at line 130 of file DataHandle.h.

131 {
132  return new DataHandleProperty( *this );
133 }
DataHandleProperty(const std::string &name, Gaudi::DataHandle &ref)
Constructor with parameters:
Definition: DataHandle.cpp:42
virtual DataHandleProperty* DataHandleProperty::clone ( ) const
virtual

clone: "virtual constructor"

Implements Property.

virtual StatusCode DataHandleProperty::fromString ( const std::string &  value)
virtual

string -> value

Implements Property.

StatusCode DataHandleProperty::fromString ( const std::string &  value)
virtual

string -> value

Implements Property.

Definition at line 52 of file DataHandle.cpp.

53 {
54  if (!Gaudi::Parsers::parse(*m_pValue, s).isSuccess()) {
55  return StatusCode::FAILURE;
56  }
57  return useUpdateHandler()
60 }
StatusCode parse(GaudiUtils::HashMap< K, V > &result, const std::string &input)
Basic parser for the types of HashMap used in DODBasicMapper.
virtual bool useUpdateHandler()
use the call-back function at update
Definition: Property.cpp:92
string s
Definition: gaudirun.py:245
Gaudi::DataHandle * m_pValue
Pointer to the real property.
Definition: DataHandle.h:117
virtual bool DataHandleProperty::load ( Property dest) const
virtual

export the property value to the destination

Implements Property.

bool DataHandleProperty::load ( Property dest) const
inlinevirtual

export the property value to the destination

Implements Property.

Definition at line 137 of file DataHandle.h.

138 {
139  return destination.assign( *this );
140 }
DataHandleProperty & DataHandleProperty::operator= ( const Gaudi::DataHandle value)
inline

Assignment operator:

Definition at line 122 of file DataHandle.h.

123 {
124  setValue( value );
125  return *this;
126 }
bool setValue(const Gaudi::DataHandle &value)
Definition: DataHandle.cpp:63
DataHandleProperty& DataHandleProperty::operator= ( const Gaudi::DataHandle value)

Assignment operator:

bool DataHandleProperty::setValue ( const Gaudi::DataHandle value)

Definition at line 63 of file DataHandle.cpp.

64 {
65  m_pValue->operator=(value);
66  return useUpdateHandler();
67 }
const Gaudi::DataHandle & value() const
Definition: DataHandle.h:151
virtual bool useUpdateHandler()
use the call-back function at update
Definition: Property.cpp:92
Gaudi::DataHandle * m_pValue
Pointer to the real property.
Definition: DataHandle.h:117
bool DataHandleProperty::setValue ( const Gaudi::DataHandle value)
virtual void DataHandleProperty::toStream ( std::ostream &  out) const
virtual

value -> stream

Implements Property.

void DataHandleProperty::toStream ( std::ostream &  out) const
virtual

value -> stream

Implements Property.

Definition at line 79 of file DataHandle.cpp.

80 {
82  out << this->toString();
83 }
virtual void useReadHandler() const
use the call-back function at reading
Definition: Property.cpp:80
virtual std::string toString() const
value -> string
Definition: DataHandle.cpp:70
std::string DataHandleProperty::toString ( ) const
virtual

value -> string

Implements Property.

Definition at line 70 of file DataHandle.cpp.

71 {
73  std::ostringstream o;
75  return o.str();
76 }
virtual void useReadHandler() const
use the call-back function at reading
Definition: Property.cpp:80
std::ostream & toStream(ITERATOR first, ITERATOR last, std::ostream &s, const std::string &open, const std::string &close, const std::string &delim)
the helper function to print the sequence
Definition: ToStream.h:319
Gaudi::DataHandle * m_pValue
Pointer to the real property.
Definition: DataHandle.h:117
virtual std::string DataHandleProperty::toString ( ) const
virtual

value -> string

Implements Property.

const Gaudi::DataHandle & DataHandleProperty::value ( ) const
inline

Definition at line 151 of file DataHandle.h.

152 {
153  useReadHandler();
154  return *m_pValue;
155 }
virtual void useReadHandler() const
use the call-back function at reading
Definition: Property.cpp:80
Gaudi::DataHandle * m_pValue
Pointer to the real property.
Definition: DataHandle.h:117
const Gaudi::DataHandle& DataHandleProperty::value ( ) const

Member Data Documentation

Gaudi::DataHandle * DataHandleProperty::m_pValue
private

Pointer to the real property.

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

Definition at line 117 of file DataHandle.h.


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