AUI Framework  master
Cross-platform module-based framework for developing C++20 desktop applications
AEnumerate< enum_t > Class Template Reference

Enum trait to transform enum to name, name to enum, list all enums and vise versa. More...

Detailed Description

template<typename enum_t>
class AEnumerate< enum_t >

Enum trait to transform enum to name, name to enum, list all enums and vise versa.

See also
AUI_ENUM_VALUES

Classes

struct  Values
 

Static Public Member Functions

template<enum_t value>
static AString valueName ()
 Maps compile-time specified enum value to name. More...
 
static const AMap< AString, enum_t > & nameToValueMap ()
 Get runtime name to enum value mapping. More...
 
static const AMap< enum_t, AString, enum_less > & valueToNameMap ()
 Map runtime enum value to name.
 
static enum_t byName (const AString &name)
 Map runtime name to enum value. Transforms name to uppercase as a fallback. Throws an exception if no such value.
 
static const AStringtoName (enum_t value)
 Map runtime enum value to name. Throws an exception if no such value.
 

Member Function Documentation

◆ nameToValueMap()

template<typename enum_t >
const AMap< AString, enum_t > & AEnumerate< enum_t >::nameToValueMap
static

Get runtime name to enum value mapping.

See also
byName

◆ valueName()

template<typename enum_t >
template<enum_t value>
static AString AEnumerate< enum_t >::valueName ( )
inlinestatic

Maps compile-time specified enum value to name.

Use names()[enumValue] for mapping runtime values.

This function's behaviour can be reimplemented by aui::enumerate::ValueToName trait.

#include <AUI/Reflect/AEnumerate.h>


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