Signals | Public Member Functions | Protected Types | Protected Attributes
rviz::PropertyManager Class Reference

Manages a set of properties. More...

#include <property_manager.h>

List of all members.

Signals

void configChanged ()
 Emitted when changes occur which would show up in a config file.

Public Member Functions

void addProperty (const PropertyBasePtr &property, const std::string &name, const std::string &prefix, void *user_data)
void changePrefix (const std::string &old_prefix, const std::string &new_prefix)
 rename a property
void clear ()
CategoryPropertyWPtr createCategory (const std::string &name, const std::string &prefix, const CategoryPropertyWPtr &parent=CategoryPropertyWPtr(), void *user_data=NULL)
 Create a category property.
CategoryPropertyWPtr createCheckboxCategory (const std::string &label, const std::string &name, const std::string &prefix, const boost::function< bool(void)> &getter, const boost::function< void(bool)> &setter, const CategoryPropertyWPtr &parent=CategoryPropertyWPtr(), void *user_data=NULL)
template<typename T , typename G , typename S >
boost::weak_ptr< T > createProperty (const std::string &name, const std::string &prefix, const G &getter, const S &setter, const CategoryPropertyWPtr &parent, void *user_data=NULL)
 Create a property.
StatusPropertyWPtr createStatus (const std::string &name, const std::string &prefix, const CategoryPropertyWPtr &parent=CategoryPropertyWPtr(), void *user_data=NULL)
void deleteByUserData (void *user_data)
 Delete all properties that have a given user data.
void deleteChildren (const PropertyBasePtr &property)
 Delete all the children of a property.
void deleteProperty (const PropertyBasePtr &property)
 Delete a property.
void deleteProperty (const std::string &name, const std::string &prefix)
 Delete a property, by name/prefix.
void emitConfigChanged ()
 Emit the configChanged() signal.
PropertyTreeWidgetgetPropertyTreeWidget ()
 Get the property grid used by this manager.
bool hasProperty (const std::string &name, const std::string &prefix)
void load (const boost::shared_ptr< Config > &config, const StatusCallback &cb=StatusCallback())
 Load all existing properties' values from a Config.
 PropertyManager ()
 Constructor.
void propertySet (const PropertyBasePtr &property)
 Called when a property has been set (ie, Property::changed() has been called)
void refreshAll ()
void save (const boost::shared_ptr< Config > &config)
 Save all properties into a Config.
void setDefaultUserData (void *data)
void setPropertyTreeWidget (PropertyTreeWidget *grid)
void update ()
 ~PropertyManager ()
 Destructor.

Protected Types

typedef std::map< std::pair
< std::string, std::string >
, PropertyBasePtr > 
M_Property
typedef std::set
< PropertyBaseWPtr > 
S_PropertyBaseWPtr

Protected Attributes

boost::mutex changed_mutex_
S_PropertyBaseWPtr changed_properties_
boost::shared_ptr< Configconfig_
void * default_user_data_
PropertyTreeWidgetgrid_
M_Property properties_

Detailed Description

Manages a set of properties.

The PropertyManager manages a set of properties, allowing you to create, delete, and load/save them from disk

Definition at line 57 of file property_manager.h.


Member Typedef Documentation

typedef std::map< std::pair<std::string, std::string>, PropertyBasePtr > rviz::PropertyManager::M_Property [protected]

Definition at line 175 of file property_manager.h.

typedef std::set<PropertyBaseWPtr> rviz::PropertyManager::S_PropertyBaseWPtr [protected]

Definition at line 179 of file property_manager.h.


Constructor & Destructor Documentation

Constructor.

Parameters:
gridThe property grid to be associated with these properties

Definition at line 41 of file property_manager.cpp.

Destructor.

Definition at line 47 of file property_manager.cpp.


Member Function Documentation

void rviz::PropertyManager::addProperty ( const PropertyBasePtr &  property,
const std::string &  name,
const std::string &  prefix,
void *  user_data 
)

Definition at line 52 of file property_manager.cpp.

void rviz::PropertyManager::changePrefix ( const std::string &  old_prefix,
const std::string &  new_prefix 
)

rename a property

Definition at line 199 of file property_manager.cpp.

Definition at line 390 of file property_manager.cpp.

Emitted when changes occur which would show up in a config file.

