test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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) { }
18  explicit BranchID(std::string const& branchName) : id_(toID(branchName)) {
19  }
20  explicit BranchID(value_type theID) : id_(theID) {
21  }
22  void setID(std::string const& branchName) {id_ = toID(branchName);}
23  unsigned int id() const { return id_; }
24  bool isValid() const {return id_ != 0;}
25 
26  bool operator<(BranchID const& rh) const {return id_ < rh.id_;}
27  bool operator>(BranchID const& rh) const {return id_ > rh.id_;}
28  bool operator==(BranchID const& rh) const {return id_ == rh.id_;}
29  bool operator!=(BranchID const& rh) const {return id_ != rh.id_;}
30 
31  private:
32  static value_type toID(std::string const& branchName);
34  };
35 
36 
37  std::ostream&
38  operator<<(std::ostream& os, BranchID const& id);
39 }
40 #endif
bool operator==(BranchID const &rh) const
Definition: BranchID.h:28
value_type id_
Definition: BranchID.h:33
bool isValid() const
Definition: BranchID.h:24
unsigned int id() const
Definition: BranchID.h:23
bool operator<(BranchID const &rh) const
Definition: BranchID.h:26
unsigned int value_type
Definition: BranchID.h:16
bool operator>(BranchID const &rh) const
Definition: BranchID.h:27
static value_type toID(std::string const &branchName)
Definition: BranchID.cc:8
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:20
void setID(std::string const &branchName)
Definition: BranchID.h:22
bool operator!=(BranchID const &rh) const
Definition: BranchID.h:29