// EventId.h #ifndef hes_EventId_H #define hes_EventId_H // David Adams // February 2002 // // Holds the ID for a HES event. // // The ID has two pieces: // 32-bit hi index // 32-bit lo index // // Both must be nonzero for the event ID to be valid. // // A file ID can be recorded as and reconstituted from the hi and lo // indices. #include #include "Index.h" namespace hes { class EventId { public: // static methods // Return version number. // This will change if the bit allocations change. static int version(); private: // data // Index. Index m_hi; Index m_lo; public: // methods // Default constructor. EventId(); // Constructor from the type_hi and lo indices. EventId(Index hi, Index lo); // Constructor from merged hi index an // Return if this is a valid index. bool is_valid() const; // Return the indices. Index hi_index() const; Index lo_index() const; }; } // end namespace hes // Ordering. bool operator<(const hes::EventId& lhs, const hes::EventId& rhs); // Equality. bool operator==(const hes::EventId& lhs, const hes::EventId& rhs); // Inequality. bool operator!=(const hes::EventId& lhs, const hes::EventId& rhs); // Output stream. std::ostream& operator<<(std::ostream& lhs, const hes::EventId& rhs); #endif