Template Class EnumDef#

Inheritance Relationships#

Base Type#

  • public ReflectionDefBase

Class Documentation#

template<typename EnumClsObj, typename = std::enable_if_t<std::is_base_of_v<EnumObj, EnumClsObj>>>
class EnumDef : public ReflectionDefBase#

Register one enum singleton and its canonical indices.

Public Functions

inline explicit EnumDef(const char *str_index)#

Register an enum singleton with an automatically assigned integer index.

The integer index is assigned from the singleton’s registration order.

Parameters:

str_index – The canonical string index.

inline EnumDef(const char *str_index, int64_t int_index)#

Register an integer enum singleton with explicit canonical indices.

Parameters:
  • str_index – The canonical string index.

  • int_index – The canonical integer index.

template<typename T>
inline EnumDef &set_attr(const char *attr_name, T value)#

Set an extensible attribute on the registered enum singleton.

Template Parameters:

T – The attribute value type.

Parameters:
  • attr_name – The attribute name.

  • value – The attribute value.

Returns:

Reference to this builder for method chaining.