#include <Enum.h>
Public Methods | |
| bool | operator== (Enumeration const &e) const |
| Equality of Enumerations means sharing the same EnumerationCore. | |
| bool | operator!= (Enumeration const &e) const |
| Equality of Enumerations means sharing the same EnumerationCore. | |
| Enumeration (std::string const &s) | |
| Construct a new Enumeration, creating and binding to a new EnumerationCore. | |
| std::string | getToken (int value) const |
| Lookup an element's token by its value. | |
| int | getValue (std::string const &token) const |
| Lookup an element's value by its token. | |
| int | size () const |
| Get the number of items in the Enumeration set. | |
| std::string | __repr__ () const |
| Return a string representation of the Enumeration (used by SWIG/Python). | |
| const std::vector< EnumLink > | each () const |
| Return an ordered vector of Enums in this Enumeration. | |
| const std::vector< std::string > | eachToken () const |
| Return an ordered vector of string values in this Enumeration. | |
| const std::vector< int > | eachValue () const |
| Return an ordered vector of string values in this Enumeration. | |
| const std::vector< EnumLink > | range (EnumLink const &a, EnumLink const &b) const |
| Get a list of Enums in the range between two Enums (inclusive). | |
| const std::vector< EnumLink > | range (std::string const &a, std::string const &b) const |
| Get a list of Enums in the range between two strings (inclusive). | |
| const std::vector< EnumLink > | range (int a, int b) const |
| Get a list of Enums in the range between two values (inclusive). | |
| bool | contains (EnumLink const &x) const |
| Test for inclusion in the Enumeration set. | |
| bool | contains (int value) const |
| Test for inclusion in the Enumeration set. | |
| bool | contains (std::string const &token) const |
| Test for inclusion in the Enumeration set. | |
| EnumLink | last () const |
| Return the last enum in the Enumeration set. | |
| EnumLink | first () const |
| Return the first enum in the Enumeration set. | |
| EnumLink | operator[] (int value) const |
| accessor for lookup by value | |
| EnumLink | operator[] (std::string const &token) const |
| accessor for lookup by token | |
Friends | |
| class | EnumLink |
A class representing an ordered set of unique items that can be indexed by number or token.
Enumerations are usually created as static const class members, together with Enum<> members that use the static Enumeration as the template argument. For example:
class Foo { public: static const Enumeration MyEnumeration; Enum<MyEnumeration> MyEnum; ... };
When defining the Enumeration, specify the items in order as a white-space separated string, as in:
Enumeration Foo::MyEnumeration("apple orange cherry");
|
|
Construct a new Enumeration, creating and binding to a new EnumerationCore. The enumeration tokens are must be separated by white-space and can have an optional value assignment. Tokens without explicit values will be assigned sequential values following the last specified value. The initial default value is zero. Examples:
|
|
|
Return a string representation of the Enumeration (used by SWIG/Python).
|
|
|
Test for inclusion in the Enumeration set.
|
|
|
Test for inclusion in the Enumeration set.
|
|
|
Test for inclusion in the Enumeration set.
|
|
|
Return an ordered vector of Enums in this Enumeration.
|
|
|
Return an ordered vector of string values in this Enumeration.
|
|
|
Return an ordered vector of string values in this Enumeration.
|
|
|
Return the first enum in the Enumeration set.
|
|
|
Lookup an element's token by its value.
|
|
|
Lookup an element's value by its token.
|
|
|
Return the last enum in the Enumeration set.
|
|
|
Equality of Enumerations means sharing the same EnumerationCore.
|
|
|
Equality of Enumerations means sharing the same EnumerationCore.
|
|
|
accessor for lookup by token
|
|
|
accessor for lookup by value
|
|
||||||||||||
|
Get a list of Enums in the range between two values (inclusive).
|
|
||||||||||||
|
Get a list of Enums in the range between two strings (inclusive).
|
|
||||||||||||
|
Get a list of Enums in the range between two Enums (inclusive).
|
|
|
Get the number of items in the Enumeration set.
|
|
|
|
|
SimData version pre-0.4.0. For more information on SimData, visit the SimData Homepage. Generated on Tue Oct 14 12:06:40 2003, using Doxygen 1.2.18. |