#include <Enum.h>


Should work transparently in place of an enum when templated on that enum type. It auto-casts to the enum type and can be compared or assigned based on the enum type.
Example:
enum _state_type { init, joined, joining }; typedef Enum<_state_type> state_type; state_type s = init; maceout << "The state s is " << s << Log::endl;
Definition at line 88 of file Enum.h.
Public Member Functions | |
| operator E () | |
| auto-cast to the templated enumeration type | |
| operator E () const | |
| const auto-cast to the templated enumeration type | |
| Enum & | operator= (const Enum &oe) |
| assignment operator for another Enum object | |
| Enum & | operator= (const E &oe) |
| assignment operator that takes a templated enumeration type | |
| bool | operator== (const E &oe) const |
| equality with another Enum object | |
| bool | operator!= (const E &oe) const |
| inequality with another Enum object | |
| Enum () | |
| default constructor | |
| Enum (const E &oe) | |
| constructor which takes a templated enumeration type object | |
| Enum (const Enum &oe) | |
| copy-constructor | |
| int | deserialize (std::istream &in) throw (mace::SerializationException) |
Replace the current object value from the bytes read from in, returning the number of bytes read. | |
| void | serialize (std::string &str) const |
Encode the current object at the end of str as a bytestring in a compact format (and which doesn't require delimiters to parse). | |
| int | deserializeXML_RPC (std::istream &in) throw (mace::SerializationException) |
deserialize this object from XML_RPC format from in | |
| void | serializeXML_RPC (std::string &str) const throw (mace::SerializationException) |
serialize this object onto the end of str in XML_RPC format | |
1.5.5