Class Enum

Nested Relationships

Nested Types

Class Documentation

class Enum

The Enum class is intended to allow examining the values and strings of an enum.

The Enum class describes the layout of a C/C++ enum in a generic fashion. The methods of an Enum instance can be used to determine the name and value of each element in an enum.

Public Functions

Enum()
Enum(char const *name, char const *typeString, EnumElement *enumElements, size_t numElements)
~Enum()
char const *Name() const

Return the enum name as declared in original code.

Returns

char const *TypeString() const

Return the enum type as declared in original code.

Returns

uint64_t ElementCount() const

Obtain the number of elements in the enum.

Returns

Number of elements declared in the enum, or zero if no elements.

Enum::EnumElement const *GetElement(uint64_t index) const

Return the name and value of an enum element.

Returns

A pointer to an EnumField structure containing the textual name of the element and the value

Enum::EnumElement const *GetElementFromValue(uint32_t value) const

Return the enum element definition representing the provided value.

Returns

A pointer to an EnumField structure containing the textual name of the element and the value

struct EnumElement

Public Members

char const *textName
uint64_t value