Manages a set of properties. More...
#include <property_manager.h>
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 std::string &name, const std::string &prefix) |
| Delete a property, by name/prefix. | |
| void | deleteProperty (const PropertyBasePtr &property) |
| Delete a property. | |
| wxPropertyGrid * | getPropertyGrid () |
| Get the property grid used by this manager. | |
| bool | hasProperty (const std::string &name, const std::string &prefix) |
| void | load (const boost::shared_ptr< wxConfigBase > &config, const StatusCallback &cb=StatusCallback()) |
| Load all existing properties' values from a wxConfig. | |
| void | propertyChanged (wxPropertyGridEvent &event) |
| Called when a property in the property grid has changed. | |
| void | propertyChanging (wxPropertyGridEvent &event) |
| Called when a property in the property grid is changing. | |
| 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< wxConfigBase > &config) |
| Save all properties into a wxConfig. | |
| void | setDefaultUserData (void *data) |
| void | setPropertyGrid (wxPropertyGrid *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< wxConfigBase > | config_ |
| void * | default_user_data_ |
| wxPropertyGrid * | grid_ |
| M_Property | properties_ |
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.
typedef std::map< std::pair<std::string, std::string>, PropertyBasePtr > rviz::PropertyManager::M_Property [protected] |
Definition at line 178 of file property_manager.h.
typedef std::set<PropertyBaseWPtr> rviz::PropertyManager::S_PropertyBaseWPtr [protected] |
Definition at line 182 of file property_manager.h.
| rviz::PropertyManager::PropertyManager | ( | ) |
Constructor.
| grid | The property grid to be associated with these properties |
Definition at line 42 of file property_manager.cpp.
| rviz::PropertyManager::~PropertyManager | ( | ) |
Destructor.
Definition at line 48 of file property_manager.cpp.
| void rviz::PropertyManager::addProperty | ( | const PropertyBasePtr & | property, | |
| const std::string & | name, | |||
| const std::string & | prefix, | |||
| void * | user_data | |||
| ) |
Definition at line 53 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 220 of file property_manager.cpp.
| void rviz::PropertyManager::clear | ( | ) |
Definition at line 430 of file property_manager.cpp.
| CategoryPropertyWPtr rviz::PropertyManager::createCategory | ( | const std::string & | name, | |
| const std::string & | prefix, | |||
| const CategoryPropertyWPtr & | parent = CategoryPropertyWPtr(), |
|||
| void * | user_data = NULL | |||
| ) |
Create a category property.
| name | Name of the category | |
| parent | Parent category (may be NULL) |
Definition at line 87 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 96 of file property_manager.cpp.
| 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.
| name | Name of the property (eg, "Color") | |
| prefix | Prefix for the property (eg, "Head Laser Scan") | |
| getter | Getter object (see boost::function and boost::bind). Must be compatible with Property<T>::Getter | |
| setter | Setter object (see boost::function and boost::bind). Must be compatible with Property<T>::Setter | |
| parent | Parent category | |
| user_data | User data to associate with the created property |
Definition at line 81 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 79 of file property_manager.cpp.
| void rviz::PropertyManager::deleteByUserData | ( | void * | user_data | ) |
Delete all properties that have a given user data.
| user_data | The user data to compare against |
Definition at line 294 of file property_manager.cpp.
| void rviz::PropertyManager::deleteChildren | ( | const PropertyBasePtr & | property | ) |
Delete all the children of a property.
| property | The property whose children to delete |
Definition at line 252 of file property_manager.cpp.
| void rviz::PropertyManager::deleteProperty | ( | const std::string & | name, | |
| const std::string & | prefix | |||
| ) |
Delete a property, by name/prefix.
| name | Name of the property | |
| prefix | Prefix of the property |
Definition at line 199 of file property_manager.cpp.
| void rviz::PropertyManager::deleteProperty | ( | const PropertyBasePtr & | property | ) |
Delete a property.
| property | The property to delete |
Definition at line 172 of file property_manager.cpp.
| wxPropertyGrid* rviz::PropertyManager::getPropertyGrid | ( | ) | [inline] |
Get the property grid used by this manager.
Definition at line 160 of file property_manager.h.
| bool rviz::PropertyManager::hasProperty | ( | const std::string & | name, | |
| const std::string & | prefix | |||
| ) | [inline] |
Definition at line 104 of file property_manager.h.
| void rviz::PropertyManager::load | ( | const boost::shared_ptr< wxConfigBase > & | config, | |
| const StatusCallback & | cb = StatusCallback() | |||
| ) |
Load all existing properties' values from a wxConfig.
| config | The config to load from |
Definition at line 372 of file property_manager.cpp.
| void rviz::PropertyManager::propertyChanged | ( | wxPropertyGridEvent & | event | ) |
Called when a property in the property grid has changed.
| event | The event |
Definition at line 337 of file property_manager.cpp.
| void rviz::PropertyManager::propertyChanging | ( | wxPropertyGridEvent & | event | ) |
Called when a property in the property grid is changing.
| event | The event |
Definition at line 332 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).
| property | The property that was set |
Definition at line 350 of file property_manager.cpp.
| void rviz::PropertyManager::refreshAll | ( | ) |
Definition at line 416 of file property_manager.cpp.
| void rviz::PropertyManager::save | ( | const boost::shared_ptr< wxConfigBase > & | config | ) |
Save all properties into a wxConfig.
| config | The config to save to |
Definition at line 357 of file property_manager.cpp.
| void rviz::PropertyManager::setDefaultUserData | ( | void * | data | ) | [inline] |
Definition at line 169 of file property_manager.h.
| void rviz::PropertyManager::setPropertyGrid | ( | wxPropertyGrid * | grid | ) |
Definition at line 398 of file property_manager.cpp.
| void rviz::PropertyManager::update | ( | ) |
Definition at line 105 of file property_manager.cpp.
boost::mutex rviz::PropertyManager::changed_mutex_ [protected] |
Definition at line 181 of file property_manager.h.
Definition at line 183 of file property_manager.h.
boost::shared_ptr<wxConfigBase> rviz::PropertyManager::config_ [protected] |
Definition at line 187 of file property_manager.h.
void* rviz::PropertyManager::default_user_data_ [protected] |
Definition at line 185 of file property_manager.h.
wxPropertyGrid* rviz::PropertyManager::grid_ [protected] |
Definition at line 176 of file property_manager.h.
M_Property rviz::PropertyManager::properties_ [protected] |
Definition at line 179 of file property_manager.h.