|
CeresEngine 0.2.0
A game development framework
|
Represents a reflected enum from C++. More...
#include <CeresEngine/Reflection/Enum.hpp>
Public Types | |
| using | ValueGetter = UniqueFunction< Box() const > |
| using | EnumerateElementFunction = FunctionView< bool(const EnumValue &) const > |
Defines a type that represents the function to be called when iterating over all MetaEnumValue. | |
Public Attributes | |
| String | name |
Protected Member Functions | |
| void | addElement (StringView name, ValueGetter &&value) |
Protected Member Functions inherited from CeresEngine::MetaContainer | |
| MetaContainer ()=default | |
| virtual | ~MetaContainer ()=default |
| bool | addItem (MetaItem *value) |
| std::size_t | count (MetaCategory category) const |
Represents a reflected enum from C++.
Can be used to get a list of values and their names.
Defines a type that represents the function to be called when iterating over all MetaEnumValue.
|
inlineexplicit |
|
protected |
Iterates over all enum values on the enum.
| void CeresEngine::Enum::forEachValue | ( | const EnumerateElementFunction & | func | ) | const |
Calls func for each value in the enum.
| func | The function to be called for each enum value. |
| const EnumValue * CeresEngine::Enum::getEnumValueWithName | ( | StringView | name | ) | const |
Gets the MetaEnumValue for the entry named name.
| name | The name of the enum, as a string. |
MetaEnumValue, or nullptr if not found. Gets the MetaEnumValue for the entry with the given value.
| value | The value of the enum. |
MetaEnumValue, or nullptr if not found. | Optional< StringView > CeresEngine::Enum::getName | ( | const Box & | value | ) | const |
Gets the name of an enum by value.
| value | The value of the enum. |
| Optional< const Box & > CeresEngine::Enum::getValue | ( | StringView | name | ) | const |
Gets the value of an enum by name.
| name | The name of the enum, as a string. |
| String CeresEngine::Enum::name |