Implements an extensible enumeration type.
More...
#include <Enumeration.h>
List of all members.
Detailed Description
Implements an extensible enumeration type.
Constructor & Destructor Documentation
| Enumeration::Enumeration |
( |
|
) |
[inline] |
| Enumeration::~Enumeration |
( |
|
) |
[inline] |
Member Function Documentation
| void Enumeration::bind |
( |
const std::string & |
name, |
|
|
int |
val = -1 | |
|
) |
| | |
Binds a string constant to a numeric value.
- Parameters:
-
| name | A const reference to a string. |
| val | Integer to use for an ID. Default value of -1 indicates an automatic value assignment. |
- Note:
- Negative values are interpreted as requesting that numeric ID's be automatically generated.
-
Attempts to assign a string constant to a numeric ID that is already bound will be ignored.
-
Attempts to add duplicate string constants will be ignored.
| const std::string & Enumeration::find |
( |
int |
val |
) |
|
Gets a string constant that's been bound to a numeric ID.
- Returns:
- Returns the requested string constant or an empty string if not found.
| int Enumeration::find |
( |
const std::string & |
name |
) |
|
Gets a numeric ID that's been bound to a string constant.
- Returns:
- Returns the requested value or
-1 if not found.
Member Data Documentation
The documentation for this class was generated from the following files: