OpenWalnut  1.4.0
Public Types | Public Member Functions
WPropertyList< T > Class Template Reference

This is a dynamic property list. More...

#include <WPropertyList.h>

+ Inheritance diagram for WPropertyList< T >:

List of all members.

Public Types

typedef T ValueType
 The type of property to store in this list.
typedef WPropertyList< ValueTypeWPropertyListType
 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.

Detailed Description

template<typename T>
class WPropertyList< T >

This is a dynamic property list.

With its help, users can dynamically add items.

Template Parameters:
TThis is a property type. The list will then contain several of these properties.

Definition at line 41 of file WPropertyList.h.


Member Typedef Documentation

template<typename T >
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.

template<typename T >
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.

template<typename T >
typedef T WPropertyList< T >::ValueType

The type of property to store in this list.

Definition at line 47 of file WPropertyList.h.

template<typename T >
typedef WPropertyList< ValueType > WPropertyList< T >::WPropertyListType

Abbreviation for this template with the current value type.

Definition at line 52 of file WPropertyList.h.


Constructor & Destructor Documentation

template<typename T >
WPropertyList< T >::WPropertyList ( std::string  name,
std::string  description 
) [inline]

Create an empty named property.

Parameters:
namethe name of the property
descriptionthe description of the property

Definition at line 70 of file WPropertyList.h.

template<typename T >
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.

Parameters:
fromthe instance to copy.

Definition at line 82 of file WPropertyList.h.

template<typename T >
virtual WPropertyList< T >::~WPropertyList ( ) [inline, virtual]

Destructor.

Definition at line 91 of file WPropertyList.h.


Member Function Documentation

template<typename T >
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.

Notes:
this simply ensures the copy constructor of the runtime type is issued.
Returns:
the deep clone of this property.

Implements WPropertyBase.

Definition at line 118 of file WPropertyList.h.

template<typename T >
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.

Returns:
the value as a string.

Implements WPropertyBase.

Definition at line 153 of file WPropertyList.h.

References WSharedObject< T >::getReadTicket(), and WPropertyGroupBase::m_properties.

template<typename T >
virtual PROPERTY_TYPE WPropertyList< T >::getType ( ) const [inline, virtual]

Gets the real WPropertyVariable type of this instance.

Returns:
the real type.

Reimplemented from WPropertyBase.

Definition at line 129 of file WPropertyList.h.

template<typename T >
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.

Parameters:
valuethe new value.
Returns:
true if the value has been accepted.

Definition at line 168 of file WPropertyList.h.

template<typename T >
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.

Parameters:
valuethe new value to set.
Returns:
true if value could be set.

Implements WPropertyBase.

Definition at line 142 of file WPropertyList.h.


The documentation for this class was generated from the following file: