// EdoType.h #ifndef hes_EdoType_H #define hes_EdoType_H // David Adams // February 2002 // // Index describing a type. #include #include "Index.h" namespace hes { class EdoType { private: // data Index m_idx; public: // static methods // Version. static int version(); // Register a type name. // Return nonzero for error. // The name cannot be changed. static int register_type(EdoType typ, std::string name); public: // methods // Constructor. explicit EdoType(Index idx=0); // Is this a valid (nonzero) index? bool is_valid() const; // Return the type name. // Returns empty if the name is not registered. std::string name() const; // Return the index. Index index() const; }; } // end namespace // Ordering. bool operator<(const hes::EdoType& lhs, const hes::EdoType& rhs); // Equality. bool operator==(const hes::EdoType& lhs, const hes::EdoType& rhs); // Inequality. bool operator!=(const hes::EdoType& lhs, const hes::EdoType& rhs); // Output stream. std::ostream& operator<<(std::ostream& lhs, const hes::EdoType& rhs); #endif