CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/DataFormats/Provenance/interface/ConstBranchDescription.h

Go to the documentation of this file.
00001 #ifndef DataFormats_Provenance_ConstBranchDescription_h
00002 #define DataFormats_Provenance_ConstBranchDescription_h
00003 
00004 /*----------------------------------------------------------------------
00005 
00006 ConstBranchDescription: A class containing a constant shareable branch description
00007 that is inexpensive to copy.
00008 This class is not persistable.
00009 
00010 ----------------------------------------------------------------------*/
00011 #include <iosfwd>
00012 #include <string>
00013 #include <map>
00014 #include <set>
00015 
00016 #include "boost/shared_ptr.hpp"
00017 
00018 #include "DataFormats/Provenance/interface/BranchDescription.h"
00019 
00020 /*
00021   ConstBranchDescription
00022 */
00023 
00024 namespace edm {
00025   class ConstBranchDescription {
00026   public:
00027     explicit ConstBranchDescription(BranchDescription const& bd) :
00028       ptr_(new BranchDescription(bd)) {}
00029 
00030     void init() const {ptr_->init();}
00031 
00032     void write(std::ostream& os) const {ptr_->write(os);}
00033 
00034     std::string const& moduleLabel() const {return ptr_->moduleLabel();}
00035     std::string const& moduleName() const {return ptr_->moduleName();}
00036     std::string const& processName() const {return ptr_->processName();}
00037     BranchID const& branchID() const {return ptr_->branchID();}
00038     std::string const& fullClassName() const {return ptr_->fullClassName();}
00039     std::string const& className() const {return ptr_->fullClassName();}
00040     std::string const& friendlyClassName() const {return ptr_->friendlyClassName();}
00041     std::string const& productInstanceName() const {return ptr_->productInstanceName();}
00042     bool const& produced() const {return ptr_->produced();}
00043     bool const& dropped() const {return ptr_->dropped();}
00044     bool const& onDemand() const {return ptr_->onDemand();}
00045     bool present() const {return ptr_->present();}
00046     bool const& transient() const {return ptr_->transient();}
00047     Reflex::Type const& type() const {return ptr_->type();}
00048     TypeID const& typeID() const {return ptr_->typeID();}
00049     int const& splitLevel() const {return ptr_->splitLevel();}
00050     int const& basketSize() const {return ptr_->basketSize();}
00051 
00052     ParameterSetID const& parameterSetID() const {return ptr_->parameterSetID();}
00053     std::map<ProcessConfigurationID, ParameterSetID> const& parameterSetIDs() const {return ptr_->parameterSetIDs();}
00054     ParameterSetID const& psetID() const {return ptr_->psetID();}
00055     bool isPsetIDUnique() const {return ptr_->parameterSetIDs().size() == 1;}
00056     std::set<std::string> const& branchAliases() const {return ptr_->branchAliases();}
00057     std::string const& branchName() const {return ptr_->branchName();}
00058     BranchType const& branchType() const {return ptr_->branchType();}
00059     std::string const& wrappedName() const {return ptr_->wrappedName();}
00060     WrapperInterfaceBase const* getInterface() const {return ptr_->getInterface();}
00061 
00062     BranchDescription const& me() const {return *ptr_;}
00063 
00064   private:
00065     boost::shared_ptr<BranchDescription> ptr_;
00066   };
00067 
00068   inline
00069   std::ostream&
00070   operator<<(std::ostream& os, ConstBranchDescription const& p) {
00071     os << p.me();
00072     return os;
00073   }
00074 
00075   inline
00076   bool operator<(ConstBranchDescription const& a, ConstBranchDescription const& b) {
00077     return a.me() < b.me();
00078   }
00079 
00080   inline
00081   bool operator==(ConstBranchDescription const& a, ConstBranchDescription const& b) {
00082     return a.me() == b.me();
00083   }
00084 
00085   inline
00086   std::string match(ConstBranchDescription const& a,
00087                     ConstBranchDescription const& b,
00088                     std::string const& fileName,
00089                     BranchDescription::MatchMode m) {
00090     return match(a.me(), b.me(), fileName, m);
00091   }
00092 }
00093 #endif