OpenWalnut
1.4.0
|
Comfortable template to create a property instance and add it to the group. More...
#include <WPropertyGroupBase.h>
Public Types | |
typedef PropertyType::element_type::ValueType | ValueType |
The type of the initial value. | |
Static Public Member Functions | |
static void | createAndAdd (WPropertyGroupBase *group, std::string name, std::string description, const ValueType &initial=ValueType()) |
Actually does the work and adds a new property with the given name, description and other parameters to the specified group. |
Comfortable template to create a property instance and add it to the group.
This is a utility for deriving classes which need to handle certain property types and other types during compile time.
At the first glance, this might not look very useful. But this is practical to change the add-behaviour for certain property types by specializing this class. For example, the template WPropertyStruct uses this to modify the behaviour for the non-property type WPropertyStructHelper::NOTYPE, which is used as template list default (to emulate variadic template parameters lists).
PropertyType | the property type to create. It is assumed that this is a shared_ptr< WPropertyXYZ >. |
Definition at line 232 of file WPropertyGroupBase.h.
typedef PropertyType::element_type::ValueType WPropertyGroupBase::PropertyCreatorAndGroupAdder< PropertyType >::ValueType |
The type of the initial value.
Definition at line 237 of file WPropertyGroupBase.h.
static void WPropertyGroupBase::PropertyCreatorAndGroupAdder< PropertyType >::createAndAdd | ( | WPropertyGroupBase * | group, |
std::string | name, | ||
std::string | description, | ||
const ValueType & | initial = ValueType() |
||
) | [inline, static] |
Actually does the work and adds a new property with the given name, description and other parameters to the specified group.
group | the group to add the new property to |
name | the name of the new property |
description | the description of the new property |
initial | initial value |
Definition at line 247 of file WPropertyGroupBase.h.
References WPropertyGroupBase::addArbitraryProperty().
Referenced by WPropertyStruct< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::WPropertyStruct().