CMS 3D CMS Logo

BranchKey.h

Go to the documentation of this file.
00001 #ifndef DataFormats_Provenance_BranchKey_h
00002 #define DataFormats_Provenance_BranchKey_h
00003 
00004 /*----------------------------------------------------------------------
00005   
00006 BranchKey: The key used to identify a Group in the EventPrincipal. The
00007 name of the branch to which the related data product will be written
00008 is determined entirely from the BranchKey.
00009 
00010 $Id: BranchKey.h,v 1.3 2007/11/22 16:44:33 wmtan Exp $
00011 
00012 ----------------------------------------------------------------------*/
00013 #include <iosfwd>
00014 #include <string>
00015 
00016 namespace edm {
00017   class BranchDescription;
00018   class ConstBranchDescription;
00019 
00020   struct BranchKey {
00021     BranchKey() : friendlyClassName_(), moduleLabel_(), productInstanceName_(), processName_()
00022     {}
00023 
00024     BranchKey(std::string const& cn, std::string const& ml,
00025         std::string const& pin, std::string const& pn) :
00026       friendlyClassName_(cn), 
00027       moduleLabel_(ml), 
00028       productInstanceName_(pin), 
00029       processName_(pn) 
00030     {}
00031 
00032     explicit BranchKey(BranchDescription const& desc);
00033     explicit BranchKey(ConstBranchDescription const& desc);
00034 
00035     std::string friendlyClassName_;
00036     std::string moduleLabel_;
00037     std::string productInstanceName_;
00038     std::string processName_; // ???
00039   };
00040 
00041   inline
00042   bool 
00043   operator<(BranchKey const& a, BranchKey const& b) {
00044       return 
00045         a.friendlyClassName_ < b.friendlyClassName_ ? true :
00046         a.friendlyClassName_ > b.friendlyClassName_ ? false :
00047         a.moduleLabel_ < b.moduleLabel_ ? true :
00048         a.moduleLabel_ > b.moduleLabel_ ? false :
00049         a.productInstanceName_ < b.productInstanceName_ ? true :
00050         a.productInstanceName_ > b.productInstanceName_ ? false :
00051         a.processName_ < b.processName_ ? true :
00052         false;
00053   }
00054 
00055   inline
00056   bool 
00057   operator==(BranchKey const& a, BranchKey const& b) {
00058     return !(a < b || b < a);
00059   }
00060 
00061   inline
00062   bool 
00063   operator!=(BranchKey const& a, BranchKey const& b) {
00064     return !(a == b);
00065   }
00066 
00067   std::ostream&
00068   operator<<(std::ostream& os, BranchKey const& bk);
00069 }
00070 #endif

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