CMS 3D CMS Logo

ESIndices.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 #ifndef FWCore_Utilities_ESIndices_h
3 #define FWCore_Utilities_ESIndices_h
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 
48  }
49 
52  }
53 
54  private:
56  };
57 
58  inline std::ostream& operator<<(std::ostream& iOS, ESResolverIndex const& iIndex) {
59  iOS << iIndex.value();
60  return iOS;
61  }
62 
63  class ESTokenIndex {
64  public:
65  using Value_t = int;
66 
67  constexpr ESTokenIndex() noexcept = default;
68  constexpr explicit ESTokenIndex(Value_t iValue) noexcept : index_{iValue} {}
69  constexpr ESTokenIndex(ESTokenIndex const&) noexcept = default;
71 
74 
75  constexpr bool operator==(ESTokenIndex iOther) const noexcept { return iOther.index_ == index_; }
76  constexpr bool operator!=(ESTokenIndex iOther) const noexcept { return iOther.index_ != index_; }
77 
78  constexpr Value_t value() const noexcept { return index_; }
79 
80  private:
82  };
83  inline std::ostream& operator<<(std::ostream& iOS, ESTokenIndex const& iIndex) {
84  iOS << iIndex.value();
85  return iOS;
86  }
87 
88  class ESRecordIndex {
89  public:
90  using Value_t = unsigned int;
91 
92  constexpr ESRecordIndex() noexcept = default;
93  constexpr explicit ESRecordIndex(unsigned int iValue) noexcept : index_{iValue} {}
94  constexpr ESRecordIndex(ESRecordIndex const&) noexcept = default;
96 
99 
100  constexpr bool operator==(ESRecordIndex iOther) const noexcept { return iOther.index_ == index_; }
101  constexpr bool operator!=(ESRecordIndex iOther) const noexcept { return iOther.index_ != index_; }
102 
103  constexpr Value_t value() const noexcept { return index_; }
104 
106 
107  private:
109  };
110  inline std::ostream& operator<<(std::ostream& iOS, ESRecordIndex const& iIndex) {
111  iOS << iIndex.value();
112  return iOS;
113  }
114 
115 } // namespace edm
116 #endif
unsigned int Value_t
Definition: ESIndices.h:90
constexpr ESTokenIndex() noexcept=default
static constexpr Value_t invalidValue()
Definition: ESIndices.h:105
constexpr Value_t value() const noexcept
Definition: ESIndices.h:78
Value_t index_
Definition: ESIndices.h:81
static constexpr ESResolverIndex moduleLabelDoesNotMatch() noexcept
Definition: ESIndices.h:50
constexpr bool operator!=(ESResolverIndex iOther) const noexcept
Definition: ESIndices.h:42
constexpr bool operator!=(ESRecordIndex iOther) const noexcept
Definition: ESIndices.h:101
constexpr Value_t value() const noexcept
Definition: ESIndices.h:44
constexpr bool operator!=(ESTokenIndex iOther) const noexcept
Definition: ESIndices.h:76
constexpr Value_t value() const noexcept
Definition: ESIndices.h:103
HLT enums.
static constexpr ESResolverIndex noResolverConfigured() noexcept
Definition: ESIndices.h:46
constexpr ESResolverIndex() noexcept=default
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger table.
constexpr ESRecordIndex() noexcept=default