Skip to content

AEnumerate#

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

Header:#include <AUI/Reflect/AEnumerate.h>
CMake:aui_link(my_target PUBLIC aui::core)

Public Types#

Values#


struct AEnumerate::Values

Empty structure.

Public Methods#

byName#


static enum_t AEnumerate::byName(const AString& name)

Map runtime name to enum value. Transforms name to uppercase as a fallback. Throws an exception if no such value.

nameToValueMap#


static const AMap<AString,enum_t>& AEnumerate::nameToValueMap()

Get runtime name to enum value mapping.

toName#


static const AString& AEnumerate::toName(enum_t value)

Map runtime enum value to name. Throws an exception if no such value.

valueName#


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

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.

valueToNameMap#


static const AMap<enum_t,AString,enum_less>& AEnumerate::valueToNameMap()

Map runtime enum value to name.