Cogs.Core
Public Member Functions | List of all members
Cogs::Reflection::EnumeratorDef Struct Reference

#include <Type.h>

Public Member Functions

template<typename T >
constexpr EnumeratorDef (Cogs::StringView name, T value)
 Construct a new enumerator with the given name and value.
 
constexpr Cogs::StringView getName () const
 Get the name of the enumerator.
 
constexpr int getValue () const
 Get the value of the enumerator.
 

Detailed Description

C++ constexpr enabled structor for Enum type initialization. Cogs::Name generation is delayed until enumerators are added to the Type. Use: static constexpr EnumeratorDef[] = keys[] = { { "A", Cogs::Key::A }, ... };

Definition at line 27 of file Type.h.

Constructor & Destructor Documentation

◆ EnumeratorDef()

template<typename T >
constexpr Cogs::Reflection::EnumeratorDef::EnumeratorDef ( Cogs::StringView  name,
value 
)
inlineconstexpr

Construct a new enumerator with the given name and value.

Definition at line 30 of file Type.h.

Member Function Documentation

◆ getName()

constexpr Cogs::StringView Cogs::Reflection::EnumeratorDef::getName ( ) const
inlineconstexpr

Get the name of the enumerator.

Definition at line 37 of file Type.h.

◆ getValue()

constexpr int Cogs::Reflection::EnumeratorDef::getValue ( ) const
inlineconstexpr

Get the value of the enumerator.

Definition at line 40 of file Type.h.


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