Go to the source code of this file.
|
| #define | DECLARE_ENUM_TYPE(TypeName, ValueType) |
| |
| #define | ENUM_TYPE(value, name) |
| |
| #define | END_ENUM_TYPE |
| |
| #define DECLARE_ENUM_TYPE |
( |
|
TypeName, |
|
|
|
ValueType |
|
) |
| |
Value:typedef ValueType value_type; \
TypeName() {} \
TypeName(const TypeName &other) : value(other.value) {} \
TypeName(enum_type value) : value(value) {} \
TypeName& operator=(const TypeName &other) {value = other.value; return *this;} \
explicit TypeName(value_type value) : value(static_cast<enum_type>(value)) {} \
operator value_type() const {return static_cast<value_type>(value);} \
value_type get_value() const {return static_cast<value_type>(value);} \
enum_type get_enum() const {return value;} \
const char* c_str() const \
{ \
switch (value) \
{
Value:default: \
return "?"; \
} \
} \
private: \
enum_type value;
| #define ENUM_TYPE |
( |
|
value, |
|
|
|
name |
|
) |
| |
Value:case value: \
return name; \