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 <ostream>
25 
26 // user include files
27 
28 namespace edm {
29  class ESProxyIndex {
30  public:
31  using Value_t = int;
33  constexpr explicit ESProxyIndex(Value_t iValue) noexcept : index_{iValue} {}
34  constexpr ESProxyIndex(ESProxyIndex const&) noexcept = default;
35  constexpr ESProxyIndex(ESProxyIndex&&) noexcept = default;
36 
37  constexpr ESProxyIndex& operator=(ESProxyIndex const&) noexcept = default;
38  constexpr ESProxyIndex& operator=(ESProxyIndex&&) noexcept = default;
39 
40  constexpr bool operator==(ESProxyIndex iOther) const noexcept { return iOther.index_ == index_; }
41  constexpr bool operator!=(ESProxyIndex iOther) const noexcept { return iOther.index_ != index_; }
42 
43  constexpr Value_t value() const noexcept { return index_; }
44 
45  private:
47  };
48 
49  inline std::ostream& operator<<(std::ostream& iOS, ESProxyIndex const& iIndex) {
50  iOS << iIndex.value();
51  return iOS;
52  }
53 
54  class ESTokenIndex {
55  public:
56  using Value_t = int;
57 
59  constexpr explicit ESTokenIndex(Value_t iValue) noexcept : index_{iValue} {}
60  constexpr ESTokenIndex(ESTokenIndex const&) noexcept = default;
61  constexpr ESTokenIndex(ESTokenIndex&&) noexcept = default;
62 
63  constexpr ESTokenIndex& operator=(ESTokenIndex const&) noexcept = default;
64  constexpr ESTokenIndex& operator=(ESTokenIndex&&) noexcept = default;
65 
66  constexpr bool operator==(ESTokenIndex iOther) const noexcept { return iOther.index_ == index_; }
67  constexpr bool operator!=(ESTokenIndex iOther) const noexcept { return iOther.index_ != index_; }
68 
69  constexpr Value_t value() const noexcept { return index_; }
70 
71  private:
73  };
74  inline std::ostream& operator<<(std::ostream& iOS, ESTokenIndex const& iIndex) {
75  iOS << iIndex.value();
76  return iOS;
77  }
78 
79  class ESRecordIndex {
80  public:
81  using Value_t = unsigned int;
82 
84  constexpr explicit ESRecordIndex(unsigned int iValue) noexcept : index_{iValue} {}
86  constexpr ESRecordIndex(ESRecordIndex&&) noexcept = default;
87 
88  constexpr ESRecordIndex& operator=(ESRecordIndex const&) noexcept = default;
89  constexpr ESRecordIndex& operator=(ESRecordIndex&&) noexcept = default;
90 
91  constexpr bool operator==(ESRecordIndex iOther) const noexcept { return iOther.index_ == index_; }
92  constexpr bool operator!=(ESRecordIndex iOther) const noexcept { return iOther.index_ != index_; }
93 
94  constexpr Value_t value() const noexcept { return index_; }
95 
96  private:
98  };
99  inline std::ostream& operator<<(std::ostream& iOS, ESRecordIndex const& iIndex) {
100  iOS << iIndex.value();
101  return iOS;
102  }
103 
104 } // namespace edm
105 #endif
constexpr Value_t value() const noexcept
Definition: ESIndices.h:69
unsigned int Value_t
Definition: ESIndices.h:81
constexpr bool operator==(ESProxyIndex iOther) const noexcept
Definition: ESIndices.h:40
constexpr ESProxyIndex() noexcept=default
constexpr bool operator!=(ESProxyIndex iOther) const noexcept
Definition: ESIndices.h:41
constexpr bool operator==(ESRecordIndex iOther) const noexcept
Definition: ESIndices.h:91
constexpr bool operator!=(ESTokenIndex iOther) const noexcept
Definition: ESIndices.h:67
constexpr ESProxyIndex & operator=(ESProxyIndex const &) noexcept=default
#define noexcept
constexpr bool operator==(ESTokenIndex iOther) const noexcept
Definition: ESIndices.h:66
constexpr bool operator!=(ESRecordIndex iOther) const noexcept
Definition: ESIndices.h:92
constexpr Value_t value() const noexcept
Definition: ESIndices.h:43
HLT enums.
constexpr Value_t value() const noexcept
Definition: ESIndices.h:94
Value_t index_
Definition: ESIndices.h:46
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.
#define constexpr