CMS 3D CMS Logo

ElementID.h
Go to the documentation of this file.
1 #ifndef DataFormats_Provenance_ElementID_h
2 #define DataFormats_Provenance_ElementID_h
3 
5 
6 #include <iosfwd>
7 
8 namespace edm {
17  class ElementID {
18  public:
19  using key_type = unsigned int;
20 
21  ElementID() = default;
22  explicit ElementID(edm::ProductID id, key_type ind) : index_(ind), id_(id) {}
23 
24  bool isValid() const { return id_.isValid(); }
25  ProductID id() const { return id_; }
26  key_type index() const { return index_; }
27  key_type key() const { return index_; }
28  void reset() {
29  index_ = 0;
30  id_.reset();
31  }
32 
33  void swap(ElementID& other);
34 
35  private:
38  };
39 
40  inline void swap(ElementID& a, ElementID& b) { a.swap(b); }
41 
42  inline bool operator==(ElementID const& lh, ElementID const& rh) {
43  return lh.index() == rh.index() && lh.id() == rh.id();
44  }
45 
46  inline bool operator!=(ElementID const& lh, ElementID const& rh) { return !(lh == rh); }
47 
48  bool operator<(ElementID const& lh, ElementID const& rh);
49 
50  std::ostream& operator<<(std::ostream& os, ElementID const& id);
51 } // namespace edm
52 
53 #endif
bool operator<(DetSet< T > const &x, DetSet< T > const &y)
Definition: DetSet.h:90
ElementID()=default
bool int lh
Definition: SIMDVec.h:20
bool isValid() const
Definition: ElementID.h:24
void reset()
Definition: ElementID.h:28
void swap(ElementID &other)
Definition: ElementID.cc:6
bool operator==(debugging_allocator< X > const &, debugging_allocator< Y > const &) noexcept
key_type key() const
Definition: ElementID.h:27
ElementID(edm::ProductID id, key_type ind)
Definition: ElementID.h:22
bool operator!=(debugging_allocator< X > const &, debugging_allocator< Y > const &) noexcept
ProductID id() const
Definition: ElementID.h:25
void reset()
Definition: ProductID.h:36
unsigned int key_type
Definition: ElementID.h:19
double b
Definition: hdecay.h:118
key_type index() const
Definition: ElementID.h:26
HLT enums.
key_type index_
Definition: ElementID.h:36
double a
Definition: hdecay.h:119
ProductID id_
Definition: ElementID.h:37
bool isValid() const
Definition: ProductID.h:32
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.