// FileType.h #ifndef hes_FileType_H #define hes_FileType_H // David Adams // February 2002 // // Assigns a unique integer index to each known file type. #include #include #include "Index.h" namespace hes { class FileType { public: // static member data // Invalid file type. static const FileType INVALID; // Text event file for testing. static const FileType TEXT; // Reference-only event file. static const FileType REFERENCE; // BNL ROOT event file. static const FileType BNL_ROOT; public: // static member functions // Return the invalid file index. static const Index invalid_index(); // Return the range of known file indices. static const Index minimum_index(); static const Index maximum_index(); private: // data Index m_idx; public: // functions // Constructor. explicit FileType(Index idx =0); // Return if this is a known type. bool is_valid() const; // Return the index; // Returns INVALID_INDEX if invalid. Index index() const; // Return the name of the type. std::string name() const; // Equality. bool operator==(const FileType& rhs) const; }; } // end namespace hes // Output stream. std::ostream& operator<<(std::ostream& lhs, const hes::FileType& rhs); #endif