|
Gaudi Framework, version v22r4 |
| Home | Generated: Fri Sep 2 2011 |
Helper intermediate class which represent partly implemented property with value of concrete type. More...
#include <Property.h>


Public Types | |
| typedef Gaudi::Utils::PropertyTypeTraits < TYPE > | Traits |
| the type-traits for properties | |
| typedef Traits::PVal | PVal |
| the actual storage type | |
Public Member Functions | |
| operator const TYPE & () const | |
| implicit conversion to the type | |
| const TYPE & | value () const |
| explicit conversion | |
| virtual bool | setValue (const TYPE &value)=0 |
| NB: abstract : to be implemented when verifier is available. | |
| 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 | |
| virtual void | toStream (std::ostream &out) const |
| value -> stream | |
Protected Member Functions | |
| PropertyWithValue (const std::string &name, PVal 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) |
| assignment operator | |
| PropertyWithValue & | operator= (const PropertyWithValue &rhs) |
| template<class OTHER > | |
| PropertyWithValue & | operator= (const PropertyWithValue< OTHER > &right) |
| void | i_set (const TYPE &value) |
| set the value | |
| PVal | i_get () const |
| get the value | |
Private Attributes | |
| PVal | m_value |
| the actual property value | |
| bool | m_own |
| owner of the storage | |
Helper intermediate class which represent partly implemented property with value of concrete type.
Definition at line 147 of file Property.h.
| typedef Traits::PVal PropertyWithValue< TYPE >::PVal |
the actual storage type
Definition at line 154 of file Property.h.
| typedef Gaudi::Utils::PropertyTypeTraits<TYPE> PropertyWithValue< TYPE >::Traits |
the type-traits for properties
Reimplemented in SimpleProperty< TYPE, VERIFIER >, SimpleProperty< double >, SimpleProperty< std::string >, SimpleProperty< std::vector< std::string > >, SimpleProperty< int >, SimpleProperty< unsigned int >, and SimpleProperty< bool >.
Definition at line 152 of file Property.h.
| PropertyWithValue< TYPE >::PropertyWithValue | ( | const std::string & | name, |
| PVal | 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] |
virtual destructor
Definition at line 261 of file Property.h.
| bool PropertyWithValue< TYPE >::assign | ( | const Property & | source ) | [inline, virtual] |
get the value from another property
implementation of Property::assign
Implements Property.
Definition at line 282 of file Property.h.
{
// 1) Is the property of "the same" type?
const PropertyWithValue<TYPE>* p =
dynamic_cast<const PropertyWithValue<TYPE>*> ( &source ) ;
if ( 0 != p ) { return setValue ( p->value() ) ; } // RETURN
// 2) Else use the string representation
return this->fromString( source.toString() ).isSuccess() ;
}
| StatusCode PropertyWithValue< TYPE >::fromString | ( | const std::string & | s ) | [inline, virtual] |
string -> value
Implementation of PropertyWithValue::fromString.
Implements Property.
Definition at line 326 of file Property.h.
{
TYPE tmp ;
StatusCode sc = Gaudi::Parsers::parse ( tmp , source ) ;
if ( sc.isFailure() ) { return sc ; }
return setValue ( tmp ) ? StatusCode::SUCCESS : StatusCode::FAILURE ;
}
| PVal PropertyWithValue< TYPE >::i_get | ( | ) | const [inline, protected] |
| void PropertyWithValue< TYPE >::i_set | ( | const TYPE & | value ) | [inline, protected] |
| bool PropertyWithValue< TYPE >::load | ( | Property & | dest ) | const [inline, virtual] |
set value for another property
implementation of Property::load
Implements Property.
Definition at line 296 of file Property.h.
{
// delegate to the 'opposite' method ;
return dest.assign( *this ) ;
}
| PropertyWithValue< TYPE >::operator const TYPE & | ( | ) | const [inline] |
| PropertyWithValue< TYPE > & PropertyWithValue< TYPE >::operator= | ( | const TYPE & | value ) | [inline, protected] |
assignment operator
Reimplemented in PropertyWithVerifier< TYPE, VERIFIER >, SimpleProperty< TYPE, VERIFIER >, SimplePropertyRef< TYPE, VERIFIER >, PropertyWithVerifier< std::string, BoundedVerifier< std::string > >, PropertyWithVerifier< unsigned int, BoundedVerifier< unsigned int > >, PropertyWithVerifier< int, BoundedVerifier< int > >, PropertyWithVerifier< double, BoundedVerifier< double > >, PropertyWithVerifier< std::vector< std::string >, BoundedVerifier< std::vector< std::string > > >, and PropertyWithVerifier< bool, BoundedVerifier< bool > >.
Definition at line 271 of file Property.h.
{
if ( !setValue ( value ) )
{ throw std::out_of_range( "Value not verified" ) ; }
return *this ;
}
| PropertyWithValue< TYPE > & PropertyWithValue< TYPE >::operator= | ( | const PropertyWithValue< TYPE > & | rhs ) | [protected] |
Definition at line 361 of file Property.h.
{
// assign the base class
Property::operator=( right ) ;
// assign the value
PropertyWithValue<TYPE>::operator=( right.value() ) ;
return *this ;
}
| PropertyWithValue< TYPE > & PropertyWithValue< TYPE >::operator= | ( | const PropertyWithValue< OTHER > & | right ) | [protected] |
Reimplemented in PropertyWithVerifier< TYPE, VERIFIER >, SimpleProperty< TYPE, VERIFIER >, SimplePropertyRef< TYPE, VERIFIER >, PropertyWithVerifier< std::string, BoundedVerifier< std::string > >, PropertyWithVerifier< unsigned int, BoundedVerifier< unsigned int > >, PropertyWithVerifier< int, BoundedVerifier< int > >, PropertyWithVerifier< double, BoundedVerifier< double > >, PropertyWithVerifier< std::vector< std::string >, BoundedVerifier< std::vector< std::string > > >, PropertyWithVerifier< bool, BoundedVerifier< bool > >, SimpleProperty< double >, SimpleProperty< std::string >, SimpleProperty< std::vector< std::string > >, SimpleProperty< int >, SimpleProperty< unsigned int >, and SimpleProperty< bool >.
Definition at line 375 of file Property.h.
{
// assign the base class
Property::operator=( right ) ;
// assign the value
PropertyWithValue<TYPE>::operator=( right.value() ) ;
return *this ;
}
| virtual bool PropertyWithValue< TYPE >::setValue | ( | const TYPE & | value ) | [pure virtual] |
NB: abstract : to be implemented when verifier is available.
Implemented in PropertyWithVerifier< TYPE, VERIFIER >, PropertyWithVerifier< std::string, BoundedVerifier< std::string > >, PropertyWithVerifier< unsigned int, BoundedVerifier< unsigned int > >, PropertyWithVerifier< int, BoundedVerifier< int > >, PropertyWithVerifier< double, BoundedVerifier< double > >, PropertyWithVerifier< std::vector< std::string >, BoundedVerifier< std::vector< std::string > > >, and PropertyWithVerifier< bool, BoundedVerifier< bool > >.
| void PropertyWithValue< TYPE >::toStream | ( | std::ostream & | out ) | const [inline, virtual] |
value -> stream
Implementation of PropertyWithValue::toStream.
Implements Property.
Definition at line 316 of file Property.h.
{
useReadHandler();
Gaudi::Utils::toStream( *m_value, out ) ;
}
| std::string PropertyWithValue< TYPE >::toString | ( | ) | const [inline, virtual] |
value -> string
Implementation of PropertyWithValue::toString.
Implements Property.
Definition at line 306 of file Property.h.
{
useReadHandler();
return Gaudi::Utils::toString( *m_value ) ;
}
| const TYPE & PropertyWithValue< TYPE >::value | ( | ) | const [inline] |
explicit conversion
get the access to the storage
Definition at line 354 of file Property.h.
{ useReadHandler() ; return *m_value ; }
bool PropertyWithValue< TYPE >::m_own [private] |
owner of the storage
Definition at line 216 of file Property.h.
PVal PropertyWithValue< TYPE >::m_value [private] |
the actual property value
Definition at line 214 of file Property.h.