CMS 3D CMS Logo

BranchID.h

Go to the documentation of this file.
00001 #ifndef DataFormats_Provenance_BranchID_h
00002 #define DataFormats_Provenance_BranchID_h
00003 
00004 /*----------------------------------------------------------------------
00005   
00006 BranchID: A unique identifier for each branch.
00007 
00008 ----------------------------------------------------------------------*/
00009 
00010 #include <iosfwd>
00011 #include <string>
00012 
00013 namespace edm {
00014   class BranchID {
00015   public:
00016     BranchID() : id_(0) { }
00017     explicit BranchID(std::string const& str) {
00018       setID(str);
00019     }
00020     void setID(std::string const& branchName);
00021 
00022     unsigned int id() const { return id_; }
00023     bool isValid() const {return id_ != 0;}
00024 
00025     bool operator<(BranchID const& rh) const {return id_ < rh.id_;}
00026     bool operator>(BranchID const& rh) const {return id_ > rh.id_;}
00027     bool operator==(BranchID const& rh) const {return id_ == rh.id_;}
00028     bool operator!=(BranchID const& rh) const {return id_ != rh.id_;}
00029 
00030   private:
00031     unsigned int id_;
00032   };
00033 
00034   std::ostream&
00035   operator<<(std::ostream& os, BranchID const& id);
00036 }
00037 #endif

Generated on Tue Jun 9 17:31:30 2009 for CMSSW by  doxygen 1.5.4