RobWorkProject
23.9.11-
|
Base class for Property handling. More...
#include <PropertyBase.hpp>
Inherited by Property< rw::math::Vector3D<> >, Property< rw::core::PropertyMap >, Property< bool >, and Property< T >.
Public Types | |
typedef rw::core::Ptr< PropertyBase > | Ptr |
smart pointer type to this class | |
typedef std::function< void(PropertyBase *)> | PropertyListener |
Method signature for a callback function. | |
typedef rw::core::Event< PropertyListener, PropertyBase * > | ChangedEvent |
Type for changed property events. | |
Public Member Functions | |
PropertyBase (const std::string &identifier, const std::string &description) | |
Constructor. More... | |
PropertyBase (const std::string &identifier, const std::string &description, const PropertyType &type) | |
Constructor. More... | |
virtual | ~PropertyBase () |
Destroys PropertyBase. | |
const std::string & | getIdentifier () const |
Returns the Property identifier. More... | |
const std::string & | getDescription () const |
Returns description. More... | |
void | setDescription (const std::string &desc, bool fireChangedEvent=true) |
Set description. More... | |
virtual PropertyBase * | clone () const =0 |
Construct a clone of the property. | |
virtual PropertyValueBase & | getPropertyValue ()=0 |
returns reference to the property value More... | |
virtual const PropertyValueBase & | getPropertyValue () const =0 |
returns const reference to the property value More... | |
ChangedEvent & | changedEvent () |
get changed event More... | |
const rw::core::PropertyType & | getType () const |
Returns the PropertyType. More... | |
Base class for Property handling.
PropertyBase | ( | const std::string & | identifier, |
const std::string & | description | ||
) |
Constructor.
identifier | [in] identifier for the property |
description | [in] description of the property |
PropertyBase | ( | const std::string & | identifier, |
const std::string & | description, | ||
const PropertyType & | type | ||
) |
Constructor.
identifier | [in] identifier for the property |
description | [in] description of the property |
type | [in] type of the property |
|
inline |
get changed event
to add listener use: changedEvent().add(...)
const std::string& getDescription | ( | ) | const |
Returns description.
const std::string& getIdentifier | ( | ) | const |
Returns the Property identifier.
|
pure virtual |
returns const reference to the property value
Implemented in Property< T >, Property< rw::math::Vector3D<> >, Property< rw::core::PropertyMap >, and Property< bool >.
|
pure virtual |
returns reference to the property value
Implemented in Property< T >, Property< rw::math::Vector3D<> >, Property< rw::core::PropertyMap >, and Property< bool >.
const rw::core::PropertyType& getType | ( | ) | const |
Returns the PropertyType.
void setDescription | ( | const std::string & | desc, |
bool | fireChangedEvent = true |
||
) |
Set description.
desc | [in] the new description. |
fireChangedEvent | [in] (optional) fire changed event. |