OpenWalnut
1.5.0dev
|
Class to manage properties of an object and to provide convenience methods for easy access and manipulation. More...
#include <WPropertyGroup.h>
Public Types | |
typedef std::shared_ptr< WPropertyGroup > | SPtr |
shared pointer to object of this type More... | |
typedef std::shared_ptr< const WPropertyGroup > | ConstSPtr |
const shared pointer to object of this type More... | |
typedef WPropertyGroup * | Ptr |
pointer to object of this type More... | |
typedef const WPropertyGroup * | ConstPtr |
const pointer to object of this type More... | |
typedef WPropertyGroup & | Ref |
ref to object of this type More... | |
typedef const WPropertyGroup & | ConstRef |
const ref to object of this type More... | |
typedef WPropertyGroupBase::PropertyContainerType | PropertyContainerType |
For shortening: a type defining a shared vector of WSubject pointers. More... | |
typedef WPropertyGroupBase::PropertySharedContainerType | PropertySharedContainerType |
The alias for a shared container. More... | |
typedef WPropertyGroupBase::PropertyConstIterator | PropertyConstIterator |
The const iterator type of the container. More... | |
typedef WPropertyGroupBase::PropertyIterator | PropertyIterator |
The iterator type of the container. More... | |
Public Types inherited from WPropertyGroupBase | |
typedef std::vector< std::shared_ptr< WPropertyBase > > | PropertyContainerType |
For shortening: a type defining a shared vector of WSubject pointers. More... | |
typedef WSharedSequenceContainer< PropertyContainerType > | PropertySharedContainerType |
The alias for a shared container. More... | |
typedef PropertyContainerType::const_iterator | PropertyConstIterator |
The const iterator type of the container. More... | |
typedef PropertyContainerType::iterator | PropertyIterator |
The iterator type of the container. More... | |
typedef std::shared_ptr< WPropertyGroupBase > | SPtr |
Convenience typedef for a std::shared_ptr< WPropertyGroupBase >. More... | |
typedef std::shared_ptr< const WPropertyGroupBase > | ConstSPtr |
Convenience typedef for a std::shared_ptr< const WPropertyGroupBase >. More... | |
typedef boost::function< void(std::string, std::string)> | PropertyStringVisitor |
The visitor type used to visit properties as strings. More... | |
Public Types inherited from WPropertyBase | |
typedef std::shared_ptr< WPropertyBase > | SPtr |
Convenience typedef for a std::shared_ptr< WPropertyBase > More... | |
typedef std::shared_ptr< const WPropertyBase > | ConstSPtr |
Convenience typedef for a std::shared_ptr< const WPropertyBase > More... | |
typedef boost::function< void(std::shared_ptr< WPropertyBase >)> | PropertyChangeNotifierType |
Signal signature emitted during set operations. More... | |
Public Member Functions | |
WPropertyGroup (std::string name="unnamed group", std::string description="an unnamed group of properties") | |
Constructor. More... | |
WPropertyGroup (const WPropertyGroup &from) | |
Copy constructor. More... | |
virtual | ~WPropertyGroup () |
destructor More... | |
virtual std::shared_ptr< WPropertyBase > | clone () |
This method clones a property and returns the clone. More... | |
virtual PROPERTY_TYPE | getType () const |
Gets the real type of this instance. More... | |
virtual bool | setAsString (std::string value) |
This methods allows properties to be set by a string value. More... | |
virtual std::string | getAsString () |
Returns the current value as a string. More... | |
virtual bool | set (std::shared_ptr< WPropertyBase > value, bool recommendedOnly=false) |
Sets the value from the specified property to this one. More... | |
virtual bool | set (std::shared_ptr< WPropertyGroup > value, std::vector< std::string > exclude=std::vector< std::string >(), bool recommendedOnly=false) |
This method is a special version of WPropertyBase::set for groups. More... | |
virtual void | clear () |
Removes all properties from the list. More... | |
template<typename PropType > | |
PropType | addProperty (PropType prop) |
Insert the specified property into the list. More... | |
void | removeProperty (std::shared_ptr< WPropertyBase > prop) |
Remove the specified property from the list. More... | |
WPropGroup | addPropertyGroup (std::string name, std::string description, bool hide=false) |
Create and add a new property group. More... | |
template<typename T > | |
std::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. More... | |
template<typename T > | |
std::shared_ptr< WPropertyVariable< T > > | addProperty (std::string name, std::string description, const T &initial, std::shared_ptr< WCondition > condition, bool hide=false) |
Create and add a new property of the template type. More... | |
template<typename T > | |
std::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. More... | |
template<typename T > | |
std::shared_ptr< WPropertyVariable< T > > | addProperty (std::string name, std::string description, const T &initial, std::shared_ptr< WCondition > condition, WPropertyBase::PropertyChangeNotifierType notifier, bool hide=false) |
Create and add a new property of the template type. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
WPropBool | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_BOOL &initial, std::shared_ptr< WCondition > condition, bool hide=false) |
Create and add a new property of the template type. More... | |
WPropInt | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_INT &initial, std::shared_ptr< WCondition > condition, bool hide=false) |
Create and add a new property of the template type. More... | |
WPropDouble | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_DOUBLE &initial, std::shared_ptr< WCondition > condition, bool hide=false) |
Create and add a new property of the template type. More... | |
WPropString | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_STRING &initial, std::shared_ptr< WCondition > condition, bool hide=false) |
Create and add a new property of the template type. More... | |
WPropFilename | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_PATH &initial, std::shared_ptr< WCondition > condition, bool hide=false) |
Create and add a new property of the template type. More... | |
WPropSelection | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_SELECTION &initial, std::shared_ptr< WCondition > condition, bool hide=false) |
Create and add a new property of the template type. More... | |
WPropPosition | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_POSITION &initial, std::shared_ptr< WCondition > condition, bool hide=false) |
Create and add a new property of the template type. More... | |
WPropColor | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_COLOR &initial, std::shared_ptr< WCondition > condition, bool hide=false) |
Create and add a new property of the template type. More... | |
WPropTrigger | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_TRIGGER &initial, std::shared_ptr< WCondition > condition, bool hide=false) |
Create and add a new property of the template type. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
WPropBool | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_BOOL &initial, std::shared_ptr< WCondition > condition, WPropertyBase::PropertyChangeNotifierType notifier, bool hide=false) |
Create and add a new property of the template type. More... | |
WPropInt | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_INT &initial, std::shared_ptr< WCondition > condition, WPropertyBase::PropertyChangeNotifierType notifier, bool hide=false) |
Create and add a new property of the template type. More... | |
WPropDouble | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_DOUBLE &initial, std::shared_ptr< WCondition > condition, WPropertyBase::PropertyChangeNotifierType notifier, bool hide=false) |
Create and add a new property of the template type. More... | |
WPropString | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_STRING &initial, std::shared_ptr< WCondition > condition, WPropertyBase::PropertyChangeNotifierType notifier, bool hide=false) |
Create and add a new property of the template type. More... | |
WPropFilename | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_PATH &initial, std::shared_ptr< WCondition > condition, WPropertyBase::PropertyChangeNotifierType notifier, bool hide=false) |
Create and add a new property of the template type. More... | |
WPropSelection | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_SELECTION &initial, std::shared_ptr< WCondition > condition, WPropertyBase::PropertyChangeNotifierType notifier, bool hide=false) |
Create and add a new property of the template type. More... | |
WPropPosition | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_POSITION &initial, std::shared_ptr< WCondition > condition, WPropertyBase::PropertyChangeNotifierType notifier, bool hide=false) |
Create and add a new property of the template type. More... | |
WPropColor | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_COLOR &initial, std::shared_ptr< WCondition > condition, WPropertyBase::PropertyChangeNotifierType notifier, bool hide=false) |
Create and add a new property of the template type. More... | |
WPropTrigger | addProperty (std::string name, std::string description, const WPVBaseTypes::PV_TRIGGER &initial, std::shared_ptr< WCondition > condition, WPropertyBase::PropertyChangeNotifierType notifier, bool hide=false) |
Create and add a new property of the template type. More... | |
Public Member Functions inherited from WPropertyGroupBase | |
WPropertyGroupBase (std::string name, std::string description) | |
Constructor. More... | |
WPropertyGroupBase (const WPropertyGroupBase &from) | |
Copy constructor. More... | |
virtual | ~WPropertyGroupBase () |
Destructor. More... | |
virtual bool | existsProperty (std::string name) |
Helper function that finds a property by its name. More... | |
virtual std::shared_ptr< WPropertyBase > | getProperty (std::string name) |
Function searches the property. More... | |
virtual PropertySharedContainerType::ReadTicket | getProperties () const |
Returns a read ticket for read-access to the list of properties. More... | |
virtual PropertySharedContainerType::ReadTicket | getReadTicket () const |
Returns an read ticket for the properties. More... | |
virtual std::shared_ptr< WPropertyBase > | findProperty (std::string name) const |
Searches the property with a given name. More... | |
virtual void | visitAsString (PropertyStringVisitor visitor, std::string pathPrefix="") const |
Visit all leafs in the property three that aren't empty groups. More... | |
bool | autoHideEmpty () const |
Checks whether the property group should be hidden if it is empty. More... | |
void | setAutoHideEmpty (bool autoHide=true) |
Should the property group be hidden automatically if it is empty? By default, this is true. More... | |
Public Member Functions inherited from WPropertyBase | |
WPropertyBase (std::string name, std::string description) | |
Create an empty named property. More... | |
WPropertyBase (const WPropertyBase &from) | |
Copy constructor. More... | |
virtual | ~WPropertyBase () |
Destructor. More... | |
std::string | getName () const |
Gets the name of the class. More... | |
std::string | getDescription () const |
Gets the description of the property. More... | |
bool | isHidden () const |
Determines whether the property is hidden or not. More... | |
void | setHidden (bool hidden=true) |
Sets the property hidden. More... | |
virtual PROPERTY_PURPOSE | getPurpose () const |
Gets the purpose of a property. More... | |
virtual void | setPurpose (PROPERTY_PURPOSE purpose) |
Sets the purpose of the property. More... | |
template<typename T > | |
bool | set (const T &value) |
Shortcut to set a property with a given value. More... | |
virtual std::shared_ptr< WCondition > | getUpdateCondition () const |
This method returns a condition which gets fired whenever the property changes somehow. More... | |
WPropInt | toPropInt () |
Helper converts this instance to its native type. More... | |
WPropDouble | toPropDouble () |
Helper converts this instance to its native type. More... | |
WPropBool | toPropBool () |
Helper converts this instance to its native type. More... | |
WPropString | toPropString () |
Helper converts this instance to its native type. More... | |
WPropFilename | toPropFilename () |
Helper converts this instance to its native type. More... | |
WPropSelection | toPropSelection () |
Helper converts this instance to its native type. More... | |
WPropColor | toPropColor () |
Helper converts this instance to its native type. More... | |
WPropPosition | toPropPosition () |
Helper converts this instance to its native type. More... | |
WPropTrigger | toPropTrigger () |
Helper converts this instance to its native type. More... | |
WPropMatrix4X4 | toPropMatrix4X4 () |
Helper converts this instance to its native type. More... | |
WPropTransferFunction | toPropTransferFunction () |
Helper converts this instance to its native type. More... | |
WPropGroup | toPropGroup () |
Helper converts this instance to its native type. More... | |
WPropInterval | toPropInterval () |
Helper converts this instance to its native type. More... | |
std::shared_ptr< WPropertyGroupBase > | toPropGroupBase () |
Convert the property to a WPropertyGroupBase. More... | |
template<typename T > | |
std::shared_ptr< WPropertyVariable< T > > | toPropertyVariable () |
Helper converts this instance to an arbitrary type. More... | |
Protected Member Functions | |
virtual bool | setImpl (std::shared_ptr< WPropertyGroup > value, std::string path="", std::vector< std::string > exclude=std::vector< std::string >(), bool recommendedOnly=false) |
This function implements the set functionality. More... | |
Protected Member Functions inherited from WPropertyGroupBase | |
virtual std::shared_ptr< WPropertyBase > | findProperty (const WPropertyGroupBase *const props, std::string name) const |
Helping function to find a property inside a specific group. More... | |
bool | propNamePredicate (std::shared_ptr< WPropertyBase > prop1, std::shared_ptr< WPropertyBase > prop2) const |
Compares the names of two properties and returns true if they are equal. More... | |
void | addArbitraryProperty (WPropertyBase::SPtr prop) |
Insert the specified property into the list. More... | |
Protected Member Functions inherited from WPropertyBase | |
virtual void | updateType () |
Calculates the type of the property. More... | |
Friends | |
class | WPropertiesTest |
Access for test class. More... | |
Additional Inherited Members | |
Static Public Attributes inherited from WPropertyGroupBase | |
static const std::string | separator = "/" |
The separator used to separate groups and subgroups. More... | |
Protected Types inherited from WPropertyBase | |
typedef boost::signals2::signal< void(std::shared_ptr< WPropertyBase >)> | PropertyChangeSignalType |
Signal used for firing change signals. More... | |
Protected Attributes inherited from WPropertyGroupBase | |
PropertySharedContainerType | m_properties |
The set of proerties. More... | |
Protected Attributes inherited from WPropertyBase | |
std::string | m_name |
Name of the property. More... | |
std::string | m_description |
Description of the property. More... | |
bool | m_hidden |
Flag denoting whether the property is hidden or not. More... | |
PROPERTY_TYPE | m_type |
Type of the PropertyVariable instance. More... | |
PROPERTY_PURPOSE | m_purpose |
The purpose of this property. More... | |
PropertyChangeSignalType | signal_PropertyChange |
Signal getting fired whenever the property changes. More... | |
std::shared_ptr< WConditionSet > | m_updateCondition |
Condition notified whenever something changes. More... | |
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 50 of file WPropertyGroup.h.
typedef const WPropertyGroup* WPropertyGroup::ConstPtr |
const pointer to object of this type
Definition at line 58 of file WPropertyGroup.h.
typedef const WPropertyGroup& WPropertyGroup::ConstRef |
const ref to object of this type
Definition at line 60 of file WPropertyGroup.h.
typedef std::shared_ptr< const WPropertyGroup > WPropertyGroup::ConstSPtr |
const shared pointer to object of this type
Definition at line 56 of file WPropertyGroup.h.
The const iterator type of the container.
Definition at line 75 of file WPropertyGroup.h.
For shortening: a type defining a shared vector of WSubject pointers.
Definition at line 65 of file WPropertyGroup.h.
The iterator type of the container.
Definition at line 80 of file WPropertyGroup.h.
The alias for a shared container.
Definition at line 70 of file WPropertyGroup.h.
typedef WPropertyGroup* WPropertyGroup::Ptr |
pointer to object of this type
Definition at line 57 of file WPropertyGroup.h.
typedef WPropertyGroup& WPropertyGroup::Ref |
ref to object of this type
Definition at line 59 of file WPropertyGroup.h.
typedef std::shared_ptr< WPropertyGroup > WPropertyGroup::SPtr |
shared pointer to object of this type
Definition at line 55 of file WPropertyGroup.h.
WPropertyGroup::WPropertyGroup | ( | 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 39 of file WPropertyGroup.cpp.
Referenced by addPropertyGroup(), and clone().
|
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 50 of file WPropertyGroup.cpp.
|
virtual |
destructor
Definition at line 45 of file WPropertyGroup.cpp.
PropType WPropertyGroup::addProperty | ( | PropType | prop | ) |
Insert the specified property into the list.
prop | the property to add |
Definition at line 925 of file WPropertyGroup.h.
References WPropertyGroupBase::addArbitraryProperty().
Referenced by addProperty(), and addPropertyGroup().
std::shared_ptr< WPropertyVariable< T > > WPropertyGroup::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 932 of file WPropertyGroup.h.
References addProperty().
std::shared_ptr< WPropertyVariable< T > > WPropertyGroup::addProperty | ( | std::string | name, |
std::string | description, | ||
const T & | initial, | ||
std::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 943 of file WPropertyGroup.h.
References addProperty().
std::shared_ptr< WPropertyVariable< T > > WPropertyGroup::addProperty | ( | std::string | name, |
std::string | description, | ||
const T & | initial, | ||
std::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 967 of file WPropertyGroup.h.
References addProperty().
std::shared_ptr< WPropertyVariable< T > > WPropertyGroup::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 955 of file WPropertyGroup.h.
References addProperty().
WPropBool WPropertyGroup::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 251 of file WPropertyGroup.cpp.
WPropBool WPropertyGroup::addProperty | ( | std::string | name, |
std::string | description, | ||
const WPVBaseTypes::PV_BOOL & | initial, | ||
std::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 303 of file WPropertyGroup.cpp.
WPropBool WPropertyGroup::addProperty | ( | std::string | name, |
std::string | description, | ||
const WPVBaseTypes::PV_BOOL & | initial, | ||
std::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 426 of file WPropertyGroup.cpp.
WPropBool WPropertyGroup::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 364 of file WPropertyGroup.cpp.
WPropColor WPropertyGroup::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 286 of file WPropertyGroup.cpp.
WPropColor WPropertyGroup::addProperty | ( | std::string | name, |
std::string | description, | ||
const WPVBaseTypes::PV_COLOR & | initial, | ||
std::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 345 of file WPropertyGroup.cpp.
WPropColor WPropertyGroup::addProperty | ( | std::string | name, |
std::string | description, | ||
const WPVBaseTypes::PV_COLOR & | initial, | ||
std::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 475 of file WPropertyGroup.cpp.
WPropColor WPropertyGroup::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 406 of file WPropertyGroup.cpp.
WPropDouble WPropertyGroup::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 261 of file WPropertyGroup.cpp.
WPropDouble WPropertyGroup::addProperty | ( | std::string | name, |
std::string | description, | ||
const WPVBaseTypes::PV_DOUBLE & | initial, | ||
std::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 315 of file WPropertyGroup.cpp.
WPropDouble WPropertyGroup::addProperty | ( | std::string | name, |
std::string | description, | ||
const WPVBaseTypes::PV_DOUBLE & | initial, | ||
std::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 440 of file WPropertyGroup.cpp.
WPropDouble WPropertyGroup::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 376 of file WPropertyGroup.cpp.
WPropInt WPropertyGroup::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 256 of file WPropertyGroup.cpp.
WPropInt WPropertyGroup::addProperty | ( | std::string | name, |
std::string | description, | ||
const WPVBaseTypes::PV_INT & | initial, | ||
std::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 309 of file WPropertyGroup.cpp.
WPropInt WPropertyGroup::addProperty | ( | std::string | name, |
std::string | description, | ||
const WPVBaseTypes::PV_INT & | initial, | ||
std::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 433 of file WPropertyGroup.cpp.
WPropInt WPropertyGroup::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 370 of file WPropertyGroup.cpp.
WPropFilename WPropertyGroup::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 271 of file WPropertyGroup.cpp.
WPropFilename WPropertyGroup::addProperty | ( | std::string | name, |
std::string | description, | ||
const WPVBaseTypes::PV_PATH & | initial, | ||
std::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 327 of file WPropertyGroup.cpp.
WPropFilename WPropertyGroup::addProperty | ( | std::string | name, |
std::string | description, | ||
const WPVBaseTypes::PV_PATH & | initial, | ||
std::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 454 of file WPropertyGroup.cpp.
WPropFilename WPropertyGroup::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 388 of file WPropertyGroup.cpp.
WPropPosition WPropertyGroup::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 281 of file WPropertyGroup.cpp.
WPropPosition WPropertyGroup::addProperty | ( | std::string | name, |
std::string | description, | ||
const WPVBaseTypes::PV_POSITION & | initial, | ||
std::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 339 of file WPropertyGroup.cpp.
WPropPosition WPropertyGroup::addProperty | ( | std::string | name, |
std::string | description, | ||
const WPVBaseTypes::PV_POSITION & | initial, | ||
std::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 468 of file WPropertyGroup.cpp.
WPropPosition WPropertyGroup::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 400 of file WPropertyGroup.cpp.
WPropSelection WPropertyGroup::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 276 of file WPropertyGroup.cpp.
WPropSelection WPropertyGroup::addProperty | ( | std::string | name, |
std::string | description, | ||
const WPVBaseTypes::PV_SELECTION & | initial, | ||
std::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 333 of file WPropertyGroup.cpp.
WPropSelection WPropertyGroup::addProperty | ( | std::string | name, |
std::string | description, | ||
const WPVBaseTypes::PV_SELECTION & | initial, | ||
std::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 461 of file WPropertyGroup.cpp.
WPropSelection WPropertyGroup::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 394 of file WPropertyGroup.cpp.
WPropString WPropertyGroup::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 266 of file WPropertyGroup.cpp.
WPropString WPropertyGroup::addProperty | ( | std::string | name, |
std::string | description, | ||
const WPVBaseTypes::PV_STRING & | initial, | ||
std::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 321 of file WPropertyGroup.cpp.
WPropString WPropertyGroup::addProperty | ( | std::string | name, |
std::string | description, | ||
const WPVBaseTypes::PV_STRING & | initial, | ||
std::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 447 of file WPropertyGroup.cpp.
WPropString WPropertyGroup::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 382 of file WPropertyGroup.cpp.
WPropTrigger WPropertyGroup::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 291 of file WPropertyGroup.cpp.
WPropTrigger WPropertyGroup::addProperty | ( | std::string | name, |
std::string | description, | ||
const WPVBaseTypes::PV_TRIGGER & | initial, | ||
std::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 351 of file WPropertyGroup.cpp.
WPropTrigger WPropertyGroup::addProperty | ( | std::string | name, |
std::string | description, | ||
const WPVBaseTypes::PV_TRIGGER & | initial, | ||
std::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 482 of file WPropertyGroup.cpp.
WPropTrigger WPropertyGroup::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 412 of file WPropertyGroup.cpp.
WPropGroup WPropertyGroup::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 230 of file WPropertyGroup.cpp.
References addProperty(), and WPropertyGroup().
|
virtual |
Removes all properties from the list.
Definition at line 238 of file WPropertyGroup.cpp.
References WSharedObject< T >::getWriteTicket(), and WPropertyGroupBase::m_properties.
|
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 56 of file WPropertyGroup.cpp.
References WPropertyGroup().
|
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 73 of file WPropertyGroup.cpp.
|
virtual |
Gets the real type of this instance.
In this case, PV_GROUP.
Reimplemented from WPropertyBase.
Definition at line 62 of file WPropertyGroup.cpp.
void WPropertyGroup::removeProperty | ( | std::shared_ptr< WPropertyBase > | prop | ) |
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 217 of file WPropertyGroup.cpp.
References WSharedObject< T >::getWriteTicket(), WPropertyGroupBase::m_properties, and WPropertyBase::m_updateCondition.
|
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. For WPropertyGroup, this tries to set the contained properties to the value of the given group. It does not add/remove properties. It simply sets the children values to the ones given.
value | the new value. |
recommendedOnly | if true, property types which support recommended values apply the given value as recommendation. |
Implements WPropertyBase.
Definition at line 144 of file WPropertyGroup.cpp.
|
virtual |
This method is a special version of WPropertyBase::set for groups.
It allows to set the values of the contained properties. It does not add nor remove properties. It searches the property by name (recursively) and sets the value from the specified property group's property. You can use the exclusion list to exclude a certain property.
value | the source values |
exclude | a list of property names to exclude. Use complete names here, which means, when having nested groups, apply the rules defined in WPropertyGroupBase::findProperty. |
recommendedOnly | if true, property types which support recommended values apply the given value as recommendation. |
Definition at line 158 of file WPropertyGroup.cpp.
References setImpl().
|
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 67 of file WPropertyGroup.cpp.
|
protectedvirtual |
This function implements the set functionality.
It works recursively and keeps track of the current path.
value | the value source |
path | the current path inside the source property group |
exclude | exclude list with paths relative to the original source group |
recommendedOnly | recommendation flag. |
Definition at line 163 of file WPropertyGroup.cpp.
References WPropertyGroupBase::findProperty(), and WPropertyGroupBase::separator.
Referenced by set().
|
friend |
Access for test class.
Definition at line 52 of file WPropertyGroup.h.