Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
karto::MetaEnum Class Reference

#include <MetaEnum.h>

Inheritance diagram for karto::MetaEnum:
Inheritance graph
[legend]

Public Member Functions

const karto::StringGetName () const
 
const karto::StringGetName (kt_int64s value) const
 
const EnumPairGetPair (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
 
- Public Member Functions inherited from karto::Referenced
 Referenced ()
 

Static Public Member Functions

template<typename T >
static MetaEnumHelper Register (const karto::String &rName)
 

Protected Member Functions

void AddEnumPair (const EnumPair &rPair)
 
- Protected Member Functions inherited from karto::Referenced
kt_int32s GetReferenceCount ()
 
kt_int32s Reference () const
 
kt_int32s Unreference () const
 
kt_int32s UnreferenceNoDelete () const
 

Private Member Functions

 MetaEnum (const karto::String &rName)
 
 ~MetaEnum ()
 

Private Attributes

MetaEnumPrivatem_pPrivate
 

Friends

class MetaEnumHelper
 
class MetaEnumManager
 

Detailed Description

A MetaEnum stores information about an enum like enum name and enum values see EnumPair.

Definition at line 121 of file MetaEnum.h.

Constructor & Destructor Documentation

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.

Member Function Documentation

void karto::MetaEnum::AddEnumPair ( const EnumPair rPair)
protected

Adds EnumPair.

Parameters
rPairEnumPair to add

Definition at line 118 of file MetaEnum.cpp.

const karto::String & karto::MetaEnum::GetName ( ) const

Gets the name of the MetaEnum.

Returns
name of MetaEnum

Definition at line 75 of file MetaEnum.cpp.

const karto::String & karto::MetaEnum::GetName ( kt_int64s  value) const

Gets the associated EnumPair name with the specified value.

Parameters
value
Returns
enum name
Exceptions
Exceptionif no EnumPair is defined for 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.

Parameters
index
Returns
EnumPair at index
Exceptions
Exceptionif 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.

Returns
number of EnumPair's

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.

Parameters
rName
Returns
enum value
Exceptions
Exceptionif no EnumPair is defined for name

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.

Parameters
rName
Returns
true of EnumPair exists, false otherwise

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.

Parameters
value
Returns
true of EnumPair exists, false otherwise

Definition at line 58 of file MetaEnum.cpp.

kt_bool karto::MetaEnum::operator!= ( const MetaEnum rOther) const

Inequality operator checks inequality between two MetaEnum's.

Parameters
rOther
Returns
true if unequal, false otherwise

Definition at line 102 of file MetaEnum.cpp.

kt_bool karto::MetaEnum::operator== ( const MetaEnum rOther) const

Equality operator checks equality between two MetaEnum's.

Parameters
rOther
Returns
true if equal, false otherwise

Definition at line 97 of file MetaEnum.cpp.

template<typename T >
static MetaEnumHelper karto::MetaEnum::Register ( const karto::String rName)
inlinestatic

Registers a new MetaEnum by name.

Parameters
rNameName of new MetaEnum
Returns
helper class for creating MetaEnum

Definition at line 130 of file MetaEnum.h.

Friends And Related Function Documentation

friend class MetaEnumHelper
friend

Definition at line 210 of file MetaEnum.h.

friend class MetaEnumManager
friend

Definition at line 211 of file MetaEnum.h.

Member Data Documentation

MetaEnumPrivate* karto::MetaEnum::m_pPrivate
private

Definition at line 218 of file MetaEnum.h.


The documentation for this class was generated from the following files:


nav2d_karto
Author(s): Sebastian Kasperski
autogenerated on Thu Jun 6 2019 19:20:25