CMS 3D CMS Logo

BranchID.h
Go to the documentation of this file.
1 #ifndef DataFormats_Provenance_BranchID_h
2 #define DataFormats_Provenance_BranchID_h
3 
4 /*----------------------------------------------------------------------
5 
6 BranchID: A unique identifier for each branch.
7 
8 ----------------------------------------------------------------------*/
9 
10 #include <iosfwd>
11 #include <string>
12 
13 namespace edm {
14  class BranchID {
15  public:
16  typedef unsigned int value_type;
17  BranchID() : id_(0) {}
19  explicit BranchID(value_type theID) : id_(theID) {}
21  unsigned int id() const { return id_; }
22  bool isValid() const { return id_ != 0; }
23 
24  bool operator<(BranchID const& rh) const { return id_ < rh.id_; }
25  bool operator>(BranchID const& rh) const { return id_ > rh.id_; }
26  bool operator==(BranchID const& rh) const { return id_ == rh.id_; }
27  bool operator!=(BranchID const& rh) const { return id_ != rh.id_; }
28 
29  private:
30  static value_type toID(std::string const& branchName);
32  };
33 
34  std::ostream& operator<<(std::ostream& os, BranchID const& id);
35 } // namespace edm
36 #endif
value_type id_
Definition: BranchID.h:31
bool operator!=(BranchID const &rh) const
Definition: BranchID.h:27
bool isValid() const
Definition: BranchID.h:22
unsigned int value_type
Definition: BranchID.h:16
bool operator<(BranchID const &rh) const
Definition: BranchID.h:24
unsigned int id() const
Definition: BranchID.h:21
bool operator>(BranchID const &rh) const
Definition: BranchID.h:25
static value_type toID(std::string const &branchName)
Definition: BranchID.cc:7
bool operator==(BranchID const &rh) const
Definition: BranchID.h:26
HLT enums.
BranchID(std::string const &branchName)
Definition: BranchID.h:18
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.
BranchID(value_type theID)
Definition: BranchID.h:19
void setID(std::string const &branchName)
Definition: BranchID.h:20