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() { index_ = 0; id_.reset(); }
29 
30  void swap(ElementID& other);
31 
32  private:
35  };
36 
37  inline
38  void swap(ElementID& a, ElementID& b) {
39  a.swap(b);
40  }
41 
42  inline
43  bool operator==(ElementID const& lh, ElementID const& rh) {
44  return lh.index() == rh.index() && lh.id() == rh.id();
45  }
46 
47  inline
48  bool operator!=(ElementID const& lh, ElementID const& rh) {
49  return !(lh == rh);
50  }
51 
52  bool operator<(ElementID const& lh, ElementID const& rh);
53 
54  std::ostream& operator<<(std::ostream& os, ElementID const& id);
55 }
56 
57 #endif
bool operator<(DetSet< T > const &x, DetSet< T > const &y)
Definition: DetSet.h:92
ElementID()=default
bool int lh
Definition: SIMDVec.h:21
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:39
unsigned int key_type
Definition: ElementID.h:19
double b
Definition: hdecay.h:120
key_type index() const
Definition: ElementID.h:26
HLT enums.
key_type index_
Definition: ElementID.h:33
double a
Definition: hdecay.h:121
ProductID id_
Definition: ElementID.h:34
bool isValid() const
Definition: ProductID.h:35
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.