| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

PropertyWithVerifier< TYPE, VERIFIER > Class Template Reference

Helper intermediate class which represent partly implemented property with value of concrete type and concrete verifier. More...

#include <Property.h>

Inheritance diagram for PropertyWithVerifier< TYPE, VERIFIER >:

[legend]
Collaboration diagram for PropertyWithVerifier< TYPE, VERIFIER >:
[legend]
List of all members.

Public Member Functions

VERIFIER & verifier ()
const VERIFIER & verifier () const
bool set (const TYPE &value)
 update the value of the property/check the verifier
virtual bool setValue (const TYPE &value)
 implementation of PropertyWithValue::setValue
template<class OTHER, class OTHERVERIFIER>
PropertyWithVerifieroperator= (const PropertyWithVerifier< OTHER, OTHERVERIFIER > &right)
 templated assignement
template<class OTHER>
PropertyWithVerifieroperator= (const PropertyWithValue< OTHER > &right)
 templated assignement
PropertyWithVerifieroperator= (const TYPE &right)
 assignement
 operator const TYPE & () const
const TYPE & value () const
 get the access to the storage
virtual bool assign (const Property &source)
 get the value from another property
template<>
bool assign (const Property &source)
 import the property value form the source
virtual bool load (Property &dest) const
 set value for another property
virtual StatusCode fromString (const std::string &s)
 string -> value
virtual std::string toString () const
 value -> string
template<>
std::string toString () const
 value -> string
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
const PropertyCallbackFunctorreadCallBack () const
 Call-back functor at reading: the functor is ownered by property!
const PropertyCallbackFunctorupdateCallBack () const
 Call-back functor for update: the funtor is ownered by property!
virtual void declareReadHandler (PropertyCallbackFunctor *pf)
 set new callback for reading
template<class HT>
void declareReadHandler (void(HT::*MF)(Property &), HT *instance)
virtual void declareUpdateHandler (PropertyCallbackFunctor *pf)
 set new callback for update
template<class HT>
void declareUpdateHandler (void(HT::*MF)(Property &), HT *instance)
virtual void useReadHandler () const
 use the call-back function at reading
virtual void useUpdateHandler ()
 use the call-back function at update
virtual Propertyclone () 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

 PropertyWithVerifier (const std::string &name, TYPE *value, const bool owner, const VERIFIER &verifier)
 the constructor with property name and value
virtual ~PropertyWithVerifier ()
 virtual destructor
void i_set (const TYPE &value)
TYPE * i_get () const

Protected Attributes

PropertyCallbackFunctorm_readCallBack
PropertyCallbackFunctorm_updateCallBack

Private Member Functions

 PropertyWithVerifier ()
 the default constructot is disabled
 PropertyWithVerifier (const PropertyWithVerifier &right)
 the copy constructor is disabled

Private Attributes

VERIFIER m_verifier

Detailed Description

template<class TYPE, class VERIFIER>
class PropertyWithVerifier< TYPE, VERIFIER >

Helper intermediate class which represent partly implemented property with value of concrete type and concrete verifier.

Author:
Vanya BELYAEV ibelyaev@physics.syr.edu
Date:
2006-02-27

Definition at line 358 of file Property.h.


Constructor & Destructor Documentation

template<class TYPE, class VERIFIER>
PropertyWithVerifier< TYPE, VERIFIER >::PropertyWithVerifier ( const std::string &  name,
TYPE *  value,
const bool  owner,
const VERIFIER &  verifier 
) [inline, protected]

the constructor with property name and value

Definition at line 364 of file Property.h.

00368     : PropertyWithValue<TYPE> ( name , value , owner )
00369     , m_verifier ( verifier )
00370   {}

template<class TYPE, class VERIFIER>
virtual PropertyWithVerifier< TYPE, VERIFIER >::~PropertyWithVerifier (  )  [inline, protected, virtual]

virtual destructor

Definition at line 372 of file Property.h.

00372 {};

template<class TYPE, class VERIFIER>
PropertyWithVerifier< TYPE, VERIFIER >::PropertyWithVerifier (  )  [private]

the default constructot is disabled

template<class TYPE, class VERIFIER>
PropertyWithVerifier< TYPE, VERIFIER >::PropertyWithVerifier ( const PropertyWithVerifier< TYPE, VERIFIER > &  right  )  [private]

the copy constructor is disabled


Member Function Documentation

