![]() |
Murl Engine API
Version 2018.3
|
Enumeration string mapping template class. More...
#include <murl_enum.h>
Enumeration string mapping template class.
Classes | |
struct | Item |
Definition of an Enum initialization item. More... | |
Public Types | |
typedef EnumType | ValueType |
The template parameter value type. More... | |
Public Member Functions | |
Enum (const Item *items, UInt32 numberOfElements) | |
Constructor taking an array of enum items. More... | |
Enum (const String &name, const Item *items, UInt32 numberOfElements) | |
Constructor taking an enumeration name and an array of enum items. More... | |
Enum (const String &name, EnumContainer &container, const Item *items, UInt32 numberOfElements) | |
Constructor taking an array of enum items and a container. More... | |
const String & | GetName () const |
Get the name of the enumerator. More... | |
EnumType | GetDefaultValue () const |
Get the default enumeration value. More... | |
UInt32 | GetCount () const |
Get the total number of enumeration entries. More... | |
Bool | IsEnumValueAvailable (EnumType value) const |
Check if an enumeration value is available. More... | |
Bool | IsEnumNameAvailable (const String &name) const |
Check if an enumeration name is available. More... | |
SInt32 | GetEnumIndexByValue (EnumType value) const |
Get the zero-based index of an enumeration value. More... | |
SInt32 | GetEnumIndexByValue (EnumType value, UInt32 hash) const |
Get the zero-based index of an enumeration value. More... | |
SInt32 | GetEnumIndexByName (const String &name) const |
Get the zero-based index of an enumeration name. More... | |
SInt32 | GetEnumIndexByName (const String &name, UInt32 hash) const |
Get the zero-based index of an enumeration name. More... | |
const String & | GetEnumNameByIndex (UInt32 index) const |
Get the enumeration name at a given index. More... | |
EnumType | GetEnumValueByIndex (UInt32 index) const |
Get the enumeration value at a given index. More... | |
const String & | GetEnumNameByValue (EnumType value, Bool &error, Bool clearError) const |
Get the enumeration name for a given enumeration value. More... | |
const String & | GetEnumNameByValue (EnumType value, Bool &error) const |
Get the enumeration name for a given enumeration value. More... | |
const String & | GetEnumNameByValue (EnumType value) const |
Get the enumeration name for a given enumeration value. More... | |
EnumType | GetEnumValueByName (const String &name, Bool &error, Bool clearError) const |
Get the enumeration value for a given enumeration name. More... | |
EnumType | GetEnumValueByName (const String &name, Bool &error) const |
Get the enumeration value for a given enumeration name. More... | |
EnumType | GetEnumValueByName (const String &name) const |
Get the enumeration value for a given enumeration name. More... | |
const String & | GetEnumNameByValue (EnumType value, UInt32 hash, Bool &error, Bool clearError) const |
Get the enumeration name for a given enumeration value, using a precomputed hash value. More... | |
const String & | GetEnumNameByValue (EnumType value, UInt32 hash, Bool &error) const |
Get the enumeration name for a given enumeration value, using a precomputed hash value. More... | |
const String & | GetEnumNameByValue (EnumType value, UInt32 hash) const |
Get the enumeration name for a given enumeration value, using a precomputed hash value. More... | |
EnumType | GetEnumValueByName (const String &name, UInt32 hash, Bool &error, Bool clearError) const |
Get the enumeration value for a given enumeration name, using a precomputed hash value. More... | |
EnumType | GetEnumValueByName (const String &name, UInt32 hash, Bool &error) const |
Get the enumeration value for a given enumeration name, using a precomputed hash value. More... | |
EnumType | GetEnumValueByName (const String &name, UInt32 hash) const |
Get the enumeration value for a given enumeration name, using a precomputed hash value. More... | |
const Map< String, UInt32 > & | GetItemsByName () const |
Get the enumeration values by name map. More... | |
const Map< UInt32, String > & | GetItemsByValue () const |
Get the names by enumeration value map. More... | |
operator const Enum< SInt32 > & () const | |
Conversion operator. More... | |
Protected Attributes | |
Map< String, UInt32 > | mItemsByName |
The enumeration values by name map. More... | |
Map< UInt32, String > | mItemsByValue |
The names by enumeration value map. More... | |
EnumType | mDefaultValue |
The default enumeration value. More... | |
String | mName |
The name of the enumerator. More... | |
typedef EnumType Murl::Enum< EnumType >::ValueType |
The template parameter value type.
|
inline |
Constructor taking an array of enum items.
items | Pointer to an array of initialization items. If the item's mName has a null pointer, the mValue is the default value. |
numberOfElements | The number of elements in the array. The macro NUMBER_OF_ARRAY_ELEMENTS can be used to determine the number. |
|
inline |
Constructor taking an enumeration name and an array of enum items.
name | The enumeration's name. |
items | Pointer to an array of initialization items. If the item's mName has a null pointer, the mValue is the default value. |
numberOfElements | The number of elements in the array. The macro NUMBER_OF_ARRAY_ELEMENTS can be used to determine the number. |
|
inline |
Constructor taking an array of enum items and a container.
name | The enumeration's name. |
container | The container to add this enumeration to. |
items | Pointer to an array of initialization items. If the item's mName has a null pointer, the mValue is the default value. |
numberOfElements | The number of elements in the array. The macro NUMBER_OF_ARRAY_ELEMENTS can be used to determine the number. |
|
inline |
Get the name of the enumerator.
|
inline |
Get the default enumeration value.
|
inline |
Get the total number of enumeration entries.
|
inline |
Check if an enumeration value is available.
value | The enumeration value to check. |
|
inline |
Check if an enumeration name is available.
name | The enumeration name to check. |
|
inline |
Get the zero-based index of an enumeration value.
value | The enumeration value to check. |
|
inline |
Get the zero-based index of an enumeration value.
value | The enumeration value to check. |
hash | The precomputed hash value. |
|
inline |
Get the zero-based index of an enumeration name.
name | The enumeration name to check. |
|
inline |
Get the zero-based index of an enumeration name.
name | The enumeration name to check. |
hash | The precomputed hash value. |
|
inline |
Get the enumeration name at a given index.
index | The index to query, in the range from 0 to GetCount()-1. |
|
inline |
Get the enumeration value at a given index.
index | The index to query, in the range from 0 to GetCount()-1. |
|
inline |
Get the enumeration name for a given enumeration value.
value | The enumeration value to look up. |
error | The error return value is set to true if the value is not found. |
clearError | If false, the error parameter is left in its given state if no error occurred. |
|
inline |
Get the enumeration name for a given enumeration value.
value | The enumeration value to look up. |
error | The error return value is set to true if the value is not found, or false if OK. |
|
inline |
Get the enumeration name for a given enumeration value.
value | The enumeration value to look up. |
|
inline |
Get the enumeration value for a given enumeration name.
name | The name string to look up. |
error | The error return value is set to true if the name is not found. |
clearError | If false, the error parameter is left in its given state if no error occurred. |
|
inline |
Get the enumeration value for a given enumeration name.
name | The name string to look up. |
error | The error return value is set to true if the value is not found, or false if OK. |
|
inline |
Get the enumeration value for a given enumeration name.
name | The name string to look up. |
|
inline |
Get the enumeration name for a given enumeration value, using a precomputed hash value.
value | The enumeration value to look up. |
hash | The precomputed hash value. |
error | The error return value is set to true if the value is not found. |
clearError | If false, the error parameter is left in its given state if no error occurred. |
|
inline |
Get the enumeration name for a given enumeration value, using a precomputed hash value.
value | The enumeration value to look up. |
hash | The precomputed hash value. |
error | The error return value is set to true if the value is not found, or false if OK. |
|
inline |
Get the enumeration name for a given enumeration value, using a precomputed hash value.
value | The enumeration value to look up. |
hash | The precomputed hash value. |
|
inline |
Get the enumeration value for a given enumeration name, using a precomputed hash value.
name | The name string to look up. |
hash | The precomputed hash value. |
error | The error return value is set to true if the name is not found. |
clearError | If false, the error parameter is left in its given state if no error occurred. |
|
inline |
Get the enumeration value for a given enumeration name, using a precomputed hash value.
name | The name string to look up. |
hash | The precomputed hash value. |
error | The error return value is set to true if the value is not found, or false if OK. |
|
inline |
Get the enumeration value for a given enumeration name, using a precomputed hash value.
name | The name string to look up. |
hash | The precomputed hash value. |
|
inline |
Get the enumeration values by name map.
|
inline |
Get the names by enumeration value map.
|
inline |
Conversion operator.
|
protected |
The enumeration values by name map.
|
protected |
The names by enumeration value map.
|
protected |
The default enumeration value.
|
protected |
The name of the enumerator.