| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
Property Class Referenceabstract

Property base class allowing Property* collections to be "homogeneous". More...

`#include <GaudiKernel/Property.h>`

Inheritance diagram for Property:
[legend]
Collaboration diagram for Property:
[legend]

## Public Member Functions
const std::string & | name () const
| property name
const std::string & | documentation () const
| property documentation
const std::type_info * | type_info () const
| property type-info
std::string | type () const
| property type
virtual bool | load (Property &dest) const =0
| export the property value to the destination
virtual bool | assign (const Property &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
const PropertyCallbackFunctor * | readCallBack () const
| Call-back functor at reading: the functor is owned by property!
const PropertyCallbackFunctor * | updateCallBack () const
| Call-back functor for update: the functor is owned by property!
virtual void | declareReadHandler (PropertyCallbackFunctor *pf)
| set new callback for reading
virtual void | declareUpdateHandler (PropertyCallbackFunctor *pf)
| set new callback for update
template<class HT >
void | declareReadHandler (void(HT::*MF)(Property &), HT *instance)
template<class HT >
void | declareUpdateHandler (void(HT::*MF)(Property &), HT *instance)
virtual void | useReadHandler () const
| use the call-back function at reading
virtual bool | useUpdateHandler ()
| use the call-back function at update
virtual | ~Property ()
| virtual destructor
virtual Property * | clone () const =0
| clone: "virtual constructor"
void | setName (const std::string &value)
| set the new value for the property name
void | setDocumentation (const std::string &documentation)
| set the documentation string
virtual std::ostream & | fillStream (std::ostream &) const
| the printout of the property value

## Protected Member Functions
| Property (const std::type_info &type, const std::string &name="")
| constructor from the property name and the type
| Property (const std::string &name, const std::type_info &type)
| constructor from the property name and the type
| Property (const Property &right)
| copy constructor
Property & | operator= (const Property &right)
| assignment operator

## Protected Attributes
PropertyCallbackFunctor * | m_readCallBack
PropertyCallbackFunctor * | m_updateCallBack

## Private Member Functions
| Property ()

## Private Attributes
std::string | m_name
std::string | m_documentation
const std::type_info * | m_typeinfo

## Detailed Description

Property base class allowing Property* collections to be "homogeneous".

Author
  Paul Maley
  CTDay
  Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u

Definition at line 43 of file Property.h.

## Constructor & Destructor Documentation

Property::~Property | ( |  | ) |
| virtual

virtual destructor

Definition at line 112 of file Property.cpp.

{
if ( 0 != m_readCallBack )
{ delete m_readCallBack ; m_readCallBack = 0 ; }
if ( 0 != m_updateCallBack )
{ delete m_updateCallBack ; m_updateCallBack = 0 ; }
}

Property::Property | ( | const std::type_info & | type,
|  | const std::string & | name = `""`
| ) |  |
| protected

constructor from the property name and the type

Definition at line 48 of file Property.cpp.

: m_name ( name )
, m_documentation ( name )
, m_typeinfo ( &type )
, m_readCallBack ( 0 )
, m_updateCallBack ( 0 )
{}

Property::Property | ( | const std::string & | name,
|  | const std::type_info & | type
| ) |  |
| protected

constructor from the property name and the type

Definition at line 63 of file Property.cpp.

: m_name ( name )
, m_documentation ( name )
, m_typeinfo ( &type )
, m_readCallBack ( 0 )
, m_updateCallBack ( 0 )
{}

Property::Property | ( | const Property & | right | ) |
| protected

copy constructor

Definition at line 75 of file Property.cpp.

: m_name ( right.m_name )
, m_documentation ( right.m_documentation )
, m_typeinfo ( right.m_typeinfo )
, m_readCallBack ( 0 )
, m_updateCallBack ( 0 )
{
if ( 0 != right.m_readCallBack )
{ m_readCallBack = right.m_readCallBack -> clone () ; }
if ( 0 != right.m_updateCallBack )
{ m_updateCallBack = right.m_updateCallBack -> clone () ; }
}

Property::Property | ( |  | ) |
| private

## Member Function Documentation

virtual bool Property::assign | ( | const Property & | source | ) |
| pure virtual

import the property value form the source

Implemented in GaudiHandleArrayProperty, GaudiHandleProperty, PropertyWithValue< TYPE >, PropertyWithValue< double >, PropertyWithValue< std::string >, PropertyWithValue< std::vector< std::string > >, PropertyWithValue< int >, PropertyWithValue< unsigned int >, PropertyWithValue< bool >, and PropertyList.

virtual Property* Property::clone | ( |  | ) | const
| pure virtual

clone: "virtual constructor"

Implemented in GaudiHandleArrayProperty, GaudiHandleProperty, SimplePropertyRef< TYPE, VERIFIER >, SimpleProperty< TYPE, VERIFIER >, SimpleProperty< double >, SimpleProperty< std::string >, SimpleProperty< std::vector< std::string > >, SimpleProperty< int >, SimpleProperty< unsigned int >, and SimpleProperty< bool >.

void Property::declareReadHandler | ( | PropertyCallbackFunctor * | pf | ) |
| virtual

set new callback for reading

Definition at line 132 of file Property.cpp.

{
if ( 0 != m_readCallBack )
{ delete m_readCallBack ; m_readCallBack = 0 ; }
m_readCallBack = pf ;
}
template<class HT >

void Property::declareReadHandler | ( | void(HT::*)(Property &) | MF,
|  | HT * | instance
| ) |  |
| inline

Definition at line 130 of file Property.h.

{ declareReadHandler ( new PropertyCallbackMemberFunctor< HT >( MF , obj ) ) ; }

void Property::declareUpdateHandler | ( | PropertyCallbackFunctor * | pf | ) |
| virtual

set new callback for update

Definition at line 141 of file Property.cpp.

{
if ( 0 != m_updateCallBack )
{ delete m_updateCallBack ; m_updateCallBack = 0 ; }
m_updateCallBack = pf ;
}
template<class HT >

void Property::declareUpdateHandler | ( | void(HT::*)(Property &) | MF,
|  | HT * | instance
| ) |  |
| inline

Definition at line 135 of file Property.h.

{ declareUpdateHandler ( new PropertyCallbackMemberFunctor< HT >( MF , obj ) ) ; }

const std::string& Property::documentation | ( |  | ) | const
| inline

property documentation

Definition at line 49 of file Property.h.

{ return m_documentation; }

std::ostream & Property::fillStream | ( | std::ostream & | stream | ) | const
| virtual

the printout of the property value

Definition at line 182 of file Property.cpp.

{ return stream << " '" <<name() << "':" << toString() ; }

virtual StatusCode Property::fromString | ( | const std::string & | value | ) |
| pure virtual

string -> value

Implemented in GaudiHandleArrayProperty, GaudiHandleProperty, PropertyWithValue< TYPE >, PropertyWithValue< double >, PropertyWithValue< std::string >, PropertyWithValue< std::vector< std::string > >, PropertyWithValue< int >, PropertyWithValue< unsigned int >, and PropertyWithValue< bool >.

virtual bool Property::load | ( | Property & | dest | ) | const
| pure virtual

export the property value to the destination

Implemented in GaudiHandleArrayProperty, GaudiHandleProperty, PropertyWithValue< TYPE >, PropertyWithValue< double >, PropertyWithValue< std::string >, PropertyWithValue< std::vector< std::string > >, PropertyWithValue< int >, PropertyWithValue< unsigned int >, PropertyWithValue< bool >, and PropertyList.

const std::string& Property::name | ( |  | ) | const
| inline

property name

Definition at line 47 of file Property.h.

{ return m_name ; }

Property & Property::operator= | ( | const Property & | right | ) |
| protected

assignment operator

Definition at line 90 of file Property.cpp.

{
if ( &right == this ) { return *this ; }
//
m_name = right.m_name ;
m_documentation = right.m_documentation ;
m_typeinfo = right.m_typeinfo ;
//
if ( 0 != m_readCallBack )
{ delete m_readCallBack ; m_readCallBack = 0 ; }
if ( 0 != m_updateCallBack )
{ delete m_updateCallBack ; m_updateCallBack = 0 ; }
if ( 0 != right.m_readCallBack )
{ m_readCallBack = right.m_readCallBack -> clone () ; }
if ( 0 != right.m_updateCallBack )
{ m_updateCallBack = right.m_updateCallBack -> clone () ; }
//
return *this ;
}

const PropertyCallbackFunctor * Property::readCallBack | ( |  | ) | const

Call-back functor at reading: the functor is owned by property!

Definition at line 122 of file Property.cpp.

{ return m_readCallBack ; }

void Property::setDocumentation | ( | const std::string & | documentation | ) |
| inline

set the documentation string

Definition at line 92 of file Property.h.

{
m_documentation = documentation; }

void Property::setName | ( | const std::string & | value | ) |
| inline

set the new value for the property name

Definition at line 90 of file Property.h.

{ m_name = value ; }

virtual void Property::toStream | ( | std::ostream & | out | ) | const
| pure virtual

value -> stream

Implemented in GaudiHandleArrayProperty, GaudiHandleProperty, PropertyWithValue< TYPE >, PropertyWithValue< double >, PropertyWithValue< std::string >, PropertyWithValue< std::vector< std::string > >, PropertyWithValue< int >, PropertyWithValue< unsigned int >, and PropertyWithValue< bool >.

virtual std::string Property::toString | ( |  | ) | const
| pure virtual

value -> string

Implemented in GaudiHandleArrayProperty, GaudiHandleProperty, PropertyWithValue< TYPE >, PropertyWithValue< double >, PropertyWithValue< std::string >, PropertyWithValue< std::vector< std::string > >, PropertyWithValue< int >, PropertyWithValue< unsigned int >, and PropertyWithValue< bool >.

std::string Property::type | ( |  | ) | const
| inline

property type

Definition at line 53 of file Property.h.

{ return m_typeinfo->name() ; }

const std::type_info* Property::type_info | ( |  | ) | const
| inline

property type-info

Definition at line 51 of file Property.h.

{ return m_typeinfo ; }

const PropertyCallbackFunctor * Property::updateCallBack | ( |  | ) | const

Call-back functor for update: the functor is owned by property!

Definition at line 127 of file Property.cpp.

{ return m_updateCallBack ; }

void Property::useReadHandler | ( |  | ) | const
| virtual

use the call-back function at reading

Definition at line 150 of file Property.cpp.

{
if ( 0 == m_readCallBack ) { return ; } // RETURN
const Property& p = *this ;
PropertyCallbackFunctor* theCallBack = m_readCallBack;
// avoid infinite loop
m_readCallBack = 0;
(*theCallBack)( const_cast<Property&>(p) ) ;
m_readCallBack = theCallBack;
}

bool Property::useUpdateHandler | ( |  | ) |
| virtual

use the call-back function at update

Definition at line 163 of file Property.cpp.

{
bool sc(true);
if ( 0 == m_updateCallBack ) { return sc; } // RETURN
PropertyCallbackFunctor* theCallBack = m_updateCallBack;
// avoid infinite loop
m_updateCallBack = 0;
try {
(*theCallBack)( *this ) ;
} catch(...) {
sc = false;
}
m_updateCallBack = theCallBack;
return sc;
}

## Member Data Documentation

std::string Property::m_documentation
| private

Definition at line 116 of file Property.h.

std::string Property::m_name
| private

Definition at line 114 of file Property.h.

PropertyCallbackFunctor* Property::m_readCallBack
| mutable protected

Definition at line 121 of file Property.h.

const std::type_info* Property::m_typeinfo
| private

Definition at line 118 of file Property.h.

PropertyCallbackFunctor* Property::m_updateCallBack
| protected

Definition at line 123 of file Property.h.

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v25r0/GaudiKernel/GaudiKernel/Property.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v25r0/GaudiKernel/src/Lib/Property.cpp