OpenWalnut
1.4.0
|
This is a dynamic property list. More...
#include <WPropertyList.h>
Public Types | |
typedef T | ValueType |
The type of property to store in this list. | |
typedef WPropertyList< ValueType > | WPropertyListType |
Abbreviation for this template with the current value type. | |
typedef boost::shared_ptr < WPropertyList< ValueType > > | SPtr |
Convenience typedef for a boost::shared_ptr< WPropertyList >. | |
typedef boost::shared_ptr < const WPropertyList < ValueType > > | ConstSPtr |
Convenience typedef for a boost::shared_ptr< const WPropertyList >. | |
![]() | |
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. | |
typedef boost::shared_ptr < WPropertyGroupBase > | SPtr |
Convenience typedef for a boost::shared_ptr< WPropertyGroupBase >. | |
typedef boost::shared_ptr < const WPropertyGroupBase > | ConstSPtr |
Convenience typedef for a boost::shared_ptr< const WPropertyGroupBase >. | |
typedef boost::function< void(std::string, std::string)> | PropertyStringVisitor |
The visitor type used to visit properties as strings. | |
![]() | |
typedef boost::shared_ptr < WPropertyBase > | SPtr |
Convenience typedef for a boost::shared_ptr< WPropertyBase > | |
typedef boost::shared_ptr < const WPropertyBase > | ConstSPtr |
Convenience typedef for a boost::shared_ptr< const WPropertyBase > | |
typedef boost::function< void(boost::shared_ptr < WPropertyBase >)> | PropertyChangeNotifierType |
Signal signature emitted during set operations. |
Public Member Functions | |
WPropertyList (std::string name, std::string description) | |
Create an empty named property. | |
WPropertyList (const WPropertyListType &from) | |
Copy constructor. | |
virtual | ~WPropertyList () |
Destructor. | |
virtual WPropertyBase::SPtr | clone () |
This method clones a property and returns the clone. | |
virtual PROPERTY_TYPE | getType () const |
Gets the real WPropertyVariable 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. | |
![]() | |
WPropertyGroupBase (std::string name, std::string description) | |
Constructor. | |
WPropertyGroupBase (const WPropertyGroupBase &from) | |
Copy constructor. | |
virtual | ~WPropertyGroupBase () |
Destructor. | |
virtual bool | existsProperty (std::string name) |
Helper function that finds a property by its name. | |
virtual boost::shared_ptr < WPropertyBase > | getProperty (std::string name) |
Function searches the property. | |
virtual PropertySharedContainerType::ReadTicket | getProperties () const |
Returns a read ticket for read-access to the list of properties. | |
virtual PropertySharedContainerType::ReadTicket | getReadTicket () const |
Returns an read ticket for the properties. | |
virtual boost::shared_ptr < WPropertyBase > | findProperty (std::string name) const |
Searches the property with a given name. | |
virtual void | visitAsString (PropertyStringVisitor visitor, std::string pathPrefix="") const |
Visit all leafs in the property three that aren't empty groups. | |
![]() | |
WPropertyBase (std::string name, std::string description) | |
Create an empty named property. | |
WPropertyBase (const WPropertyBase &from) | |
Copy constructor. | |
virtual | ~WPropertyBase () |
Destructor. | |
std::string | getName () const |
Gets the name of the class. | |
std::string | getDescription () const |
Gets the description of the property. | |
bool | isHidden () const |
Determines whether the property is hidden or not. | |
void | setHidden (bool hidden=true) |
Sets the property hidden. | |
virtual PROPERTY_PURPOSE | getPurpose () const |
Gets the purpose of a property. | |
virtual void | setPurpose (PROPERTY_PURPOSE purpose) |
Sets the purpose of the property. | |
virtual boost::shared_ptr < WCondition > | getUpdateCondition () const |
This method returns a condition which gets fired whenever the property changes somehow. | |
virtual bool | set (boost::shared_ptr< WPropertyBase > value, bool recommendedOnly=false)=0 |
Sets the value from the specified property to this one. | |
WPropInt | toPropInt () |
Helper converts this instance to its native type. | |
WPropDouble | toPropDouble () |
Helper converts this instance to its native type. | |
WPropBool | toPropBool () |
Helper converts this instance to its native type. | |
WPropString | toPropString () |
Helper converts this instance to its native type. | |
WPropFilename | toPropFilename () |
Helper converts this instance to its native type. | |
WPropSelection | toPropSelection () |
Helper converts this instance to its native type. | |
WPropColor | toPropColor () |
Helper converts this instance to its native type. | |
WPropPosition | toPropPosition () |
Helper converts this instance to its native type. | |
WPropTrigger | toPropTrigger () |
Helper converts this instance to its native type. | |
WPropMatrix4X4 | toPropMatrix4X4 () |
Helper converts this instance to its native type. | |
WPropTransferFunction | toPropTransferFunction () |
Helper converts this instance to its native type. | |
WPropGroup | toPropGroup () |
Helper converts this instance to its native type. | |
WPropInterval | toPropInterval () |
Helper converts this instance to its native type. | |
boost::shared_ptr < WPropertyGroupBase > | toPropGroupBase () |
Convert the property to a WPropertyGroupBase. | |
template<typename T > | |
boost::shared_ptr < WPropertyVariable< T > > | toPropertyVariable () |
Helper converts this instance to an arbitrary type. |
Additional Inherited Members | |
![]() | |
static const std::string | separator = "/" |
The separator used to separate groups and subgroups. | |
![]() | |
typedef boost::signals2::signal< void(boost::shared_ptr < WPropertyBase >)> | PropertyChangeSignalType |
Signal used for firing change signals. | |
![]() | |
virtual boost::shared_ptr < WPropertyBase > | findProperty (const WPropertyGroupBase *const props, std::string name) const |
Helping function to find a property inside a specific group. | |
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. | |
void | addArbitraryProperty (WPropertyBase::SPtr prop) |
Insert the specified property into the list. | |
![]() | |
PropertySharedContainerType | m_properties |
The set of proerties. |
This is a dynamic property list.
With its help, users can dynamically add items.
T | This is a property type. The list will then contain several of these properties. |
Definition at line 41 of file WPropertyList.h.
typedef boost::shared_ptr< const WPropertyList< ValueType > > WPropertyList< T >::ConstSPtr |
Convenience typedef for a boost::shared_ptr< const WPropertyList >.
Definition at line 62 of file WPropertyList.h.
typedef boost::shared_ptr< WPropertyList< ValueType > > WPropertyList< T >::SPtr |
Convenience typedef for a boost::shared_ptr< WPropertyList >.
Definition at line 57 of file WPropertyList.h.
typedef T WPropertyList< T >::ValueType |
The type of property to store in this list.
Definition at line 47 of file WPropertyList.h.
typedef WPropertyList< ValueType > WPropertyList< T >::WPropertyListType |
Abbreviation for this template with the current value type.
Definition at line 52 of file WPropertyList.h.
|
inline |
Create an empty named property.
name | the name of the property |
description | the description of the property |
Definition at line 70 of file WPropertyList.h.
|
inlineexplicit |
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.
from | the instance to copy. |
Definition at line 82 of file WPropertyList.h.
|
inlinevirtual |
Destructor.
Definition at line 91 of file WPropertyList.h.
|
inlinevirtual |
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 118 of file WPropertyList.h.
|
inlinevirtual |
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 153 of file WPropertyList.h.
References WSharedObject< T >::getReadTicket(), and WPropertyGroupBase::m_properties.
|
inlinevirtual |
Gets the real WPropertyVariable type of this instance.
Reimplemented from WPropertyBase.
Definition at line 129 of file WPropertyList.h.
|
inlinevirtual |
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. |
Definition at line 168 of file WPropertyList.h.
|
inlinevirtual |
This methods allows properties to be set by a string value.
This is especially useful when a property is only available as string and the real type of the property is unknown. This is a shortcut for casting the property and then setting the lexically casted value.
value | the new value to set. |
Implements WPropertyBase.
Definition at line 142 of file WPropertyList.h.