CMS 3D CMS Logo

ESIndices.h
Go to the documentation of this file.
1 #ifndef FWCore_Utilities_ESIndices_h
2 #define FWCore_Utilities_ESIndices_h
3 // -*- C++ -*-
4 //
5 // Package: Framework
6 // Class : ESIndices
7 //
18 //
19 // Author: Chris Jones
20 // Created: Sat Apr 6 14:47:35 EST 2019
21 //
22 
23 // system include files
24 #include <limits>
25 #include <ostream>
26 
27 // user include files
28 
29 namespace edm {
31  public:
32  using Value_t = int;
33  constexpr ESResolverIndex() noexcept = default;
34  constexpr explicit ESResolverIndex(Value_t iValue) noexcept : index_{iValue} {}
35  constexpr ESResolverIndex(ESResolverIndex const&) noexcept = default;
37 
40 
41  constexpr bool operator==(ESResolverIndex iOther) const noexcept { return iOther.index_ == index_; }
42  constexpr bool operator!=(ESResolverIndex iOther) const noexcept { return iOther.index_ != index_; }
43 
44  constexpr Value_t value() const noexcept { return index_; }
45 
46  private:
48  };
49 
50  inline std::ostream& operator<<(std::ostream& iOS, ESResolverIndex const& iIndex) {
51  iOS << iIndex.value();
52  return iOS;
53  }
54 
55  class ESTokenIndex {
56  public:
57  using Value_t = int;
58 
59  constexpr ESTokenIndex() noexcept = default;
60  constexpr explicit ESTokenIndex(Value_t iValue) noexcept : index_{iValue} {}
61  constexpr ESTokenIndex(ESTokenIndex const&) noexcept = default;
63 
66 
67  constexpr bool operator==(ESTokenIndex iOther) const noexcept { return iOther.index_ == index_; }
68  constexpr bool operator!=(ESTokenIndex iOther) const noexcept { return iOther.index_ != index_; }
69 
70  constexpr Value_t value() const noexcept { return index_; }
71 
72  private:
74  };
75  inline std::ostream& operator<<(std::ostream& iOS, ESTokenIndex const& iIndex) {
76  iOS << iIndex.value();
77  return iOS;
78  }
79 
80  class ESRecordIndex {
81  public:
82  using Value_t = unsigned int;
83 
84  constexpr ESRecordIndex() noexcept = default;
85  constexpr explicit ESRecordIndex(unsigned int iValue) noexcept : index_{iValue} {}
86  constexpr ESRecordIndex(ESRecordIndex const&) noexcept = default;
88 
91 
92  constexpr bool operator==(ESRecordIndex iOther) const noexcept { return iOther.index_ == index_; }
93  constexpr bool operator!=(ESRecordIndex iOther) const noexcept { return iOther.index_ != index_; }
94 
95  constexpr Value_t value() const noexcept { return index_; }
96 
98 
99  private:
101  };
102  inline std::ostream& operator<<(std::ostream& iOS, ESRecordIndex const& iIndex) {
103  iOS << iIndex.value();
104  return iOS;
105  }
106 
107 } // namespace edm
108 #endif
unsigned int Value_t
Definition: ESIndices.h:82
constexpr ESTokenIndex() noexcept=default
static constexpr Value_t invalidValue()
Definition: ESIndices.h:97
constexpr Value_t value() const noexcept
Definition: ESIndices.h:70
Value_t index_
Definition: ESIndices.h:73
constexpr bool operator!=(ESResolverIndex iOther) const noexcept
Definition: ESIndices.h:42
constexpr bool operator!=(ESRecordIndex iOther) const noexcept
Definition: ESIndices.h:93
constexpr Value_t value() const noexcept
Definition: ESIndices.h:44
constexpr bool operator!=(ESTokenIndex iOther) const noexcept
Definition: ESIndices.h:68
constexpr Value_t value() const noexcept
Definition: ESIndices.h:95
HLT enums.
constexpr ESResolverIndex() noexcept=default
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger table.
constexpr ESRecordIndex() noexcept=default