Listing 1: Public interface of the SwitchState class generated by enum_gen

class SwitchState
{
public:
    static const SwitchState  OFF;
    static const SwitchState  LOW;
    static const SwitchState  MED;
    static const SwitchState  HI;
    static const SwitchState  _UNDEFINED;

    SwitchState ();
    SwitchState (const SwitchState&  objref);
    SwitchState (const string&       estr);
    SwitchState (const int           ival);

    // GetInt() is defined instead of "operator int()" to avoid
    // implicit conversions from SwitchState to int.

    short GetInt() const;

    bool valid() const;

    SwitchState& operator= (const SwitchState&  objref);

    bool operator== (const SwitchState&  objref) const;
    bool operator!= (const SwitchState&  objref) const;
    bool operator<  (const SwitchState&  objref) const;
    bool operator<= (const SwitchState&  objref) const;
    bool operator>  (const SwitchState&  objref) const;
    bool operator>= (const SwitchState&  objref) const;

    SwitchState operator++();
    SwitchState operator++(int);

    SwitchState operator--();
    SwitchState operator--(int);

    const char* GetLabel() const;
    string GetString() const;

    friend ostream& operator<< (
        ostream&             ostr,
        const SwitchState&  objref );

    friend istream& operator>> (
        istream&       ostr,
        SwitchState&  objref );

    static SwitchState first();
    static SwitchState last();
    static SwitchState count();
};

- End of Listing -