OpenWalnut  1.4.0
Public Types | Static Public Member Functions
WPropertyGroupBase::PropertyCreatorAndGroupAdder< PropertyType > Struct Template Reference

Comfortable template to create a property instance and add it to the group. More...

#include <WPropertyGroupBase.h>

List of all members.

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.

Detailed Description

template<typename PropertyType>
struct WPropertyGroupBase::PropertyCreatorAndGroupAdder< PropertyType >

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).

Template Parameters:
PropertyTypethe property type to create. It is assumed that this is a shared_ptr< WPropertyXYZ >.

Definition at line 232 of file WPropertyGroupBase.h.


Member Typedef Documentation

template<typename PropertyType >
typedef PropertyType::element_type::ValueType WPropertyGroupBase::PropertyCreatorAndGroupAdder< PropertyType >::ValueType

The type of the initial value.

Definition at line 237 of file WPropertyGroupBase.h.


Member Function Documentation

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

Parameters:
groupthe group to add the new property to
namethe name of the new property
descriptionthe description of the new property
initialinitial 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().


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