Class to manage properties of an object and to provide convenience methods for easy access and manipulation. More...
#include <WProperties.h>
Public Types | |
typedef boost::shared_ptr < WProperties > | SPtr |
shared pointer to object of this type | |
typedef boost::shared_ptr < const WProperties > | ConstSPtr |
const shared pointer to object of this type | |
typedef WProperties * | Ptr |
pointer to object of this type | |
typedef const WProperties * | ConstPtr |
const pointer to object of this type | |
typedef WProperties & | Ref |
ref to object of this type | |
typedef const WProperties & | ConstRef |
const ref to object of this type | |
typedef std::vector < boost::shared_ptr < WPropertyBase > > | PropertyContainerType |
For shortening: a type defining a shared vector of WSubject pointers. | |
typedef WSharedSequenceContainer < PropertyContainerType > | PropertySharedContainerType |
The alias for a shared container. | |
typedef PropertyContainerType::const_iterator | PropertyConstIterator |
The const iterator type of the container. | |
typedef PropertyContainerType::iterator | PropertyIterator |
The iterator type of the container. | |
Public Member Functions | |
WProperties (std::string name="unnamed group", std::string description="an unnamed group of properties") | |
Constructor. | |
WProperties (const WProperties &from) | |
Copy constructor. | |
virtual | ~WProperties () |
destructor | |
virtual boost::shared_ptr < WPropertyBase > | clone () |
This method clones a property and returns the clone. | |
template<typename PropType > | |
PropType | addProperty (PropType prop) |
Simply insert the specified property to the list. | |
void | removeProperty (boost::shared_ptr< WPropertyBase > prop) |
Simply remove the specified property from the list. | |
bool | existsProperty (std::string name) |
Helper function that finds a property by its name. | |
boost::shared_ptr< WPropertyBase > | getProperty (std::string name) |
Function searches the property. | |
PropertySharedContainerType::ReadTicket | getProperties () const |
Returns a read ticket for read-access to the list of properties. | |
PropertySharedContainerType::ReadTicket | getReadTicket () const |
Returns an read ticket for the properties. | |
boost::shared_ptr< WPropertyBase > | findProperty (std::string name) const |
Searches the property with a given name. | |
virtual void | clear () |
Removes all properties from the list. | |
WPropGroup | addPropertyGroup (std::string name, std::string description, bool hide=false) |
Create and add a new property group. | |
template<typename T > | |
boost::shared_ptr < WPropertyVariable< T > > | addProperty (std::string name, std::string description, const T &initial, bool hide=false) |
Create and add a new property of the template type. | |
template<typename T > | |
boost::shared_ptr < WPropertyVariable< T > > | addProperty (std::string name, std::string description, const T &initial, boost::shared_ptr< WCondition > condition, bool hide=false) |
Create and add a new property of the template type. | |
template<typename T > | |
boost::shared_ptr < WPropertyVariable< T > > | addProperty (std::string name, std::string description, const T &initial, WPropertyBase::PropertyChangeNotifierType notifier, bool hide=false) |
Create and add a new property of the template type. | |
template<typename T > | |
boost::shared_ptr < WPropertyVariable< T > > | addProperty (std::string name, std::string description, const T &initial, boost::shared_ptr< WCondition > condition, WPropertyBase::PropertyChangeNotifierType notifier, bool hide=false) |
Create and add a new property of the template type. | |
virtual PROPERTY_TYPE | getType () const |
Gets the real type of this instance. | |
virtual bool | setAsString (std::string value) |
This methods allows properties to be set by a string value. | |
virtual std::string | getAsString () |
Returns the current value as a string. | |
virtual bool | set (boost::shared_ptr< WPropertyBase > value) |
Sets the value from the specified property to this one. | |
WPropBool | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_BOOL &initial, bool hide=false) |
Create and add a new property of the template type. | |
WPropInt | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_INT &initial, bool hide=false) |
Create and add a new property of the template type. | |
WPropDouble | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_DOUBLE &initial, bool hide=false) |
Create and add a new property of the template type. | |
WPropString | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_STRING &initial, bool hide=false) |
Create and add a new property of the template type. | |
WPropFilename | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_PATH &initial, bool hide=false) |
Create and add a new property of the template type. | |
WPropSelection | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_SELECTION &initial, bool hide=false) |
Create and add a new property of the template type. | |
WPropPosition | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_POSITION &initial, bool hide=false) |
Create and add a new property of the template type. | |
WPropColor | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_COLOR &initial, bool hide=false) |
Create and add a new property of the template type. | |
WPropTrigger | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_TRIGGER &initial, bool hide=false) |
Create and add a new property of the template type. | |
WPropBool | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_BOOL &initial, boost::shared_ptr< WCondition > condition, bool hide=false) |
Create and add a new property of the template type. | |
WPropInt | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_INT &initial, boost::shared_ptr< WCondition > condition, bool hide=false) |
Create and add a new property of the template type. | |
WPropDouble | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_DOUBLE &initial, boost::shared_ptr< WCondition > condition, bool hide=false) |
Create and add a new property of the template type. | |
WPropString | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_STRING &initial, boost::shared_ptr< WCondition > condition, bool hide=false) |
Create and add a new property of the template type. | |
WPropFilename | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_PATH &initial, boost::shared_ptr< WCondition > condition, bool hide=false) |
Create and add a new property of the template type. | |
WPropSelection | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_SELECTION &initial, boost::shared_ptr< WCondition > condition, bool hide=false) |
Create and add a new property of the template type. | |
WPropPosition | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_POSITION &initial, boost::shared_ptr< WCondition > condition, bool hide=false) |
Create and add a new property of the template type. | |
WPropColor | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_COLOR &initial, boost::shared_ptr< WCondition > condition, bool hide=false) |
Create and add a new property of the template type. | |
WPropTrigger | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_TRIGGER &initial, boost::shared_ptr< WCondition > condition, bool hide=false) |
Create and add a new property of the template type. | |
WPropBool | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_BOOL &initial, WPropertyBase::PropertyChangeNotifierType notifier, bool hide=false) |
Create and add a new property of the template type. | |
WPropInt | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_INT &initial, WPropertyBase::PropertyChangeNotifierType notifier, bool hide=false) |
Create and add a new property of the template type. | |
WPropDouble | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_DOUBLE &initial, WPropertyBase::PropertyChangeNotifierType notifier, bool hide=false) |
Create and add a new property of the template type. | |
WPropString | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_STRING &initial, WPropertyBase::PropertyChangeNotifierType notifier, bool hide=false) |
Create and add a new property of the template type. | |
WPropFilename | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_PATH &initial, WPropertyBase::PropertyChangeNotifierType notifier, bool hide=false) |
Create and add a new property of the template type. | |
WPropSelection | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_SELECTION &initial, WPropertyBase::PropertyChangeNotifierType notifier, bool hide=false) |
Create and add a new property of the template type. | |
WPropPosition | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_POSITION &initial, WPropertyBase::PropertyChangeNotifierType notifier, bool hide=false) |
Create and add a new property of the template type. | |
WPropColor | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_COLOR &initial, WPropertyBase::PropertyChangeNotifierType notifier, bool hide=false) |
Create and add a new property of the template type. | |
WPropTrigger | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_TRIGGER &initial, WPropertyBase::PropertyChangeNotifierType notifier, bool hide=false) |
Create and add a new property of the template type. | |
WPropBool | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_BOOL &initial, boost::shared_ptr< WCondition > condition, WPropertyBase::PropertyChangeNotifierType notifier, bool hide=false) |
Create and add a new property of the template type. | |
WPropInt | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_INT &initial, boost::shared_ptr< WCondition > condition, WPropertyBase::PropertyChangeNotifierType notifier, bool hide=false) |
Create and add a new property of the template type. | |
WPropDouble | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_DOUBLE &initial, boost::shared_ptr< WCondition > condition, WPropertyBase::PropertyChangeNotifierType notifier, bool hide=false) |
Create and add a new property of the template type. | |
WPropString | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_STRING &initial, boost::shared_ptr< WCondition > condition, WPropertyBase::PropertyChangeNotifierType notifier, bool hide=false) |
Create and add a new property of the template type. | |
WPropFilename | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_PATH &initial, boost::shared_ptr< WCondition > condition, WPropertyBase::PropertyChangeNotifierType notifier, bool hide=false) |
Create and add a new property of the template type. | |
WPropSelection | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_SELECTION &initial, boost::shared_ptr< WCondition > condition, WPropertyBase::PropertyChangeNotifierType notifier, bool hide=false) |
Create and add a new property of the template type. | |
WPropPosition | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_POSITION &initial, boost::shared_ptr< WCondition > condition, WPropertyBase::PropertyChangeNotifierType notifier, bool hide=false) |
Create and add a new property of the template type. | |
WPropColor | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_COLOR &initial, boost::shared_ptr< WCondition > condition, WPropertyBase::PropertyChangeNotifierType notifier, bool hide=false) |
Create and add a new property of the template type. | |
WPropTrigger | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_TRIGGER &initial, boost::shared_ptr< WCondition > condition, WPropertyBase::PropertyChangeNotifierType notifier, bool hide=false) |
Create and add a new property of the template type. | |
virtual boost::shared_ptr < WCondition > | getChildUpdateCondition () const |
This returns the condition fired whenever one children fires its update condition. | |
Protected Member Functions | |
boost::shared_ptr< WPropertyBase > | findProperty (const WProperties *const props, std::string name) const |
Helping function to find a property inside a specific group. | |
Private Member Functions | |
bool | propNamePredicate (boost::shared_ptr< WPropertyBase > prop1, boost::shared_ptr< WPropertyBase > prop2) const |
Compares the names of two properties and returns true if they are equal. | |
Private Attributes | |
PropertySharedContainerType | m_properties |
The set of proerties. | |
boost::shared_ptr< WConditionSet > | m_childUpdateCondition |
Condition notified whenever a property inside this group fires its WPropertyBase::m_updateCondition. | |
Friends | |
class | WPropertiesTest |
Class to manage properties of an object and to provide convenience methods for easy access and manipulation.
It also allows thread safe iteration on its elements. The main purpose of this class is to group properties together and to allow searching properties by a given name. The name of each property in a group has to be unique and is constructed using the group names containing them: hello/you/property is the property with the name "property" in the group "you" which against is in the group "hello".
Definition at line 53 of file WProperties.h.
typedef const WProperties* WProperties::ConstPtr |
const pointer to object of this type
Definition at line 62 of file WProperties.h.
typedef const WProperties& WProperties::ConstRef |
const ref to object of this type
Definition at line 64 of file WProperties.h.
typedef boost::shared_ptr< const WProperties > WProperties::ConstSPtr |
const shared pointer to object of this type
Reimplemented from WPropertyBase.
Definition at line 60 of file WProperties.h.
typedef PropertyContainerType::const_iterator WProperties::PropertyConstIterator |
The const iterator type of the container.
Definition at line 79 of file WProperties.h.
typedef std::vector< boost::shared_ptr< WPropertyBase > > WProperties::PropertyContainerType |
For shortening: a type defining a shared vector of WSubject pointers.
Definition at line 69 of file WProperties.h.
typedef PropertyContainerType::iterator WProperties::PropertyIterator |
The iterator type of the container.
Definition at line 84 of file WProperties.h.
The alias for a shared container.
Definition at line 74 of file WProperties.h.
typedef WProperties* WProperties::Ptr |
pointer to object of this type
Definition at line 61 of file WProperties.h.
typedef WProperties& WProperties::Ref |
ref to object of this type
Definition at line 63 of file WProperties.h.
typedef boost::shared_ptr< WProperties > WProperties::SPtr |
shared pointer to object of this type
Reimplemented from WPropertyBase.
Definition at line 59 of file WProperties.h.
WProperties::WProperties | ( | std::string | name = "unnamed group" , |
|
std::string | description = "an unnamed group of properties" | |||
) |
Constructor.
Creates an empty list of properties.
name | the name of the property group. The GUI is using this name for naming the tabs/group boxes | |
description | the description of the group. |
Definition at line 41 of file WProperties.cpp.
References WSharedObject< T >::getChangeCondition(), m_properties, and WPropertyBase::m_updateCondition.
Referenced by addPropertyGroup(), and clone().
WProperties::WProperties | ( | const WProperties & | from | ) | [explicit] |
Copy constructor.
Creates a deep copy of this property. As boost::signals2 and condition variables are non-copyable, new instances get created. The subscriptions to a signal are LOST as well as all listeners to a condition. The conditions you can grab using getValueChangeConditon and getCondition are not the same as in the original! This is because the class corresponds to the observer/observable pattern. You won't expect a clone to fire a condition if a original flag is changed (which after cloning is completely decoupled from the clone).
from | the instance to copy. |
Definition at line 53 of file WProperties.cpp.
References addProperty(), WSharedObject< T >::getChangeCondition(), WSharedObject< T >::getReadTicket(), m_properties, and WPropertyBase::m_updateCondition.
WProperties::~WProperties | ( | ) | [virtual] |
destructor
Definition at line 49 of file WProperties.cpp.
PropType WProperties::addProperty | ( | PropType | prop | ) |
Simply insert the specified property to the list.
prop | the property to add |
Definition at line 976 of file WProperties.h.
References WPropertyBase::getName(), WPropertyBase::getPurpose(), WSharedObject< T >::getWriteTicket(), m_childUpdateCondition, m_properties, and propNamePredicate().
Referenced by addProperty(), addPropertyGroup(), and WProperties().
boost::shared_ptr< WPropertyVariable< T > > WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const T & | initial, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable.
name | the property name | |
description | the property description | |
initial | the initial value | |
hide | set to true to set the hide flag directly. |
Definition at line 1017 of file WProperties.h.
References addProperty().
WPropBool WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const WPVBaseTypes::PV_BOOL & | initial, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable.
name | the property name | |
description | the property description | |
initial | the initial value | |
hide | set to true to set the hide flag directly. |
Definition at line 329 of file WProperties.cpp.
WPropFilename WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const WPVBaseTypes::PV_PATH & | initial, | |||
boost::shared_ptr< WCondition > | condition, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable.
name | the property name | |
description | the property description | |
initial | the initial value | |
condition | use this external condition for notification. | |
hide | set to true to set the hide flag directly. |
Definition at line 405 of file WProperties.cpp.
WPropTrigger WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const WPVBaseTypes::PV_TRIGGER & | initial, | |||
boost::shared_ptr< WCondition > | condition, | |||
WPropertyBase::PropertyChangeNotifierType | notifier, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable.
name | the property name | |
description | the property description | |
initial | the initial value | |
notifier | use this notifier for change callbacks. | |
condition | use this external condition for notification | |
hide | set to true to set the hide flag directly. |
Definition at line 560 of file WProperties.cpp.
WPropColor WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const WPVBaseTypes::PV_COLOR & | initial, | |||
boost::shared_ptr< WCondition > | condition, | |||
WPropertyBase::PropertyChangeNotifierType | notifier, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable.
name | the property name | |
description | the property description | |
initial | the initial value | |
notifier | use this notifier for change callbacks. | |
condition | use this external condition for notification | |
hide | set to true to set the hide flag directly. |
Definition at line 553 of file WProperties.cpp.
WPropSelection WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const WPVBaseTypes::PV_SELECTION & | initial, | |||
boost::shared_ptr< WCondition > | condition, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable.
name | the property name | |
description | the property description | |
initial | the initial value | |
condition | use this external condition for notification. | |
hide | set to true to set the hide flag directly. |
Definition at line 411 of file WProperties.cpp.
WPropSelection WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const WPVBaseTypes::PV_SELECTION & | initial, | |||
boost::shared_ptr< WCondition > | condition, | |||
WPropertyBase::PropertyChangeNotifierType | notifier, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable.
name | the property name | |
description | the property description | |
initial | the initial value | |
notifier | use this notifier for change callbacks. | |
condition | use this external condition for notification | |
hide | set to true to set the hide flag directly. |
Definition at line 539 of file WProperties.cpp.
WPropFilename WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const WPVBaseTypes::PV_PATH & | initial, | |||
boost::shared_ptr< WCondition > | condition, | |||
WPropertyBase::PropertyChangeNotifierType | notifier, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable.
name | the property name | |
description | the property description | |
initial | the initial value | |
notifier | use this notifier for change callbacks. | |
condition | use this external condition for notification | |
hide | set to true to set the hide flag directly. |
Definition at line 532 of file WProperties.cpp.
WPropString WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const WPVBaseTypes::PV_STRING & | initial, | |||
boost::shared_ptr< WCondition > | condition, | |||
WPropertyBase::PropertyChangeNotifierType | notifier, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable.
name | the property name | |
description | the property description | |
initial | the initial value | |
notifier | use this notifier for change callbacks. | |
condition | use this external condition for notification | |
hide | set to true to set the hide flag directly. |
Definition at line 525 of file WProperties.cpp.
WPropPosition WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const WPVBaseTypes::PV_POSITION & | initial, | |||
boost::shared_ptr< WCondition > | condition, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable.
name | the property name | |
description | the property description | |
initial | the initial value | |
condition | use this external condition for notification. | |
hide | set to true to set the hide flag directly. |
Definition at line 417 of file WProperties.cpp.
WPropInt WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const WPVBaseTypes::PV_INT & | initial, | |||
boost::shared_ptr< WCondition > | condition, | |||
WPropertyBase::PropertyChangeNotifierType | notifier, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable. It also sets the min and max constraint to [0,100].
name | the property name | |
description | the property description | |
initial | the initial value | |
notifier | use this notifier for change callbacks. | |
condition | use this external condition for notification | |
hide | set to true to set the hide flag directly. |
Definition at line 511 of file WProperties.cpp.
WPropBool WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const WPVBaseTypes::PV_BOOL & | initial, | |||
boost::shared_ptr< WCondition > | condition, | |||
WPropertyBase::PropertyChangeNotifierType | notifier, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable.
name | the property name | |
description | the property description | |
initial | the initial value | |
notifier | use this notifier for change callbacks. | |
condition | use this external condition for notification | |
hide | set to true to set the hide flag directly. |
Definition at line 504 of file WProperties.cpp.
WPropTrigger WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const WPVBaseTypes::PV_TRIGGER & | initial, | |||
WPropertyBase::PropertyChangeNotifierType | notifier, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable.
name | the property name | |
description | the property description | |
initial | the initial value | |
notifier | use this notifier for change callbacks. | |
hide | set to true to set the hide flag directly. |
Definition at line 490 of file WProperties.cpp.
WPropColor WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const WPVBaseTypes::PV_COLOR & | initial, | |||
boost::shared_ptr< WCondition > | condition, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable.
name | the property name | |
description | the property description | |
initial | the initial value | |
condition | use this external condition for notification. | |
hide | set to true to set the hide flag directly. |
Definition at line 423 of file WProperties.cpp.
WPropPosition WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const WPVBaseTypes::PV_POSITION & | initial, | |||
WPropertyBase::PropertyChangeNotifierType | notifier, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable.
name | the property name | |
description | the property description | |
initial | the initial value | |
notifier | use this notifier for change callbacks. | |
hide | set to true to set the hide flag directly. |
Definition at line 478 of file WProperties.cpp.
WPropTrigger WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const WPVBaseTypes::PV_TRIGGER & | initial, | |||
boost::shared_ptr< WCondition > | condition, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable.
name | the property name | |
description | the property description | |
initial | the initial value | |
condition | use this external condition for notification. | |
hide | set to true to set the hide flag directly. |
Definition at line 429 of file WProperties.cpp.
WPropFilename WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const WPVBaseTypes::PV_PATH & | initial, | |||
WPropertyBase::PropertyChangeNotifierType | notifier, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable.
name | the property name | |
description | the property description | |
initial | the initial value | |
notifier | use this notifier for change callbacks. | |
hide | set to true to set the hide flag directly. |
Definition at line 466 of file WProperties.cpp.
WPropBool WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const WPVBaseTypes::PV_BOOL & | initial, | |||
WPropertyBase::PropertyChangeNotifierType | notifier, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable.
name | the property name | |
description | the property description | |
initial | the initial value | |
notifier | use this notifier for change callbacks. | |
hide | set to true to set the hide flag directly. |
Definition at line 442 of file WProperties.cpp.
WPropInt WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const WPVBaseTypes::PV_INT & | initial, | |||
WPropertyBase::PropertyChangeNotifierType | notifier, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable. It also sets the min and max constraint to [0,100].
name | the property name | |
description | the property description | |
initial | the initial value | |
notifier | use this notifier for change callbacks. | |
hide | set to true to set the hide flag directly. |
Definition at line 448 of file WProperties.cpp.
WPropDouble WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const WPVBaseTypes::PV_DOUBLE & | initial, | |||
WPropertyBase::PropertyChangeNotifierType | notifier, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable. It also sets the min and max constraint to [0,100].
name | the property name | |
description | the property description | |
initial | the initial value | |
notifier | use this notifier for change callbacks. | |
hide | set to true to set the hide flag directly. |
Definition at line 454 of file WProperties.cpp.
WPropInt WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const WPVBaseTypes::PV_INT & | initial, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable. It also sets the min and max constraint to [0,100].
name | the property name | |
description | the property description | |
initial | the initial value | |
hide | set to true to set the hide flag directly. |
Definition at line 334 of file WProperties.cpp.
WPropDouble WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const WPVBaseTypes::PV_DOUBLE & | initial, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable. It also sets the min and max constraint to [0,100].
name | the property name | |
description | the property description | |
initial | the initial value | |
hide | set to true to set the hide flag directly. |
Definition at line 339 of file WProperties.cpp.
WPropString WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const WPVBaseTypes::PV_STRING & | initial, | |||
WPropertyBase::PropertyChangeNotifierType | notifier, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable.
name | the property name | |
description | the property description | |
initial | the initial value | |
notifier | use this notifier for change callbacks. | |
hide | set to true to set the hide flag directly. |
Definition at line 460 of file WProperties.cpp.
WPropSelection WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const WPVBaseTypes::PV_SELECTION & | initial, | |||
WPropertyBase::PropertyChangeNotifierType | notifier, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable.
name | the property name | |
description | the property description | |
initial | the initial value | |
notifier | use this notifier for change callbacks. | |
hide | set to true to set the hide flag directly. |
Definition at line 472 of file WProperties.cpp.
WPropString WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const WPVBaseTypes::PV_STRING & | initial, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable.
name | the property name | |
description | the property description | |
initial | the initial value | |
hide | set to true to set the hide flag directly. |
Definition at line 344 of file WProperties.cpp.
WPropColor WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const WPVBaseTypes::PV_COLOR & | initial, | |||
WPropertyBase::PropertyChangeNotifierType | notifier, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable.
name | the property name | |
description | the property description | |
initial | the initial value | |
notifier | use this notifier for change callbacks. | |
hide | set to true to set the hide flag directly. |
Definition at line 484 of file WProperties.cpp.
WPropString WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const WPVBaseTypes::PV_STRING & | initial, | |||
boost::shared_ptr< WCondition > | condition, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable.
name | the property name | |
description | the property description | |
initial | the initial value | |
condition | use this external condition for notification. | |
hide | set to true to set the hide flag directly. |
Definition at line 399 of file WProperties.cpp.
WPropFilename WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const WPVBaseTypes::PV_PATH & | initial, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable.
name | the property name | |
description | the property description | |
initial | the initial value | |
hide | set to true to set the hide flag directly. |
Definition at line 349 of file WProperties.cpp.
WPropInt WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const WPVBaseTypes::PV_INT & | initial, | |||
boost::shared_ptr< WCondition > | condition, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable. It also sets the min and max constraint to [0,100].
name | the property name | |
description | the property description | |
initial | the initial value | |
condition | use this external condition for notification. | |
hide | set to true to set the hide flag directly. |
Definition at line 387 of file WProperties.cpp.
boost::shared_ptr< WPropertyVariable< T > > WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const T & | initial, | |||
boost::shared_ptr< WCondition > | condition, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable.
name | the property name | |
description | the property description | |
initial | the initial value | |
condition | use this external condition for notification. | |
hide | set to true to set the hide flag directly. |
Definition at line 1028 of file WProperties.h.
References addProperty().
WPropTrigger WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const WPVBaseTypes::PV_TRIGGER & | initial, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable.
name | the property name | |
description | the property description | |
initial | the initial value | |
hide | set to true to set the hide flag directly. |
Definition at line 369 of file WProperties.cpp.
WPropPosition WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const WPVBaseTypes::PV_POSITION & | initial, | |||
boost::shared_ptr< WCondition > | condition, | |||
WPropertyBase::PropertyChangeNotifierType | notifier, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable.
name | the property name | |
description | the property description | |
initial | the initial value | |
notifier | use this notifier for change callbacks. | |
condition | use this external condition for notification | |
hide | set to true to set the hide flag directly. |
Definition at line 546 of file WProperties.cpp.
WPropPosition WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const WPVBaseTypes::PV_POSITION & | initial, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable.
name | the property name | |
description | the property description | |
initial | the initial value | |
hide | set to true to set the hide flag directly. |
Definition at line 359 of file WProperties.cpp.
boost::shared_ptr< WPropertyVariable< T > > WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const T & | initial, | |||
WPropertyBase::PropertyChangeNotifierType | notifier, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable.
name | the property name | |
description | the property description | |
initial | the initial value | |
notifier | use this notifier for change callbacks. | |
hide | set to true to set the hide flag directly. |
Definition at line 1040 of file WProperties.h.
References addProperty().
WPropSelection WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const WPVBaseTypes::PV_SELECTION & | initial, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable.
name | the property name | |
description | the property description | |
initial | the initial value | |
hide | set to true to set the hide flag directly. |
Definition at line 354 of file WProperties.cpp.
WPropDouble WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const WPVBaseTypes::PV_DOUBLE & | initial, | |||
boost::shared_ptr< WCondition > | condition, | |||
WPropertyBase::PropertyChangeNotifierType | notifier, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable. It also sets the min and max constraint to [0,100].
name | the property name | |
description | the property description | |
initial | the initial value | |
notifier | use this notifier for change callbacks. | |
condition | use this external condition for notification | |
hide | set to true to set the hide flag directly. |
Definition at line 518 of file WProperties.cpp.
WPropColor WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const WPVBaseTypes::PV_COLOR & | initial, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable.
name | the property name | |
description | the property description | |
initial | the initial value | |
hide | set to true to set the hide flag directly. |
Definition at line 364 of file WProperties.cpp.
boost::shared_ptr< WPropertyVariable< T > > WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const T & | initial, | |||
boost::shared_ptr< WCondition > | condition, | |||
WPropertyBase::PropertyChangeNotifierType | notifier, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable.
name | the property name | |
description | the property description | |
initial | the initial value | |
notifier | use this notifier for change callbacks. | |
condition | use this external condition for notification | |
hide | set to true to set the hide flag directly. |
Definition at line 1052 of file WProperties.h.
References addProperty().
WPropBool WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const WPVBaseTypes::PV_BOOL & | initial, | |||
boost::shared_ptr< WCondition > | condition, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable.
name | the property name | |
description | the property description | |
initial | the initial value | |
condition | use this external condition for notification. | |
hide | set to true to set the hide flag directly. |
Definition at line 381 of file WProperties.cpp.
WPropDouble WProperties::addProperty | ( | std::string | name, | |
std::string | description, | |||
const WPVBaseTypes::PV_DOUBLE & | initial, | |||
boost::shared_ptr< WCondition > | condition, | |||
bool | hide = false | |||
) |
Create and add a new property of the template type.
For more details see appropriate constructor ow WPropertyVariable. It also sets the min and max constraint to [0,100].
name | the property name | |
description | the property description | |
initial | the initial value | |
condition | use this external condition for notification. | |
hide | set to true to set the hide flag directly. |
Definition at line 393 of file WProperties.cpp.
WPropGroup WProperties::addPropertyGroup | ( | std::string | name, | |
std::string | description, | |||
bool | hide = false | |||
) |
Create and add a new property group.
Use these groups to structure your properties.
name | the name of the group. | |
description | the description of the group. | |
hide | true if group should be completely hidden. |
Definition at line 303 of file WProperties.cpp.
References addProperty(), and WProperties().
void WProperties::clear | ( | ) | [virtual] |
Removes all properties from the list.
Definition at line 311 of file WProperties.cpp.
References WSharedObject< T >::getWriteTicket(), and m_properties.
boost::shared_ptr< WPropertyBase > WProperties::clone | ( | ) | [virtual] |
This method clones a property and returns the clone.
It does a deep copy and, in contrast to a copy constructor, creates property with the correct type without explicitly requiring the user to specify it. It creates a NEW change condition and change signal. This means, alls subscribed signal handlers are NOT copied.
Implements WPropertyBase.
Definition at line 77 of file WProperties.cpp.
References WProperties().
bool WProperties::existsProperty | ( | std::string | name | ) |
Helper function that finds a property by its name.
Use this method to find out whether the property exists or not, since findProperty throws an exception.
name | name of searched property. |
Definition at line 277 of file WProperties.cpp.
References findProperty().
boost::shared_ptr< WPropertyBase > WProperties::findProperty | ( | std::string | name | ) | const |
Searches the property with a given name.
It does not throw any exception. It simply returns NULL if it can't be found.
name | the name of the property to search |
Definition at line 240 of file WProperties.cpp.
References WPropertyBase::toPropGroup().
Referenced by existsProperty(), and getProperty().
boost::shared_ptr< WPropertyBase > WProperties::findProperty | ( | const WProperties *const | props, | |
std::string | name | |||
) | const [protected] |
Helping function to find a property inside a specific group.
It does not recursively find properties nested inside other property groups.
props | the group to search in. This is not a shared pointer since it is not needed. It simply can't happen that it is freed during findProperty as it is contained in this or a nested properties instance. | |
name | the name of the property inside THIS group. |
Definition at line 219 of file WProperties.cpp.
References WSharedObject< T >::getReadTicket(), and m_properties.
std::string WProperties::getAsString | ( | ) | [virtual] |
Returns the current value as a string.
This is useful for debugging or project files. It is not implemented as << operator, since the << should also print min/max constraints and so on. This simply is the value.
Implements WPropertyBase.
Definition at line 94 of file WProperties.cpp.
boost::shared_ptr< WCondition > WProperties::getChildUpdateCondition | ( | ) | const [virtual] |
This returns the condition fired whenever one children fires its update condition.
Useful to get notified about all changes that happen.
Definition at line 318 of file WProperties.cpp.
References m_childUpdateCondition.
WProperties::PropertySharedContainerType::ReadTicket WProperties::getProperties | ( | ) | const |
Returns a read ticket for read-access to the list of properties.
Definition at line 293 of file WProperties.cpp.
References WSharedObject< T >::getReadTicket(), and m_properties.
boost::shared_ptr< WPropertyBase > WProperties::getProperty | ( | std::string | name | ) |
Function searches the property.
If it does not exists, it throws an exception.
name | the name of the property |
Definition at line 282 of file WProperties.cpp.
References findProperty().
WProperties::PropertySharedContainerType::ReadTicket WProperties::getReadTicket | ( | ) | const |
Returns an read ticket for the properties.
This, and only this, has to be used for external iteration of properties.
Definition at line 298 of file WProperties.cpp.
References WSharedObject< T >::getReadTicket(), and m_properties.
PROPERTY_TYPE WProperties::getType | ( | ) | const [virtual] |
Gets the real type of this instance.
In this case, PV_GROUP.
Reimplemented from WPropertyBase.
Definition at line 83 of file WProperties.cpp.
bool WProperties::propNamePredicate | ( | boost::shared_ptr< WPropertyBase > | prop1, | |
boost::shared_ptr< WPropertyBase > | prop2 | |||
) | const [private] |
Compares the names of two properties and returns true if they are equal.
prop1 | the first prop. | |
prop2 | the second prop. |
Definition at line 202 of file WProperties.cpp.
Referenced by addProperty().
void WProperties::removeProperty | ( | boost::shared_ptr< WPropertyBase > | prop | ) |
Simply remove the specified property from the list.
If the given property is not in the list, nothing happens.
prop | the property to remove. |
Definition at line 206 of file WProperties.cpp.
References WSharedObject< T >::getWriteTicket(), m_childUpdateCondition, and m_properties.
bool WProperties::set | ( | boost::shared_ptr< WPropertyBase > | value | ) | [virtual] |
Sets the value from the specified property to this one.
This is especially useful to copy a value without explicitly casting/knowing the dynamic type of the property.
value | the new value. |
Implements WPropertyBase.
Definition at line 197 of file WProperties.cpp.
bool WProperties::setAsString | ( | std::string | value | ) | [virtual] |
This methods allows properties to be set by a string value.
This method does nothing here, as groups can not be set in any kind.
value | the new value to set. IGNORED. |
Implements WPropertyBase.
Definition at line 88 of file WProperties.cpp.
boost::shared_ptr< WConditionSet > WProperties::m_childUpdateCondition [private] |
Condition notified whenever a property inside this group fires its WPropertyBase::m_updateCondition.
This is especially useful to get a notification if something updates without further knowledge what changed. Useful if you want to listen for updates in modules for example.
Definition at line 962 of file WProperties.h.
Referenced by addProperty(), getChildUpdateCondition(), and removeProperty().
The set of proerties.
This uses the operators ==,<,> WProperty to determine equalness.
Definition at line 954 of file WProperties.h.
Referenced by addProperty(), clear(), findProperty(), getProperties(), getReadTicket(), removeProperty(), and WProperties().