CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 //
18 
19 // system include files
20 #include <iosfwd>
21 
22 // user include files
24 
25 // forward declarations
26 namespace edm {
27 
28  class RunID {
29  public:
31  explicit RunID(RunNumber_t iRun) : run_(iRun) {}
32 
33  //virtual ~RunID();
34 
35  // ---------- const member functions ---------------------
36  RunNumber_t run() const { return run_; }
37 
38  //moving from one RunID to another one
39  RunID next() const { return RunID(run_ + 1); }
40  RunID previous() const {
41  if (run_ != 0) {
42  return RunID(run_ - 1);
43  }
44  return RunID(0);
45  }
46 
47  bool operator==(RunID const& iRHS) const { return iRHS.run_ == run_; }
48  bool operator!=(RunID const& iRHS) const { return !(*this == iRHS); }
49 
50  bool operator<(RunID const& iRHS) const { return run_ < iRHS.run_; }
51  bool operator<=(RunID const& iRHS) const { return run_ <= iRHS.run_; }
52  bool operator>(RunID const& iRHS) const { return run_ > iRHS.run_; }
53  bool operator>=(RunID const& iRHS) const { return run_ >= iRHS.run_; }
54  // ---------- static functions ---------------------------
55 
56  static RunNumber_t maxRunNumber() { return 0xFFFFFFFFU; }
57 
58  static RunID firstValidRun() { return RunID(1); }
59  // ---------- member functions ---------------------------
60 
61  private:
62  //RunID(RunID const&); // stop default
63 
64  //RunID const& operator=(RunID const&); // stop default
65 
66  // ---------- member data --------------------------------
68  };
69 
70  std::ostream& operator<<(std::ostream& oStream, RunID const& iID);
71 
72 } // namespace edm
73 #endif
RunNumber_t run() const
Definition: RunID.h:36
RunNumber_t run_
Definition: RunID.h:67
RunNumber_t const invalidRunNumber
static RunID firstValidRun()
Definition: RunID.h:58
bool operator<(RunID const &iRHS) const
Definition: RunID.h:50
bool operator>(RunID const &iRHS) const
Definition: RunID.h:52
bool operator==(RunID const &iRHS) const
Definition: RunID.h:47
bool operator>=(RunID const &iRHS) const
Definition: RunID.h:53
RunID()
Definition: RunID.h:30
bool operator!=(RunID const &iRHS) const
Definition: RunID.h:48
bool operator<=(RunID const &iRHS) const
Definition: RunID.h:51
RunID next() const
Definition: RunID.h:39
unsigned int RunNumber_t
RunID previous() const
Definition: RunID.h:40
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.
static RunNumber_t maxRunNumber()
Definition: RunID.h:56
RunID(RunNumber_t iRun)
Definition: RunID.h:31