#include <Property.h>
Inheritance diagram for PropertyWithValue< TYPE >:
Public Member Functions | |
operator const TYPE & () const | |
const TYPE & | value () const |
get the access to the storage | |
virtual bool | setValue (const TYPE &value)=0 |
virtual bool | assign (const Property &source) |
get the value from another property | |
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 | |
template<> | |
bool | assign (const Property &source) |
import the property value form the source | |
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 PropertyCallbackFunctor * | readCallBack () const |
Call-back functor at reading: the functor is ownered by property! | |
const PropertyCallbackFunctor * | updateCallBack () 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 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 | |
PropertyWithValue (const std::string &name, TYPE *value, const bool owner) | |
the constructor with property name and value | |
PropertyWithValue (const PropertyWithValue &rhs) | |
copy constructor (don't let the compiler generate a buggy one) | |
template<class OTHER> | |
PropertyWithValue (const PropertyWithValue< OTHER > &right) | |
copy constructor from any other type | |
virtual | ~PropertyWithValue () |
virtual destructor | |
PropertyWithValue & | operator= (const TYPE &value) |
assignement operator | |
PropertyWithValue & | operator= (const PropertyWithValue &rhs) |
template<class OTHER> | |
PropertyWithValue & | operator= (const PropertyWithValue< OTHER > &right) |
void | i_set (const TYPE &value) |
TYPE * | i_get () const |
Protected Attributes | |
PropertyCallbackFunctor * | m_readCallBack |
PropertyCallbackFunctor * | m_updateCallBack |
Private Attributes | |
TYPE * | m_value |
bool | m_own |
Definition at line 148 of file Property.h.
PropertyWithValue< TYPE >::PropertyWithValue | ( | const std::string & | name, | |
TYPE * | value, | |||
const bool | owner | |||
) | [inline, protected] |
PropertyWithValue< TYPE >::PropertyWithValue | ( | const PropertyWithValue< TYPE > & | rhs | ) | [inline, protected] |
PropertyWithValue< TYPE >::PropertyWithValue | ( | const PropertyWithValue< OTHER > & | right | ) | [inline, protected] |
PropertyWithValue< TYPE >::~PropertyWithValue | ( | ) | [inline, protected, virtual] |
PropertyWithValue< TYPE > & PropertyWithValue< TYPE >::operator= | ( | const TYPE & | value | ) | [inline, protected] |
assignement operator
Reimplemented in PropertyWithVerifier< TYPE, VERIFIER >, SimpleProperty< TYPE, VERIFIER >, and SimplePropertyRef< TYPE, VERIFIER >.
Definition at line 236 of file Property.h.
00237 { 00238 if ( !setValue ( value ) ) 00239 { throw std::out_of_range( "Value not verified" ) ; } 00240 return *this ; 00241 }
PropertyWithValue< TYPE > & PropertyWithValue< TYPE >::operator= | ( | const PropertyWithValue< TYPE > & | rhs | ) | [protected] |
Definition at line 324 of file Property.h.
00325 { 00326 // assign the base class 00327 Property::operator=( right ) ; 00328 // assign the value 00329 PropertyWithValue<TYPE>::operator=( right.value() ) ; 00330 return *this ; 00331 }
PropertyWithValue< TYPE > & PropertyWithValue< TYPE >::operator= | ( | const PropertyWithValue< OTHER > & | right | ) | [protected] |
Reimplemented in PropertyWithVerifier< TYPE, VERIFIER >, SimpleProperty< TYPE, VERIFIER >, and SimplePropertyRef< TYPE, VERIFIER >.
Definition at line 338 of file Property.h.
00339 { 00340 // assign the base class 00341 Property::operator=( right ) ; 00342 // assign the value 00343 PropertyWithValue<TYPE>::operator=( right.value() ) ; 00344 return *this ; 00345 }
PropertyWithValue< TYPE >::operator const TYPE & | ( | ) | const [inline] |
const TYPE & PropertyWithValue< TYPE >::value | ( | ) | const [inline] |
get the access to the storage
Definition at line 306 of file Property.h.
00307 { useReadHandler() ; return *m_value ; }
virtual bool PropertyWithValue< TYPE >::setValue | ( | const TYPE & | value | ) | [pure virtual] |
Implemented in PropertyWithVerifier< TYPE, VERIFIER >.
bool PropertyWithValue< TYPE >::assign | ( | const Property & | source | ) | [inline, virtual] |
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 }
bool PropertyWithValue< TYPE >::load | ( | Property & | dest | ) | const [inline, virtual] |
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 }
StatusCode PropertyWithValue< TYPE >::fromString | ( | const std::string & | s | ) | [inline, virtual] |
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 }
std::string PropertyWithValue< TYPE >::toString | ( | ) | const [inline, virtual] |
value -> string
Implements Property.
Definition at line 271 of file Property.h.
00272 { 00273 useReadHandler(); 00274 return Gaudi::Utils::toString( *m_value ) ; 00275 }
void PropertyWithValue< TYPE >::i_set | ( | const TYPE & | value | ) | [inline, protected] |
TYPE * PropertyWithValue< TYPE >::i_get | ( | ) | const [inline, protected] |
std::string PropertyWithValue< std::string >::toString | ( | ) | const [inline, virtual] |
value -> string
Implements Property.
Definition at line 293 of file Property.h.
00294 { return this->value() ; }
bool PropertyWithValue< std::string >::assign | ( | const Property & | source | ) | [inline, virtual] |
import the property value form the source
Implements Property.
Definition at line 297 of file Property.h.
00298 { return this->fromString( source.toString() ).isSuccess() ; }
const std::string& Property::name | ( | ) | const [inline, inherited] |
const std::string& Property::documentation | ( | ) | const [inline, inherited] |
const std::type_info* Property::type_info | ( | ) | const [inline, inherited] |
std::string Property::type | ( | ) | const [inline, inherited] |
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
void Property::declareReadHandler | ( | void(HT::*)(Property &) | MF, | |
HT * | instance | |||
) | [inline, inherited] |
Definition at line 131 of file Property.h.
00132 { declareReadHandler ( new PropertyCallbackMemberFunctor< HT >( MF , obj ) ) ; }
virtual void Property::declareUpdateHandler | ( | PropertyCallbackFunctor * | pf | ) | [virtual, inherited] |
set new callback for update
void Property::declareUpdateHandler | ( | void(HT::*)(Property &) | MF, | |
HT * | instance | |||
) | [inline, inherited] |
Definition at line 136 of file Property.h.
00137 { declareUpdateHandler ( new PropertyCallbackMemberFunctor< HT >( MF , obj ) ) ; }
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
TYPE* PropertyWithValue< TYPE >::m_value [private] |
Definition at line 189 of file Property.h.
bool PropertyWithValue< TYPE >::m_own [private] |
Definition at line 190 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.