template<class TYPE, class VERIFIER>
VERIFIER& PropertyWithVerifier< TYPE, VERIFIER >::verifier (  )  [inline]

Definition at line 374 of file Property.h.

00374 { return m_verifier ; }

template<class TYPE, class VERIFIER>
const VERIFIER& PropertyWithVerifier< TYPE, VERIFIER >::verifier (  )  const [inline]

Definition at line 375 of file Property.h.

00375 { return m_verifier ; }

template<class TYPE, class VERIFIER>
bool PropertyWithVerifier< TYPE, VERIFIER >::set ( const TYPE &  value  )  [inline]

update the value of the property/check the verifier

use verifier!

update the value

invoke the update handler

Definition at line 402 of file Property.h.

00403 {
00405   if ( !m_verifier.isValid( &value ) ) { return false ; }
00407   i_set( value ) ;
00409   this->useUpdateHandler() ;
00410   return true ;
00411 }

template<class TYPE, class VERIFIER>
virtual bool PropertyWithVerifier< TYPE, VERIFIER >::setValue ( const TYPE &  value  )  [inline, virtual]

implementation of PropertyWithValue::setValue

Implements PropertyWithValue< TYPE >.

Definition at line 379 of file Property.h.

00379 { return set( value ) ; }

template<class TYPE, class VERIFIER>
template<class OTHER, class OTHERVERIFIER>
PropertyWithVerifier< TYPE, VERIFIER > & PropertyWithVerifier< TYPE, VERIFIER >::operator= ( const PropertyWithVerifier< OTHER, OTHERVERIFIER > &  right  )  [inline]

templated assignement

Definition at line 440 of file Property.h.

00441 {
00442   PropertyWithValue<TYPE>::operator=(right) ;
00443   return *this ;
00444 }

template<class TYPE, class VERIFIER>
template<class OTHER>
PropertyWithVerifier< TYPE, VERIFIER > & PropertyWithVerifier< TYPE, VERIFIER >::operator= ( const PropertyWithValue< OTHER > &  right  )  [inline]

templated assignement

Reimplemented from PropertyWithValue< TYPE >.

Reimplemented in SimpleProperty< TYPE, VERIFIER >, and SimplePropertyRef< TYPE, VERIFIER >.

Definition at line 428 of file Property.h.

00429 {
00430   PropertyWithValue<TYPE>::operator=(right) ;
00431   return *this ;
00432 }

template<class TYPE, class VERIFIER>
PropertyWithVerifier< TYPE, VERIFIER > & PropertyWithVerifier< TYPE, VERIFIER >::operator= ( const TYPE &  right  )  [inline]

assignement

Reimplemented from PropertyWithValue< TYPE >.

Reimplemented in SimpleProperty< TYPE, VERIFIER >, and SimplePropertyRef< TYPE, VERIFIER >.

Definition at line 417 of file Property.h.

00418 {
00419   PropertyWithValue<TYPE>::operator=( right ) ;
00420   return *this ;
00421 }

template<class TYPE>
PropertyWithValue< TYPE >::operator const TYPE & (  )  const [inline, inherited]

Definition at line 172 of file Property.h.

00172 { return value() ;}

template<class TYPE>
const TYPE & PropertyWithValue< TYPE >::value (  )  const [inline, inherited]

get the access to the storage

Definition at line 306 of file Property.h.

00307 { useReadHandler() ; return *m_value ; }

template<class TYPE>
bool PropertyWithValue< TYPE >::assign ( const Property source  )  [inline, virtual, inherited]

get the value from another property

Implements Property.

Definition at line 247 of file Property.h.

00248 {
00249   // 1) Is the property of "the same" type?
00250   const PropertyWithValue<TYPE>* p =
00251     dynamic_cast<const PropertyWithValue<TYPE>*>       ( &source ) ;
00252   if ( 0 != p ) { return setValue ( p->value() ) ; }       // RETURN
00253   // 2) Else use the string representation
00254   return this->fromString( source.toString() ).isSuccess() ;
00255 }

template<>
bool PropertyWithValue< std::string >::assign ( const Property source  )  [inline, virtual, inherited]

import the property value form the source

Implements Property.

Definition at line 297 of file Property.h.

00298 { return this->fromString( source.toString() ).isSuccess() ; }

template<class TYPE>
bool PropertyWithValue< TYPE >::load ( Property dest  )  const [inline, virtual, inherited]

set value for another property

Implements Property.

Definition at line 261 of file Property.h.

