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
edm::BranchID::operator==
bool operator==(BranchID const &rh) const
Definition: BranchID.h:26
edm::BranchID::BranchID
BranchID()
Definition: BranchID.h:17
electrons_cff.branchName
branchName
Definition: electrons_cff.py:521
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::BranchID::BranchID
BranchID(std::string const &branchName)
Definition: BranchID.h:18
edm::BranchID::operator<
bool operator<(BranchID const &rh) const
Definition: BranchID.h:24
edm::BranchID::id
unsigned int id() const
Definition: BranchID.h:21
edm::operator<<
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.
Definition: HLTGlobalStatus.h:106
edm::BranchID::operator!=
bool operator!=(BranchID const &rh) const
Definition: BranchID.h:27
edm::BranchID
Definition: BranchID.h:14
edm::BranchID::setID
void setID(std::string const &branchName)
Definition: BranchID.h:20
edm::BranchID::id_
value_type id_
Definition: BranchID.h:31
edm::BranchID::value_type
unsigned int value_type
Definition: BranchID.h:16
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::BranchID::toID
static value_type toID(std::string const &branchName)
Definition: BranchID.cc:7
edm::BranchID::operator>
bool operator>(BranchID const &rh) const
Definition: BranchID.h:25
edm::BranchID::isValid
bool isValid() const
Definition: BranchID.h:22
edm::BranchID::BranchID
BranchID(value_type theID)
Definition: BranchID.h:19