File indexing completed on 2024-04-06 12:05:02
0001 #ifndef DataFormats_Provenance_ModuleDescription_h
0002 #define DataFormats_Provenance_ModuleDescription_h
0003
0004
0005
0006
0007
0008
0009 #include "DataFormats/Provenance/interface/ParameterSetID.h"
0010 #include "DataFormats/Provenance/interface/ProcessConfiguration.h"
0011
0012 #include <iosfwd>
0013 #include <limits>
0014 #include <string>
0015
0016 namespace edm {
0017
0018
0019
0020
0021 class ModuleDescription {
0022 public:
0023 ModuleDescription();
0024
0025 ModuleDescription(std::string const& modName, std::string const& modLabel);
0026
0027 ModuleDescription(std::string const& modName, std::string const& modLabel, ProcessConfiguration const* procConfig);
0028
0029 ModuleDescription(ParameterSetID const& pid, std::string const& modName, std::string const& modLabel);
0030
0031 ModuleDescription(ParameterSetID const& pid,
0032 std::string const& modName,
0033 std::string const& modLabel,
0034 ProcessConfiguration const* procConfig,
0035 unsigned int modID);
0036
0037 ~ModuleDescription();
0038
0039 void write(std::ostream& os) const;
0040
0041 ParameterSetID const& parameterSetID() const { return parameterSetID_; }
0042 std::string const& moduleName() const { return moduleName_; }
0043 std::string const& moduleLabel() const { return moduleLabel_; }
0044
0045
0046 unsigned int id() const { return id_; }
0047 ProcessConfiguration const& processConfiguration() const;
0048
0049 std::string const& processName() const;
0050 std::string const& releaseVersion() const;
0051 std::string const& passID() const;
0052 ParameterSetID const& mainParameterSetID() const;
0053
0054
0055
0056 bool operator<(ModuleDescription const& rh) const;
0057
0058 bool operator==(ModuleDescription const& rh) const;
0059
0060 bool operator!=(ModuleDescription const& rh) const;
0061
0062
0063 static unsigned int getUniqueID();
0064
0065
0066 static constexpr unsigned int invalidID() { return std::numeric_limits<unsigned int>::max(); }
0067
0068 private:
0069
0070 ParameterSetID parameterSetID_;
0071
0072
0073 std::string moduleName_;
0074
0075
0076
0077 std::string moduleLabel_;
0078
0079
0080 ProcessConfiguration const* processConfigurationPtr_;
0081
0082 unsigned int id_;
0083 };
0084
0085 inline std::ostream& operator<<(std::ostream& os, ModuleDescription const& p) {
0086 p.write(os);
0087 return os;
0088 }
0089
0090 }
0091 #endif