CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10/src/DataFormats/Provenance/interface/RunID.h

Go to the documentation of this file.
00001 #ifndef DataFormats_Provenance_RunID_h
00002 #define DataFormats_Provenance_RunID_h
00003 // -*- C++ -*-
00004 //
00005 // Package:     DataFormats/Provenance
00006 // Class  :     RunID
00007 // 
00016 //
00017 // $Id: RunID.h,v 1.2 2007/06/14 03:38:30 wmtan Exp $
00018 //
00019 
00020 // system include files
00021 #include <iosfwd>
00022 
00023 // user include files
00024 
00025 // forward declarations
00026 namespace edm {
00027 
00028    typedef unsigned int RunNumber_t;
00029 
00030    
00031 class RunID
00032 {
00033 
00034    public:
00035    
00036    
00037       RunID() : run_(0) {}
00038       explicit RunID(RunNumber_t iRun) :
00039         run_(iRun) {}
00040       
00041       //virtual ~RunID();
00042 
00043       // ---------- const member functions ---------------------
00044       RunNumber_t run() const { return run_; }
00045    
00046       //moving from one RunID to another one
00047       RunID next() const {
00048          return RunID(run_+1);
00049       }
00050       RunID previous() const {
00051          if(run_ != 0) {
00052             return RunID(run_-1);
00053          }
00054          return RunID(0);
00055       }
00056       
00057       bool operator==(RunID const& iRHS) const {
00058          return iRHS.run_ == run_;
00059       }
00060       bool operator!=(RunID const& iRHS) const {
00061          return !(*this == iRHS);
00062       }
00063       
00064       bool operator<(RunID const& iRHS) const {
00065          return run_ < iRHS.run_;
00066       }
00067       bool operator<=(RunID const& iRHS) const {
00068          return run_ <= iRHS.run_;
00069       }
00070       bool operator>(RunID const& iRHS) const {
00071          return run_ > iRHS.run_;
00072       }
00073       bool operator>=(RunID const& iRHS) const {
00074          return run_ >= iRHS.run_;
00075       }
00076       // ---------- static functions ---------------------------
00077 
00078       static RunNumber_t maxRunNumber() {
00079          return 0xFFFFFFFFU;
00080       }
00081    
00082       static RunID firstValidRun() {
00083          return RunID(1);
00084       }
00085       // ---------- member functions ---------------------------
00086    
00087    private:
00088       //RunID(RunID const&); // stop default
00089 
00090       //RunID const& operator=(RunID const&); // stop default
00091 
00092       // ---------- member data --------------------------------
00093       RunNumber_t run_;
00094 };
00095 
00096 std::ostream& operator<<(std::ostream& oStream, RunID const& iID);
00097 
00098 }
00099 #endif