Base class for properties. More...
#include <property.h>
Public Types | |
typedef boost::function< T(void)> | Getter |
typedef boost::function< void(const T &)> | Setter |
Public Member Functions | |
virtual void | addLegacyName (const std::string &name) |
T | get () |
Get the current value. | |
virtual std::string | getName () |
Get the name of this property. | |
virtual CategoryPropertyWPtr | getParent () |
virtual std::string | getPrefix () |
Get the prefix of this property. | |
bool | getSave () |
Returns whether or not this property should be saved to disk. | |
virtual PropertyWidgetItem * | getWidgetItem () |
Get the PropertyWidgetItem associated with this property. | |
bool | hasGetter () |
bool | hasSetter () |
Property (const std::string &name, const std::string &prefix, const CategoryPropertyWPtr &parent, const Getter &getter, const Setter &setter) | |
Constructor. | |
void | set (const T &val) |
Set the value of this property. | |
virtual void | setHelpText (const std::string &text) |
virtual void | setPrefix (const std::string &prefix) |
void | setSave (bool save) |
Set whether we should save this property to disk or not. | |
virtual void | setToDisabled () |
virtual void | setToError () |
virtual void | setToOK () |
virtual void | setToWarn () |
virtual | ~Property () |
Protected Types | |
typedef std::vector< std::string > | V_string |
Protected Attributes | |
std::string | help_text_ |
V_string | legacy_names_ |
std::string | name_ |
CategoryPropertyWPtr | parent_ |
std::string | prefix_ |
bool | save_ |
Private Attributes | |
Getter | getter_ |
Setter | setter_ |
Base class for properties.
The Property (and PropertyManager) interfaces abstract away the various things that must be done with properties, such as setting/getting the value in a PropertyTreeWidget, saving the property to disk, etc. Every property references a Getter and Setter, which it uses to get and set the value. Properties should not be created directly, rather they should be created through the PropertyManager class.
Definition at line 205 of file property.h.
typedef boost::function<T (void)> rviz::Property< T >::Getter |
Definition at line 208 of file property.h.
typedef boost::function<void (const T&)> rviz::Property< T >::Setter |
Definition at line 209 of file property.h.
typedef std::vector<std::string> rviz::Property< T >::V_string [protected] |
Definition at line 341 of file property.h.
rviz::Property< T >::Property | ( | const std::string & | name, |
const std::string & | prefix, | ||
const CategoryPropertyWPtr & | parent, | ||
const Getter & | getter, | ||
const Setter & | setter | ||
) | [inline] |
Constructor.
name | Name of this property (eg, "Color") |
prefix | Prefix for this property (eg, "Head Laser Scan") |
grid | The PropertyTreeWidget to use |
parent | The parent to put this property under |
getter | Getter function/method. See boost::function and boost::bind for more information |
setter | Setter function/method. See boost::function and boost::bind for more information |
Definition at line 223 of file property.h.
virtual rviz::Property< T >::~Property | ( | ) | [inline, virtual] |
Destructor
Definition at line 240 of file property.h.
virtual void rviz::Property< T >::addLegacyName | ( | const std::string & | name | ) | [inline, virtual] |
Implements rviz::PropertyBase.
Definition at line 298 of file property.h.
T rviz::Property< T >::get | ( | ) | [inline] |
virtual std::string rviz::Property< T >::getName | ( | void | ) | [inline, virtual] |
Get the name of this property.
Implements rviz::PropertyBase.
Definition at line 280 of file property.h.
virtual CategoryPropertyWPtr rviz::Property< T >::getParent | ( | ) | [inline, virtual] |
Implements rviz::PropertyBase.
Definition at line 296 of file property.h.
virtual std::string rviz::Property< T >::getPrefix | ( | ) | [inline, virtual] |
Get the prefix of this property.
Implements rviz::PropertyBase.
Definition at line 285 of file property.h.
bool rviz::Property< T >::getSave | ( | ) | [inline, virtual] |
Returns whether or not this property should be saved to disk.
Implements rviz::PropertyBase.
Definition at line 274 of file property.h.
virtual PropertyWidgetItem* rviz::Property< T >::getWidgetItem | ( | ) | [inline, virtual] |
Get the PropertyWidgetItem associated with this property.
Implements rviz::PropertyBase.
Definition at line 291 of file property.h.
bool rviz::Property< T >::hasGetter | ( | ) | [inline] |
Definition at line 263 of file property.h.
bool rviz::Property< T >::hasSetter | ( | ) | [inline] |
Definition at line 264 of file property.h.
void rviz::Property< T >::set | ( | const T & | val | ) | [inline] |
virtual void rviz::Property< T >::setHelpText | ( | const std::string & | text | ) | [inline, virtual] |
Definition at line 323 of file property.h.
virtual void rviz::Property< T >::setPrefix | ( | const std::string & | prefix | ) | [inline, virtual] |
Implements rviz::PropertyBase.
Definition at line 329 of file property.h.
void rviz::Property< T >::setSave | ( | bool | save | ) | [inline] |
Set whether we should save this property to disk or not.
save | If true, this property will be saved to disk |
Definition at line 270 of file property.h.
virtual void rviz::Property< T >::setToDisabled | ( | ) | [inline, virtual] |
Reimplemented in rviz::QuaternionProperty, and rviz::Vector3Property.
Definition at line 318 of file property.h.
virtual void rviz::Property< T >::setToError | ( | ) | [inline, virtual] |
Reimplemented in rviz::QuaternionProperty, and rviz::Vector3Property.
Definition at line 303 of file property.h.
virtual void rviz::Property< T >::setToOK | ( | ) | [inline, virtual] |
Reimplemented in rviz::QuaternionProperty, rviz::Vector3Property, and rviz::CategoryProperty.
Definition at line 313 of file property.h.
virtual void rviz::Property< T >::setToWarn | ( | ) | [inline, virtual] |
Reimplemented in rviz::QuaternionProperty, and rviz::Vector3Property.
Definition at line 308 of file property.h.
Getter rviz::Property< T >::getter_ [private] |
Definition at line 347 of file property.h.
std::string rviz::Property< T >::help_text_ [protected] |
Definition at line 344 of file property.h.
V_string rviz::Property< T >::legacy_names_ [protected] |
Definition at line 342 of file property.h.
std::string rviz::Property< T >::name_ [protected] |
Definition at line 335 of file property.h.
CategoryPropertyWPtr rviz::Property< T >::parent_ [protected] |
Definition at line 337 of file property.h.
std::string rviz::Property< T >::prefix_ [protected] |
Definition at line 336 of file property.h.
bool rviz::Property< T >::save_ [protected] |
Definition at line 339 of file property.h.
Setter rviz::Property< T >::setter_ [private] |
Definition at line 348 of file property.h.