#ifndef CUTID_HPP #define CUTID_HPP //======================================================================== // // Name: CutID.hpp // // Purpose: A cut identifier class. An association between cut names and // cut identifiers is maintained by the cut registry in class // CutRecorder. // // Created: 3-Jul-2000 H. Greenlee // //======================================================================== #include namespace trf { class CutID; // Output stream. std::ostream& operator<<(std::ostream&, const CutID&); class CutID { public: // Constructor, destructor CutID(int id=-1) : _id(id) {} // Default-constructed object is invalid. ~CutID() {} // Operators. bool operator==(const CutID& c) const {return _id == c._id;} bool operator<(const CutID& c) const {return _id < c._id;} friend std::ostream& operator<<(std::ostream&, const CutID&); // Methods. int id() const {return _id;} bool is_valid() const {return _id>=0;} private: // Attributes. int _id; // Cut identifier (>=0 -> valid, <0 -> invalid). }; } // end namespace trf #endif