00262 {
00263   // gelegate to the 'opposite' method ;
00264   return dest.assign( *this ) ;
00265 }

template<class TYPE>
StatusCode PropertyWithValue< TYPE >::fromString ( const std::string &  s  )  [inline, virtual, inherited]

string -> value

Implements Property.

Definition at line 281 of file Property.h.

00282 {
00283   TYPE tmp ;
00284   StatusCode sc = Gaudi::Parsers::parse ( tmp , source ) ;
00285   if ( sc.isFailure() ) { return sc ; }
00286   return setValue ( tmp ) ? StatusCode::SUCCESS : StatusCode::FAILURE ;
00287 }

template<class TYPE>
std::string PropertyWithValue< TYPE >::toString (  )  const [inline, virtual, inherited]

value -> string

Implements Property.

Definition at line 271 of file Property.h.

00272 {
00273   useReadHandler();
00274   return Gaudi::Utils::toString( *m_value ) ;
00275 }

template<>
std::string PropertyWithValue< std::string >::toString (  )  const [inline, virtual, inherited]

value -> string

Implements Property.

Definition at line 293 of file Property.h.

00294 { return this->value() ; }

template<class TYPE>
void PropertyWithValue< TYPE >::i_set ( const TYPE &  value  )  [inline, protected, inherited]

Definition at line 313 of file Property.h.

00313 { *m_value = value ; }

template<class TYPE>
TYPE * PropertyWithValue< TYPE >::i_get (  )  const [inline, protected, inherited]

Definition at line 318 of file Property.h.

00318 { return m_value ; }

const std::string& Property::name (  )  const [inline, inherited]

property name

Definition at line 50 of file Property.h.

00050 { return m_name             ; } ;

const std::string& Property::documentation (  )  const [inline, inherited]

property documentation

Definition at line 52 of file Property.h.

00052 { return m_documentation; };

const std::type_info* Property::type_info (  )  const [inline, inherited]

property type-info

Definition at line 54 of file Property.h.

00054 { return m_typeinfo         ; } ;

std::string Property::type (  )  const [inline, inherited]

property type

Definition at line 56 of file Property.h.

00056 { return m_typeinfo->name() ; } ;

const PropertyCallbackFunctor* Property::readCallBack (  )  const [inherited]

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

const PropertyCallbackFunctor* Property::updateCallBack (  )  const [inherited]

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

virtual void Property::declareReadHandler ( PropertyCallbackFunctor pf  )  [virtual, inherited]

set new callback for reading

template<class HT>
void Property::declareReadHandler ( void(HT::*)(Property &)  MF,
HT *  instance 
) [inline, inherited]

Definition at line 131 of file Property.h.

virtual void Property::declareUpdateHandler ( PropertyCallbackFunctor pf  )  [virtual, inherited]

set new callback for update

template<class HT>
void Property::declareUpdateHandler ( void(HT::*)(Property &)  MF,
HT *  instance 
) [inline, inherited]

Definition at line 136 of file Property.h.

virtual void Property::useReadHandler (  )  const [virtual, inherited]

use the call-back function at reading

virtual void Property::useUpdateHandler (  )  [virtual, inherited]

use the call-back function at update

virtual Property* Property::clone (  )  const [pure virtual, inherited]

clone: "virtual constructor"

Implemented in SimpleProperty< TYPE, VERIFIER >, SimplePropertyRef< TYPE, VERIFIER >, GaudiHandleProperty, and GaudiHandleArrayProperty.

void Property::setName ( const std::string &  value  )  [inline, inherited]

set the new value for the property name

Definition at line 91 of file Property.h.

00091 { m_name = value ; }

void Property::setDocumentation ( const std::string &  documentation  )  [inline, inherited]

set the documentation string

Definition at line 93 of file Property.h.

00093                                                           {
00094     m_documentation = documentation; };

virtual std::ostream& Property::fillStream ( std::ostream &   )  const [virtual, inherited]

the printout of the property value


Member Data Documentation

template<class TYPE, class VERIFIER>
VERIFIER PropertyWithVerifier< TYPE, VERIFIER >::m_verifier [private]

Definition at line 395 of file Property.h.

PropertyCallbackFunctor* Property::m_readCallBack [mutable, protected, inherited]

Definition at line 122 of file Property.h.

PropertyCallbackFunctor* Property::m_updateCallBack [protected, inherited]

Definition at line 124 of file Property.h.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 19:57:13 2011 for GaudiKernel by doxygen 1.4.7