Public Types | Public Member Functions | Protected Types | Protected Attributes | Private Attributes
rviz::Property< T > Class Template Reference

Base class for properties. More...

#include <property.h>

Inheritance diagram for rviz::Property< T >:
Inheritance graph
[legend]

List of all members.

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)
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 PropertyWidgetItemgetWidgetItem ()
 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_

Detailed Description

template<typename T>
class rviz::Property< T >

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.


Member Typedef Documentation

template<typename T>
typedef boost::function<T (void)> rviz::Property< T >::Getter

Definition at line 208 of file property.h.

template<typename T>
typedef boost::function<void (const T&)> rviz::Property< T >::Setter

Definition at line 209 of file property.h.

template<typename T>
typedef std::vector<std::string> rviz::Property< T >::V_string [protected]

Definition at line 341 of file property.h.


Constructor & Destructor Documentation

template<typename T>
rviz::Property< T >::Property ( const std::string &  name,
const std::string &  prefix,
const CategoryPropertyWPtr &  parent,
const Getter getter,
const Setter setter 
) [inline]

Constructor.

Parameters:
nameName of this property (eg, "Color")
prefixPrefix for this property (eg, "Head Laser Scan")
gridThe PropertyTreeWidget to use
parentThe parent to put this property under
getterGetter function/method. See boost::function and boost::bind for more information
setterSetter function/method. See boost::function and boost::bind for more information
Returns:

Definition at line 223 of file property.h.

template<typename T>
virtual rviz::Property< T >::~Property ( ) [inline, virtual]

Destructor

Definition at line 240 of file property.h.


Member Function Documentation

template<typename T>
virtual void rviz::Property< T >::addLegacyName ( const std::string &  name) [inline, virtual]

Implements rviz::PropertyBase.

Definition at line 298 of file property.h.

template<typename T>
T rviz::Property< T >::get ( ) [inline]

Get the current value.

Returns:
The current value

Definition at line 248 of file property.h.

template<typename T>
virtual std::string rviz::Property< T >::getName ( void  ) [inline, virtual]

Get the name of this property.

Returns:
The name of this property

Implements rviz::PropertyBase.

Definition at line 280 of file property.h.

template<typename T>
virtual CategoryPropertyWPtr rviz::Property< T >::getParent ( ) [inline, virtual]

Implements rviz::PropertyBase.

Definition at line 296 of file property.h.

template<typename T>
virtual std::string rviz::Property< T >::getPrefix ( ) [inline, virtual]

Get the prefix of this property.

Returns:
The prefix of this property

Implements rviz::PropertyBase.

Definition at line 285 of file property.h.

template<typename T>
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.

template<typename T>
virtual PropertyWidgetItem* rviz::Property< T >::getWidgetItem ( ) [inline, virtual]

Get the PropertyWidgetItem associated with this property.

Returns:
The PropertyWidgetItem

Implements rviz::PropertyBase.

Definition at line 291 of file property.h.

template<typename T>
bool rviz::Property< T >::hasGetter ( ) [inline]

Definition at line 263 of file property.h.

template<typename T>
bool rviz::Property< T >::hasSetter ( ) [inline]

Definition at line 264 of file property.h.

template<typename T>
void rviz::Property< T >::set ( const T &  val) [inline]

Set the value of this property.

Parameters:
valThe value

Definition at line 253 of file property.h.

template<typename T>
virtual void rviz::Property< T >::setHelpText ( const std::string &  text) [inline, virtual]

Definition at line 323 of file property.h.

template<typename T>
virtual void rviz::Property< T >::setPrefix ( const std::string &  prefix) [inline, virtual]

Implements rviz::PropertyBase.

Definition at line 329 of file property.h.

template<typename T>
void rviz::Property< T >::setSave ( bool  save) [inline]

Set whether we should save this property to disk or not.

Parameters:
saveIf true, this property will be saved to disk

Definition at line 270 of file property.h.

template<typename T>
virtual void rviz::Property< T >::setToDisabled ( ) [inline, virtual]

Reimplemented in rviz::QuaternionProperty, and rviz::Vector3Property.

Definition at line 318 of file property.h.

template<typename T>
virtual void rviz::Property< T >::setToError ( ) [inline, virtual]

Reimplemented in rviz::QuaternionProperty, and rviz::Vector3Property.

Definition at line 303 of file property.h.

template<typename T>
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.

template<typename T>
virtual void rviz::Property< T >::setToWarn ( ) [inline, virtual]

Reimplemented in rviz::QuaternionProperty, and rviz::Vector3Property.

Definition at line 308 of file property.h.


Member Data Documentation

template<typename T>
Getter rviz::Property< T >::getter_ [private]

Definition at line 347 of file property.h.

template<typename T>
std::string rviz::Property< T >::help_text_ [protected]

Definition at line 344 of file property.h.

template<typename T>
V_string rviz::Property< T >::legacy_names_ [protected]

Definition at line 342 of file property.h.

template<typename T>
std::string rviz::Property< T >::name_ [protected]

Definition at line 335 of file property.h.

template<typename T>
CategoryPropertyWPtr rviz::Property< T >::parent_ [protected]

Definition at line 337 of file property.h.

template<typename T>
std::string rviz::Property< T >::prefix_ [protected]

Definition at line 336 of file property.h.

template<typename T>
bool rviz::Property< T >::save_ [protected]

Definition at line 339 of file property.h.

template<typename T>
Setter rviz::Property< T >::setter_ [private]

Definition at line 348 of file property.h.


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


rviz
Author(s): Dave Hershberger, Josh Faust
autogenerated on Mon Jan 6 2014 11:54:33