#include "Export.h"
#include <trUtil/WarningUtils.h>
#include <ostream>
#include <string>
#include <vector>
Go to the source code of this file.
|
| | trUtil |
| | Namespace that holds various utility classes for the engine.
|
| |
|
| #define | DECLARE_ENUM(EnumType) |
| | Helper macros used to create the static data and methods needed to enumerate an EnumerationString. More...
|
| |
| #define | IMPLEMENT_ENUM(EnumType) |
| | A macro that defines implement enum. More...
|
| |
◆ DECLARE_ENUM
| #define DECLARE_ENUM |
( |
|
EnumType | ) |
|
Value:public: \
using EnumerateListType = std::vector<EnumType*>; \
\
static const EnumerateListType& EnumerateType() \
{ \
return EnumType::mInstances; \
} \
\
static const std::vector<trUtil::EnumerationString*>& Enumerate() \
{ \
return EnumType::mGenericInstances; \
} \
\
static EnumType* GetValueForName(const std::string& name); \
\
private: \
static EnumerateListType mInstances; \
static std::vector<trUtil::EnumerationString*> mGenericInstances; \
static void AddInstance(EnumType* instance); \
public:
Helper macros used to create the static data and methods needed to enumerate an EnumerationString.
- Parameters
-
| EnumType | Type of the enum. |
Definition at line 255 of file EnumerationString.h.
◆ IMPLEMENT_ENUM
| #define IMPLEMENT_ENUM |
( |
|
EnumType | ) |
|
Value:EnumType::EnumerateListType EnumType::mInstances; \
std::vector<trUtil::EnumerationString*> EnumType::mGenericInstances; \
void EnumType::AddInstance(EnumType* instance) \
{ \
EnumType::mInstances.push_back(instance); \
EnumType::mGenericInstances.push_back(instance); \
} \
EnumType* EnumType::GetValueForName(const std::string& name) \
{ \
for (unsigned i = 0; i < mInstances.size(); ++i) \
{ \
if ((*mInstances[i]) == name) \
{ \
return mInstances[i]; \
} \
} \
return nullptr; \
}
A macro that defines implement enum.
- Parameters
-
| EnumType | Type of the enum. |
Definition at line 284 of file EnumerationString.h.