CategoryPropertyWPtr rviz::PropertyManager::createCategory ( const std::string &  name,
const std::string &  prefix,
const CategoryPropertyWPtr &  parent = CategoryPropertyWPtr(),
void *  user_data = NULL 
)

Create a category property.

Parameters:
nameName of the category
parentParent category (may be NULL)
Returns:
The new category property

Definition at line 92 of file property_manager.cpp.

CategoryPropertyWPtr rviz::PropertyManager::createCheckboxCategory ( const std::string &  label,
const std::string &  name,
const std::string &  prefix,
const boost::function< bool(void)> &  getter,
const boost::function< void(bool)> &  setter,
const CategoryPropertyWPtr &  parent = CategoryPropertyWPtr(),
void *  user_data = NULL 
)

Definition at line 101 of file property_manager.cpp.

template<typename T , typename G , typename S >
boost::weak_ptr<T> rviz::PropertyManager::createProperty ( const std::string &  name,
const std::string &  prefix,
const G &  getter,
const S &  setter,
const CategoryPropertyWPtr &  parent,
void *  user_data = NULL 
) [inline]

Create a property.

Parameters:
nameName of the property (eg, "Color")
prefixPrefix for the property (eg, "Head Laser Scan")
getterGetter object (see boost::function and boost::bind). Must be compatible with Property<T>::Getter
setterSetter object (see boost::function and boost::bind). Must be compatible with Property<T>::Setter
parentParent category
user_dataUser data to associate with the created property
Returns:
The new property

Definition at line 82 of file property_manager.h.

StatusPropertyWPtr rviz::PropertyManager::createStatus ( const std::string &  name,
const std::string &  prefix,
const CategoryPropertyWPtr &  parent = CategoryPropertyWPtr(),
void *  user_data = NULL 
)

Definition at line 84 of file property_manager.cpp.

void rviz::PropertyManager::deleteByUserData ( void *  user_data)

Delete all properties that have a given user data.

Parameters:
user_dataThe user data to compare against

Definition at line 273 of file property_manager.cpp.

void rviz::PropertyManager::deleteChildren ( const PropertyBasePtr &  property)

Delete all the children of a property.

Parameters:
propertyThe property whose children to delete

Definition at line 241 of file property_manager.cpp.

void rviz::PropertyManager::deleteProperty ( const PropertyBasePtr &  property)

Delete a property.

Parameters:
propertyThe property to delete

Definition at line 147 of file property_manager.cpp.

void rviz::PropertyManager::deleteProperty ( const std::string &  name,
const std::string &  prefix 
)

Delete a property, by name/prefix.

Parameters:
nameName of the property
prefixPrefix of the property

Definition at line 177 of file property_manager.cpp.

Emit the configChanged() signal.

Definition at line 308 of file property_manager.cpp.

Get the property grid used by this manager.

Returns:
A pointer to the property grid

Definition at line 150 of file property_manager.h.

bool rviz::PropertyManager::hasProperty ( const std::string &  name,
const std::string &  prefix 
) [inline]

Definition at line 105 of file property_manager.h.

void rviz::PropertyManager::load ( const boost::shared_ptr< Config > &  config,
const StatusCallback cb = StatusCallback() 
)

Load all existing properties' values from a Config.

Parameters:
configThe config to load from

Definition at line 328 of file property_manager.cpp.

void rviz::PropertyManager::propertySet ( const PropertyBasePtr &  property)

Called when a property has been set (ie, Property::changed() has been called)

Parameters:
propertyThe property that was set

Definition at line 301 of file property_manager.cpp.

Definition at line 376 of file property_manager.cpp.

void rviz::PropertyManager::save ( const boost::shared_ptr< Config > &  config)

Save all properties into a Config.

Parameters:
configThe config to save to

Definition at line 313 of file property_manager.cpp.

void rviz::PropertyManager::setDefaultUserData ( void *  data) [inline]

Definition at line 159 of file property_manager.h.

Definition at line 359 of file property_manager.cpp.

Definition at line 110 of file property_manager.cpp.


Member Data Documentation

boost::mutex rviz::PropertyManager::changed_mutex_ [protected]

Definition at line 178 of file property_manager.h.

Definition at line 180 of file property_manager.h.

boost::shared_ptr<Config> rviz::PropertyManager::config_ [protected]

Definition at line 184 of file property_manager.h.

Definition at line 182 of file property_manager.h.

Definition at line 173 of file property_manager.h.

Definition at line 176 of file property_manager.h.


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


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