00001 // $Id: HepHistID.h,v 1.1.1.1 2005/04/21 01:15:12 zhangy Exp $ 00002 //------------------------------------------------------------------------ 00003 // 00004 // Description: 00005 // Class HepHistID : 00006 // This class allows ID numbers, ID strings or both to be used 00007 // to uniquely identify histograms. The actual use of this 00008 // class depends on the concrete package that implements HepTuple 00009 // 00010 // 00011 // Environment: 00012 // Software developed for the BaBar Detector at the SLAC B-Factory. 00013 // 00014 // Author List: 00015 // Scott Metzler Original author 00016 // 00017 //------------------------------------------------------------------------ 00018 00019 #ifndef _HepHistID_H 00020 #define _HepHistID_H 00021 00022 #include <string> 00023 00024 class HepHistID { 00025 public: 00026 // destructor 00027 virtual ~HepHistID() {} 00028 00029 // constructors 00030 HepHistID(int theNumber); 00031 // constructor with number 00032 HepHistID(const char * theString); 00033 // constructor with string 00034 HepHistID(int theNumber, std::string theString); 00035 // constructor with both number and string 00036 HepHistID(const HepHistID & other); 00037 // copy constructor 00038 00039 // accessors 00040 inline bool isIDnumberSet() const { return _numSet; } 00041 // number used in constructor 00042 inline bool isIDstringSet() const { return _stringSet; } 00043 // string used in constructor 00044 inline int getIDnumber() const { return _idNumber; } 00045 // the id number 00046 std::string getIDstring() const { return _idString; } 00047 // the id string 00048 00049 // operations 00050 HepHistID & operator++(); // prefix ++ 00051 const HepHistID operator++(int); // postfix ++ 00052 00053 HepHistID & operator--(); // prefix -- 00054 const HepHistID operator--(int); // postfix -- 00055 00056 private: 00057 bool _numSet; 00058 bool _stringSet; 00059 int _idNumber; 00060 std::string _idString; 00061 }; 00062 00063 #endif