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 >. | |
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. |
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 >.
Reimplemented from WPropertyGroupBase.
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 >.
Reimplemented from WPropertyGroupBase.
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.
WPropertyList< T >::WPropertyList | ( | std::string | name, |
std::string | description | ||
) | [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.
WPropertyList< T >::WPropertyList | ( | const WPropertyListType & | from | ) | [inline, 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.
from | the instance to copy. |
Definition at line 82 of file WPropertyList.h.
virtual WPropertyList< T >::~WPropertyList | ( | ) | [inline, virtual] |
Destructor.
Definition at line 91 of file WPropertyList.h.
virtual WPropertyBase::SPtr WPropertyList< T >::clone | ( | ) | [inline, 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 118 of file WPropertyList.h.
virtual std::string WPropertyList< T >::getAsString | ( | ) | [inline, 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 153 of file WPropertyList.h.
References WSharedObject< T >::getReadTicket(), and WPropertyGroupBase::m_properties.
virtual PROPERTY_TYPE WPropertyList< T >::getType | ( | ) | const [inline, virtual] |
Gets the real WPropertyVariable type of this instance.
Reimplemented from WPropertyBase.
Definition at line 129 of file WPropertyList.h.
virtual bool WPropertyList< T >::set | ( | boost::shared_ptr< WPropertyBase > | value | ) | [inline, 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. |
Definition at line 168 of file WPropertyList.h.
virtual bool WPropertyList< T >::setAsString | ( | std::string | value | ) | [inline, virtual] |
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.