A property represents a named value of any type with a description. More...
#include <Property.hpp>
Public Types | |
typedef boost::call_traits < value_t >::const_reference | const_reference_t |
typedef value_t | DataSourceType |
typedef boost::call_traits < value_t >::param_type | param_t |
typedef boost::call_traits < value_t >::reference | reference_t |
typedef boost::remove_const < typename boost::remove_reference< T > ::type >::type | value_t |
Public Member Functions | |
virtual Property< T > * | clone () const |
template<> | |
bool | copy (const Property< PropertyBag > &orig) |
virtual bool | copy (const base::PropertyBase *other) |
bool | copy (const Property< T > &orig) |
virtual Property< T > * | copy () const |
template<> | |
RTT_API bool | copy (const Property< PropertyBag > &orig) |
virtual Property< T > * | create () const |
Property< T > & | doc (const std::string &descr) |
DataSourceType | get () const |
internal::AssignableDataSource < DataSourceType >::shared_ptr | getAssignableDataSource () const |
virtual base::DataSourceBase::shared_ptr | getDataSource () const |
virtual std::string | getType () const |
virtual const types::TypeInfo * | getTypeInfo () const |
template<> | |
void | identify (PropertyBagVisitor *pbi) |
virtual void | identify (base::PropertyIntrospection *pi) |
virtual void | identify (base::PropertyBagVisitor *pi) |
template<> | |
RTT_API void | identify (base::PropertyBagVisitor *pbi) |
operator value_t () const | |
Property< T > & | operator<<= (Property< T > &p) |
Property< T > & | operator= (param_t value) |
Property< T > & | operator= (base::PropertyBase *source) |
Property () | |
Property (const std::string &name) | |
Property (const std::string &name, const std::string &description, param_t value=value_t()) | |
Property (const Property< T > &orig) | |
Property (base::PropertyBase *source) | |
Property (const std::string &name, const std::string &description, typename internal::AssignableDataSource< DataSourceType >::shared_ptr datasource) | |
template<> | |
bool | refresh (const Property< PropertyBag > &orig) |
virtual bool | refresh (const base::PropertyBase *other) |
bool | refresh (const Property< T > &orig) |
template<> | |
RTT_API bool | refresh (const Property< PropertyBag > &orig) |
const_reference_t | rvalue () const |
reference_t | set () |
void | set (param_t v) |
template<> | |
bool | update (const Property< PropertyBag > &orig) |
virtual bool | update (const base::PropertyBase *other) |
bool | update (const Property< T > &orig) |
template<> | |
RTT_API bool | update (const Property< PropertyBag > &orig) |
reference_t | value () |
Static Public Member Functions | |
static Property< T > * | narrow (base::PropertyBase *prop) |
Protected Attributes | |
internal::AssignableDataSource < DataSourceType >::shared_ptr | _value |
A property represents a named value of any type with a description.
A property is a tuple of a name, a description and a variable of any type. It's purpose is to provide a hierarchical parameter of a component. They are grouped in PropertyBag objects and a Property can contain a PropertyBag itself.
If you do not provide a name nor description when constructing the Property object, it will be uninitialised and ready() will return false. Such an object may not be used (set(), get(),...) until it has been initialised from another Property. Otherwise, an exception (or assert) will be thrown.
T | The type of the data contained within the Property. |
Definition at line 76 of file Property.hpp.
typedef boost::call_traits<value_t>::const_reference RTT::Property< T >::const_reference_t |
Definition at line 88 of file Property.hpp.
typedef value_t RTT::Property< T >::DataSourceType |
Definition at line 89 of file Property.hpp.
typedef boost::call_traits<value_t>::param_type RTT::Property< T >::param_t |
Definition at line 86 of file Property.hpp.
typedef boost::call_traits<value_t>::reference RTT::Property< T >::reference_t |
Definition at line 87 of file Property.hpp.
typedef boost::remove_const<typename boost::remove_reference<T>::type>::type RTT::Property< T >::value_t |
The types of this property type. value_t is always the 'bare' value type of T. From this type, we derive the other (param, ref, ...) types.
Definition at line 85 of file Property.hpp.
RTT::Property< T >::Property | ( | ) | [inline] |
RTT::Property< T >::Property | ( | const std::string & | name | ) | [inline, explicit] |
The constructor which initializes the property's value to the default.
name | The name which will be used to refer to the property. |
Definition at line 104 of file Property.hpp.
RTT::Property< T >::Property | ( | const std::string & | name, |
const std::string & | description, | ||
param_t | value = value_t() |
||
) | [inline] |
The constructor which initializes the property's value.
name | The name which will be used to refer to the property. |
description | The description of the property. |
value | The initial value of the property (optional). |
Definition at line 117 of file Property.hpp.
RTT::Property< T >::Property | ( | const Property< T > & | orig | ) | [inline] |
Copy constructors copies the name, description and value as deep copies.
Definition at line 127 of file Property.hpp.
RTT::Property< T >::Property | ( | base::PropertyBase * | source | ) | [inline] |
Create a Property mirroring another PropertyBase. It copies the name and description, and shallow copies the value.
Definition at line 142 of file Property.hpp.
RTT::Property< T >::Property | ( | const std::string & | name, |
const std::string & | description, | ||
typename internal::AssignableDataSource< DataSourceType >::shared_ptr | datasource | ||
) | [inline] |
The constructor which initializes the property with a DataSource.
name | The name which will be used to refer to the property. |
description | The description of the property. |
datasource | A new data source to be acquired by this property for storing its data. |
Definition at line 164 of file Property.hpp.
virtual Property<T>* RTT::Property< T >::clone | ( | ) | const [inline, virtual] |
Deliver an identical clone of this PropertyBase. The original may be deleted and the clone can be transparantly used in its place or vice versa.
Implements RTT::base::PropertyBase.
Definition at line 368 of file Property.hpp.
bool RTT::Property< PropertyBag >::copy | ( | const Property< PropertyBag > & | orig | ) |
Definition at line 282 of file PropertyBag.cpp.
virtual bool RTT::Property< T >::copy | ( | const base::PropertyBase * | other | ) | [inline, virtual] |
Copy an other Property onto this property. Copy does a full update of the name, description and value, adding extra information if necessary, or in case of a Property<PropertyBag> adding all Properties.
Copy only works on properties that are ready() and both have the same data type T.
Implements RTT::base::PropertyBase.
Definition at line 320 of file Property.hpp.
bool RTT::Property< T >::copy | ( | const Property< T > & | orig | ) | [inline] |
Copy the value, complete overwrite of this Property with orig.
Definition at line 332 of file Property.hpp.
virtual Property<T>* RTT::Property< T >::copy | ( | ) | const [inline, virtual] |
Deliver a shallow copy of this PropertyBase with a shared DataSource. The original may be deleted and the clone can be transparantly used in its place or vice versa.
Implements RTT::base::PropertyBase.
Definition at line 373 of file Property.hpp.
RTT_API bool RTT::Property< PropertyBag >::copy | ( | const Property< PropertyBag > & | orig | ) |
virtual Property<T>* RTT::Property< T >::create | ( | ) | const [inline, virtual] |
Create a new default instance of the PropertyBase. This is a factory method to 'make something of the same type'. The new PropertyBase has the same name and description as this.
Implements RTT::base::PropertyBase.
Definition at line 378 of file Property.hpp.
Property<T>& RTT::Property< T >::doc | ( | const std::string & | descr | ) | [inline] |
Documents this property.
descr | The description of this property |
Definition at line 225 of file Property.hpp.
DataSourceType RTT::Property< T >::get | ( | ) | const [inline] |
Get a copy of the value of the property.
Definition at line 243 of file Property.hpp.
internal::AssignableDataSource<DataSourceType>::shared_ptr RTT::Property< T >::getAssignableDataSource | ( | ) | const [inline] |
Definition at line 387 of file Property.hpp.
virtual base::DataSourceBase::shared_ptr RTT::Property< T >::getDataSource | ( | ) | const [inline, virtual] |
Get a internal::DataSource through which this PropertyBase can be manipulated.
Implements RTT::base::PropertyBase.
Definition at line 383 of file Property.hpp.
virtual std::string RTT::Property< T >::getType | ( | ) | const [inline, virtual] |
Returns the type of this PropertyBase. Uses the naming scheme of DataSourceTypeInfo.
Implements RTT::base::PropertyBase.
Definition at line 391 of file Property.hpp.
virtual const types::TypeInfo* RTT::Property< T >::getTypeInfo | ( | ) | const [inline, virtual] |
Returns the types::TypeInfo object of this Property.
Implements RTT::base::PropertyBase.
Definition at line 395 of file Property.hpp.
void RTT::Property< PropertyBag >::identify | ( | PropertyBagVisitor * | pi | ) | [virtual] |
A call on this method will lead to a call to the PropertyBagIntrospection interface identifying this Property's proper type.
Reimplemented from RTT::base::PropertyBase.
Definition at line 53 of file Property.cpp.
void RTT::Property< T >::identify | ( | base::PropertyIntrospection * | pi | ) | [virtual] |
A call on this method will lead to a call to the PropertyIntrospection interface identifying this Property's proper type.
Implements RTT::base::PropertyBase.
Definition at line 436 of file Property.hpp.
void RTT::Property< T >::identify | ( | base::PropertyBagVisitor * | pi | ) | [virtual] |
A call on this method will lead to a call to the PropertyBagIntrospection interface identifying this Property's proper type.
Reimplemented from RTT::base::PropertyBase.
Definition at line 442 of file Property.hpp.
RTT_API void RTT::Property< PropertyBag >::identify | ( | base::PropertyBagVisitor * | pi | ) | [virtual] |
A call on this method will lead to a call to the PropertyBagIntrospection interface identifying this Property's proper type.
Reimplemented from RTT::base::PropertyBase.
Property< T > * RTT::Property< T >::narrow | ( | base::PropertyBase * | prop | ) | [static] |
Use this method instead of dynamic_cast<> to cast from base::PropertyBase to Property<T>. You need to delete the returned property if it is no longer needed.
T | The Desired property type, for example 'double'. |
prop | The property to narrow to Property<T>. |
Definition at line 425 of file Property.hpp.
RTT::Property< T >::operator value_t | ( | ) | const [inline] |
Get a copy of the value of the property.
Definition at line 234 of file Property.hpp.
Property<T>& RTT::Property< T >::operator<<= | ( | Property< T > & | p | ) | [inline] |
Update the value of this property with another property.
Definition at line 214 of file Property.hpp.
Property<T>& RTT::Property< T >::operator= | ( | param_t | value | ) | [inline] |
Set the property's value.
value | The value to be set. |
Definition at line 178 of file Property.hpp.
Property<T>& RTT::Property< T >::operator= | ( | base::PropertyBase * | source | ) | [inline] |
Construct a Property which mirrors a PropertyBase.
source | A pointer to the property to mirror. |
Definition at line 188 of file Property.hpp.
bool RTT::Property< PropertyBag >::refresh | ( | const Property< PropertyBag > & | orig | ) |
Definition at line 274 of file PropertyBag.cpp.
virtual bool RTT::Property< T >::refresh | ( | const base::PropertyBase * | other | ) | [inline, virtual] |
Refresh the value of this Property with the value of an other Property. Refresh does only the minimal update of the value, not adding extra information, or in case of a Property<PropertyBag> not adding extra Properties.
Refresh only works on properties that are ready() and both have the same data type T.
Implements RTT::base::PropertyBase.
Definition at line 311 of file Property.hpp.
bool RTT::Property< T >::refresh | ( | const Property< T > & | orig | ) | [inline] |
Refresh only the value from a Property. This is a real-time operation.
Definition at line 360 of file Property.hpp.
RTT_API bool RTT::Property< PropertyBag >::refresh | ( | const Property< PropertyBag > & | orig | ) |
const_reference_t RTT::Property< T >::rvalue | ( | ) | const [inline] |
Read-only (const&) access to the value of the Property.
Definition at line 282 of file Property.hpp.
reference_t RTT::Property< T >::set | ( | ) | [inline] |
Access to the value of the Property. Identical to value().
Definition at line 254 of file Property.hpp.
void RTT::Property< T >::set | ( | param_t | v | ) | [inline] |
Set the value of the Property.
Definition at line 262 of file Property.hpp.
bool RTT::Property< PropertyBag >::update | ( | const Property< PropertyBag > & | orig | ) |
Definition at line 264 of file PropertyBag.cpp.
virtual bool RTT::Property< T >::update | ( | const base::PropertyBase * | other | ) | [inline, virtual] |
Update the value of this Property with the value of an other Property. Update does a full update of the value, adding extra information if necessary, or in case of a Property<PropertyBag> adding missing Properties.
Update only works on properties that are ready() and both have the same data type T.
Implements RTT::base::PropertyBase.
Definition at line 302 of file Property.hpp.
bool RTT::Property< T >::update | ( | const Property< T > & | orig | ) | [inline] |
Update the value, optionally also the description if current description is empty.
Definition at line 346 of file Property.hpp.
RTT_API bool RTT::Property< PropertyBag >::update | ( | const Property< PropertyBag > & | orig | ) |
Partial specialisations in case of PropertyBag.
reference_t RTT::Property< T >::value | ( | ) | [inline] |
Access to the value of the Property. Identical to set().
Definition at line 274 of file Property.hpp.
internal::AssignableDataSource<DataSourceType>::shared_ptr RTT::Property< T >::_value [protected] |
Definition at line 399 of file Property.hpp.