OpenWalnut  1.5.0dev
Public Types | Static Public Member Functions | List of all members
WPropertyGroupBase::PropertyCreatorAndGroupAdder< PropertyType > Struct Template Reference

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

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

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 248 of file WPropertyGroupBase.h.

Member Typedef Documentation

◆ ValueType

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

The type of the initial value.

Definition at line 253 of file WPropertyGroupBase.h.

Member Function Documentation

◆ createAndAdd()

template<typename PropertyType >
static void WPropertyGroupBase::PropertyCreatorAndGroupAdder< PropertyType >::createAndAdd ( WPropertyGroupBase group,
std::string  name,
std::string  description,
const ValueType initial = ValueType() 
)
inlinestatic

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 263 of file WPropertyGroupBase.h.

References WPropertyGroupBase::addArbitraryProperty().

Referenced by WPropertyStruct< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::WPropertyStruct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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