Orocos Real-Time Toolkit  2.6.0
Public Member Functions | Protected Attributes
RTT::base::PropertyBase Class Reference

Base class for all properties. More...

#include <rtt/base/PropertyBase.hpp>

Inheritance diagram for RTT::base::PropertyBase:
RTT::Property< T >

List of all members.

Public Member Functions

virtual ~PropertyBase ()
 The default destructor.
 PropertyBase (std::string name, std::string description)
 The constructor.
 PropertyBase ()
 Create an uninitialised PropertyBase.
const std::string & getName () const
 Get the name of the property.
void setName (const std::string &name)
 Set the name of the property.
const std::string & getDescription () const
 Get a description of the property.
void setDescription (const std::string &desc)
 Set the description of the property.
bool ready () const
 Inspect if this Property is correctly initialised and ready for usage.
virtual void identify (PropertyIntrospection *pi)=0
 A call on this method will lead to a call to the PropertyIntrospection interface identifying this Property's proper type.
virtual void identify (PropertyBagVisitor *pi)
 A call on this method will lead to a call to the PropertyBagIntrospection interface identifying this Property's proper type.
virtual bool update (const PropertyBase *other)=0
 Update the value of this Property with the value of an other Property.
virtual bool refresh (const PropertyBase *other)=0
 Refresh the value of this Property with the value of an other Property.
virtual bool copy (const PropertyBase *other)=0
 Copy an other Property onto this property.
virtual bool compose (const PropertyBag &source)
 Composes the data of this property with information found in a PropertyBag.
virtual PropertyBaseclone () const =0
 Deliver an identical clone of this PropertyBase.
virtual PropertyBasecreate () const =0
 Create a new default instance of the PropertyBase.
virtual DataSourceBase::shared_ptr getDataSource () const =0
 Get a internal::DataSource through which this PropertyBase can be manipulated.
virtual std::string getType () const =0
 Returns the type of this PropertyBase.
virtual const types::TypeInfogetTypeInfo () const =0
 Returns the types::TypeInfo object of this Property.

Protected Attributes

std::string _name
 A short name for this PropertyBase.
std::string _description
 A lengthy description for this PropertyBase.

Detailed Description

Base class for all properties.

Definition at line 56 of file PropertyBase.hpp.


Constructor & Destructor Documentation

RTT::PropertyBase::PropertyBase ( std::string  name,
std::string  description 
)

The constructor.

Parameters:
nameThe name which will be used to refer to this property.
descriptionA more elaborate description of the property.

Definition at line 55 of file PropertyBase.cpp.


Member Function Documentation

virtual PropertyBase* RTT::base::PropertyBase::clone ( ) const [pure 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.

Implemented in RTT::Property< T >, and RTT::Property< bool >.

Referenced by RTT::marsh::PropertyBagIntrospector::introspect(), and RTT::PropertyBag::PropertyBag().

bool RTT::PropertyBase::compose ( const PropertyBag source) [virtual]

Composes the data of this property with information found in a PropertyBag.

This only works for data types that defined a compose/decompose function in their type info structure.

Definition at line 80 of file PropertyBase.cpp.

References getDataSource(), and RTT::base::DataSourceBase::ref().

virtual bool RTT::base::PropertyBase::copy ( const PropertyBase other) [pure 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.

Returns:
false if the Properties are of different type.

Implemented in RTT::Property< T >, and RTT::Property< bool >.

Referenced by RTT::copyProperties().

virtual PropertyBase* RTT::base::PropertyBase::create ( ) const [pure 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.

Implemented in RTT::Property< T >, and RTT::Property< bool >.

Referenced by RTT::copyProperties(), RTT::updateProperties(), and RTT::updateProperty().

const std::string& RTT::base::PropertyBase::getDescription ( ) const [inline]
const std::string& RTT::base::PropertyBase::getName ( ) const [inline]
virtual std::string RTT::base::PropertyBase::getType ( ) const [pure virtual]
virtual void RTT::base::PropertyBase::identify ( PropertyIntrospection pi) [pure virtual]

A call on this method will lead to a call to the PropertyIntrospection interface identifying this Property's proper type.

Deprecated:
DO NOT USE. Will be removed in 2.x release series.

Implemented in RTT::Property< T >, and RTT::Property< bool >.

Referenced by RTT::Property< T >::identify().

A call on this method will lead to a call to the PropertyBagIntrospection interface identifying this Property's proper type.

Deprecated:
DO NOT USE. Will be removed in 2.x release series.

Reimplemented in RTT::Property< T >, RTT::Property< T >, RTT::Property< bool >, and RTT::Property< T >.

Definition at line 47 of file Property.cpp.

References RTT::base::PropertyBagVisitor::introspect().

bool RTT::base::PropertyBase::ready ( ) const [inline]
virtual bool RTT::base::PropertyBase::refresh ( const PropertyBase other) [pure 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.

Returns:
false if the Properties are of different type.

Implemented in RTT::Property< T >, and RTT::Property< bool >.

Referenced by RTT::refreshProperty().

void RTT::PropertyBase::setDescription ( const std::string &  desc)

Set the description of the property.

Parameters:
descThe description of the property.

Definition at line 64 of file PropertyBase.cpp.

References _description.

Referenced by RTT::Property< bool >::doc(), and RTT::Property< bool >::operator=().

void RTT::PropertyBase::setName ( const std::string &  name)

Set the name of the property.

Parameters:
nameThe name of the property.

Definition at line 59 of file PropertyBase.cpp.

References _name.

Referenced by RTT::ConfigurationInterface::addProperty(), and RTT::Property< bool >::operator=().

virtual bool RTT::base::PropertyBase::update ( const PropertyBase other) [pure 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.

Returns:
false if the Properties are of different type or if this->ready() == false.

Implemented in RTT::Property< T >, and RTT::Property< bool >.

Referenced by RTT::updateProperties().


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