#include <MetaEnum.h>
Public Member Functions | |
const karto::String & | GetName () const |
const karto::String & | GetName (kt_int64s value) const |
const EnumPair & | GetPair (kt_size_t index) const |
kt_size_t | GetSize () const |
kt_int64s | GetValue (const karto::String &rName) const |
kt_bool | HasName (const karto::String &rName) const |
kt_bool | HasValue (kt_int64s value) const |
kt_bool | operator!= (const MetaEnum &rOther) const |
kt_bool | operator== (const MetaEnum &rOther) const |
Static Public Member Functions | |
template<typename T > | |
static MetaEnumHelper | Register (const karto::String &rName) |
Protected Member Functions | |
void | AddEnumPair (const EnumPair &rPair) |
Private Member Functions | |
MetaEnum (const karto::String &rName) | |
~MetaEnum () | |
Private Attributes | |
MetaEnumPrivate * | m_pPrivate |
Friends | |
class | MetaEnumHelper |
class | MetaEnumManager |
A MetaEnum stores information about an enum like enum name and enum values see EnumPair.
Definition at line 121 of file MetaEnum.h.
karto::MetaEnum::MetaEnum | ( | const karto::String & | rName | ) | [private] |
Definition at line 42 of file MetaEnum.cpp.
karto::MetaEnum::~MetaEnum | ( | ) | [private] |
Definition at line 48 of file MetaEnum.cpp.
void karto::MetaEnum::AddEnumPair | ( | const EnumPair & | rPair | ) | [protected] |
const karto::String & karto::MetaEnum::GetName | ( | ) | const |
const karto::String & karto::MetaEnum::GetName | ( | kt_int64s | value | ) | const |
Gets the associated EnumPair name with the specified value.
value |
Definition at line 80 of file MetaEnum.cpp.
const EnumPair & karto::MetaEnum::GetPair | ( | kt_size_t | index | ) | const |
Gets a reference to the EnumPair at index.
index |
Exception | if index out of range |
Definition at line 107 of file MetaEnum.cpp.
kt_size_t karto::MetaEnum::GetSize | ( | ) | const |
Gets the number of EnumPair's registered with this MetaEnum.
Definition at line 92 of file MetaEnum.cpp.
kt_int64s karto::MetaEnum::GetValue | ( | const karto::String & | rName | ) | const |
Gets the associated EnumPair value with the specified name.
rName |
Definition at line 63 of file MetaEnum.cpp.
kt_bool karto::MetaEnum::HasName | ( | const karto::String & | rName | ) | const |
Checks if enum have a defined EnumPair by specified name.
rName |
Definition at line 53 of file MetaEnum.cpp.
kt_bool karto::MetaEnum::HasValue | ( | kt_int64s | value | ) | const |
Checks if enum have a defined EnumPair by specified value.
value |
Definition at line 58 of file MetaEnum.cpp.
Inequality operator checks inequality between two MetaEnum's.
rOther |
Definition at line 102 of file MetaEnum.cpp.
Equality operator checks equality between two MetaEnum's.
rOther |
Definition at line 97 of file MetaEnum.cpp.
static MetaEnumHelper karto::MetaEnum::Register | ( | const karto::String & | rName | ) | [inline, static] |
Registers a new MetaEnum by name.
rName | Name of new MetaEnum |
Definition at line 130 of file MetaEnum.h.
friend class MetaEnumHelper [friend] |
Definition at line 210 of file MetaEnum.h.
friend class MetaEnumManager [friend] |
Definition at line 211 of file MetaEnum.h.
MetaEnumPrivate* karto::MetaEnum::m_pPrivate [private] |
Definition at line 218 of file MetaEnum.h.