CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_8_patch3/src/DataFormats/Provenance/src/ModuleDescription.cc

Go to the documentation of this file.
00001 #include "DataFormats/Provenance/interface/ModuleDescription.h"
00002 
00003 #include <ostream>
00004 #include <sstream>
00005 
00006 /*----------------------------------------------------------------------
00007 
00008 ----------------------------------------------------------------------*/
00009 
00010 namespace edm {
00011 
00012   ModuleDescription::ModuleDescription() :
00013     parameterSetID_(),
00014     moduleName_(),
00015     moduleLabel_(),
00016     processConfigurationPtr_(0) {}
00017 
00018   ModuleDescription::ModuleDescription(
00019                 ParameterSetID const& pid,
00020                 std::string const& modName,
00021                 std::string const& modLabel) :
00022                         parameterSetID_(pid),
00023                         moduleName_(modName),
00024                         moduleLabel_(modLabel),
00025                         processConfigurationPtr_(0) {}
00026 
00027   ModuleDescription::ModuleDescription(
00028                 ParameterSetID const& pid,
00029                 std::string const& modName,
00030                 std::string const& modLabel,
00031                 ProcessConfiguration const* procConfig) :
00032                         parameterSetID_(pid),
00033                         moduleName_(modName),
00034                         moduleLabel_(modLabel),
00035                         processConfigurationPtr_(procConfig) {}
00036 
00037   ModuleDescription::ModuleDescription(
00038                 std::string const& modName,
00039                 std::string const& modLabel) :
00040                         parameterSetID_(),
00041                         moduleName_(modName),
00042                         moduleLabel_(modLabel),
00043                         processConfigurationPtr_(0) {}
00044 
00045   ModuleDescription::ModuleDescription(
00046                 std::string const& modName,
00047                 std::string const& modLabel,
00048                 ProcessConfiguration const* procConfig) :
00049                         parameterSetID_(),
00050                         moduleName_(modName),
00051                         moduleLabel_(modLabel),
00052                         processConfigurationPtr_(procConfig) {}
00053 
00054   ModuleDescription::~ModuleDescription() {}
00055 
00056   ProcessConfiguration const&
00057   ModuleDescription::processConfiguration() const {
00058     return *processConfigurationPtr_;
00059   }
00060 
00061   ProcessConfigurationID
00062   ModuleDescription::processConfigurationID() const {
00063     return processConfiguration().id();
00064   }
00065 
00066   std::string const&
00067   ModuleDescription::processName() const {
00068     return processConfiguration().processName();
00069   }
00070 
00071   std::string const&
00072   ModuleDescription::releaseVersion() const {
00073     return processConfiguration().releaseVersion();
00074   }
00075 
00076   std::string const&
00077   ModuleDescription::passID() const {
00078     return processConfiguration().passID();
00079   }
00080 
00081   ParameterSetID const&
00082   ModuleDescription::mainParameterSetID() const {
00083     return processConfiguration().parameterSetID();
00084   }
00085 
00086   bool
00087   ModuleDescription::operator<(ModuleDescription const& rh) const {
00088     if (moduleLabel() < rh.moduleLabel()) return true;
00089     if (rh.moduleLabel() < moduleLabel()) return false;
00090     if (processName() < rh.processName()) return true;
00091     if (rh.processName() < processName()) return false;
00092     if (moduleName() < rh.moduleName()) return true;
00093     if (rh.moduleName() < moduleName()) return false;
00094     if (parameterSetID() < rh.parameterSetID()) return true;
00095     if (rh.parameterSetID() < parameterSetID()) return false;
00096     if (releaseVersion() < rh.releaseVersion()) return true;
00097     if (rh.releaseVersion() < releaseVersion()) return false;
00098     if (passID() < rh.passID()) return true;
00099     return false;
00100   }
00101 
00102   bool
00103   ModuleDescription::operator==(ModuleDescription const& rh) const {
00104     return !((*this) < rh || rh < (*this));
00105   }
00106 
00107   bool
00108   ModuleDescription::operator!=(ModuleDescription const& rh) const {
00109     return !((*this) == rh);
00110   }
00111 
00112   void
00113   ModuleDescription::write(std::ostream& os) const {
00114     os  << "Module type=" << moduleName() << ", "
00115         << "Module label=" << moduleLabel() << ", "
00116         << "Parameter Set ID=" << parameterSetID();
00117         //<< "Parameter Set ID=" << parameterSetID() << ", "
00118         //<< "Process name=" << processName() << ", "
00119         //<< "Release Version=" << releaseVersion() << ", "
00120         //<< "Pass ID=" << passID() << ", "
00121         //<< "Main Parameter Set ID=" << mainParameterSetID();
00122   }
00123 }