CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RunID.h
Go to the documentation of this file.
1 #ifndef DataFormats_Provenance_RunID_h
2 #define DataFormats_Provenance_RunID_h
3 // -*- C++ -*-
4 //
5 // Package: DataFormats/Provenance
6 // Class : RunID
7 //
16 //
17 // $Id: RunID.h,v 1.2 2007/06/14 03:38:30 wmtan Exp $
18 //
19 
20 // system include files
21 #include <iosfwd>
22 
23 // user include files
24 
25 // forward declarations
26 namespace edm {
27 
28  typedef unsigned int RunNumber_t;
29 
30 
31 class RunID
32 {
33 
34  public:
35 
36 
37  RunID() : run_(0) {}
38  explicit RunID(RunNumber_t iRun) :
39  run_(iRun) {}
40 
41  //virtual ~RunID();
42 
43  // ---------- const member functions ---------------------
44  RunNumber_t run() const { return run_; }
45 
46  //moving from one RunID to another one
47  RunID next() const {
48  return RunID(run_+1);
49  }
50  RunID previous() const {
51  if(run_ != 0) {
52  return RunID(run_-1);
53  }
54  return RunID(0);
55  }
56 
57  bool operator==(RunID const& iRHS) const {
58  return iRHS.run_ == run_;
59  }
60  bool operator!=(RunID const& iRHS) const {
61  return !(*this == iRHS);
62  }
63 
64  bool operator<(RunID const& iRHS) const {
65  return run_ < iRHS.run_;
66  }
67  bool operator<=(RunID const& iRHS) const {
68  return run_ <= iRHS.run_;
69  }
70  bool operator>(RunID const& iRHS) const {
71  return run_ > iRHS.run_;
72  }
73  bool operator>=(RunID const& iRHS) const {
74  return run_ >= iRHS.run_;
75  }
76  // ---------- static functions ---------------------------
77 
79  return 0xFFFFFFFFU;
80  }
81 
82  static RunID firstValidRun() {
83  return RunID(1);
84  }
85  // ---------- member functions ---------------------------
86 
87  private:
88  //RunID(RunID const&); // stop default
89 
90  //RunID const& operator=(RunID const&); // stop default
91 
92  // ---------- member data --------------------------------
94 };
95 
96 std::ostream& operator<<(std::ostream& oStream, RunID const& iID);
97 
98 }
99 #endif
RunNumber_t run() const
Definition: RunID.h:44
RunNumber_t run_
Definition: RunID.h:93
static RunID firstValidRun()
Definition: RunID.h:82
bool operator<(RunID const &iRHS) const
Definition: RunID.h:64
bool operator>(RunID const &iRHS) const
Definition: RunID.h:70
bool operator==(RunID const &iRHS) const
Definition: RunID.h:57
bool operator>=(RunID const &iRHS) const
Definition: RunID.h:73
RunID()
Definition: RunID.h:37
bool operator!=(RunID const &iRHS) const
Definition: RunID.h:60
bool operator<=(RunID const &iRHS) const
Definition: RunID.h:67
RunID next() const
Definition: RunID.h:47
unsigned int RunNumber_t
Definition: EventRange.h:32
RunID previous() const
Definition: RunID.h:50
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.
static RunNumber_t maxRunNumber()
Definition: RunID.h:78
RunID(RunNumber_t iRun)
Definition: RunID.h:38