ponder 3.2
C++ reflection library
ponder::EnumBuilder Class Reference

Proxy class which fills a metaenum with its members. More...

#include <enumbuilder.hpp>

Public Member Functions

 EnumBuilder (Enum &target)
 Construct the builder with a target metaenum. More...
 
EnumBuildervalue (IdRef name, long value)
 Add a new pair to the metaenum. More...
 
template<typename E >
EnumBuildervalue (IdRef name, E enumValue)
 Add a new pair to the metaenum using enum class. More...
 

Detailed Description

Proxy class which fills a metaenum with its members.

This class is returned by Enum::declare<T> in order construct a new metaenum. It contains functions to declare <name, value> pairs to fill the metaenum.

This class should never be explicitely instantiated, unless you need to split the metaenum creation in multiple parts.

Constructor & Destructor Documentation

◆ EnumBuilder()

ponder::EnumBuilder::EnumBuilder ( Enum target)
explicit

Construct the builder with a target metaenum.

Parameters
targetTarget metaenum to construct

Member Function Documentation

◆ value() [1/2]

template<typename E >
EnumBuilder& ponder::EnumBuilder::value ( IdRef  name,
enumValue 
)
inline

Add a new pair to the metaenum using enum class.

e.g. value("one", MyEnum::One)

Parameters
nameName of the pair
enumValueValue of the pair

◆ value() [2/2]

EnumBuilder& ponder::EnumBuilder::value ( IdRef  name,
long  value 
)

Add a new pair to the metaenum.

Parameters
nameName of the pair
valueValue of the pair

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