Enum< E > Class Template Reference

#include <Enum.h>

Inheritance diagram for Enum< E >:

Inheritance graph
[legend]
Collaboration diagram for Enum< E >:

Collaboration graph
[legend]

List of all members.


Detailed Description

template<class E>
class Enum< E >

A template class for enumerations which allows them to be printable and serializable.

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
Enumoperator= (const Enum &oe)
 assignment operator for another Enum object
Enumoperator= (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

The documentation for this class was generated from the following file:

Generated on Sat Oct 4 21:30:27 2008 for Mace Library by  doxygen 1.5.5