Public Types | |
enum | numbers { badEnum, zero, one, two, three, four, lastEnum } |
Public Methods | |
virtual const numbers | enumVal (const char *name) |
Given a C string, return the associated enumeration value. More... | |
virtual const char * | enumName (numbers val) |
Given an enumeration value, return the association string. More... | |
Private Attributes | |
EnumTranslate< numbers > | t |
A "numbers" enumeration set instance of the EnumTranslate template. More... |
The template is instantiated with the local enumeration set numbers.
Definition at line 96 of file enumTranslate.cpp.
|
Definition at line 98 of file enumTranslate.cpp. 00098 { 00099 badEnum, 00100 zero, 00101 one, 00102 two, 00103 three, 00104 four, 00105 lastEnum } numbers; |
|
Given an enumeration value, return the association string. If the enumeraton value is out of range, the function will assert() Definition at line 116 of file enumTranslate.cpp. Referenced by main().
00117 { 00118 assert( val > badEnum && val < lastEnum ); 00119 00120 return t.enumName( val ); 00121 } |
|
Given a C string, return the associated enumeration value.
Definition at line 109 of file enumTranslate.cpp. 00110 { 00111 return t.enumVal( name ); 00112 } |
|
A "numbers" enumeration set instance of the EnumTranslate template.
Definition at line 125 of file enumTranslate.cpp. |