CMS 3D CMS Logo

ModuleDescription.cc
Go to the documentation of this file.
2 
3 #include <ostream>
4 #include <sstream>
5 #include <limits>
6 #include <atomic>
7 
8 static std::atomic<unsigned int> s_id{0};
9 
10 /*----------------------------------------------------------------------
11 
12 ----------------------------------------------------------------------*/
13 
14 namespace edm {
15 
17  parameterSetID_(),
18  moduleName_(),
19  moduleLabel_(),
20  processConfigurationPtr_(nullptr),
21  id_(invalidID()){}
22 
24  ParameterSetID const& pid,
25  std::string const& modName,
26  std::string const& modLabel) : ModuleDescription{pid, modName, modLabel, nullptr, invalidID()} {}
27 
29  ParameterSetID const& pid,
30  std::string const& modName,
31  std::string const& modLabel,
32  ProcessConfiguration const* procConfig,
33  unsigned int iID) :
34  parameterSetID_(pid),
35  moduleName_(modName),
36  moduleLabel_(modLabel),
37  processConfigurationPtr_(procConfig),
38  id_(iID){}
39 
41  std::string const& modName,
42  std::string const& modLabel) : ModuleDescription{ParameterSetID(), modName, modLabel, nullptr, invalidID()} {}
43 
45  std::string const& modName,
46  std::string const& modLabel,
47  ProcessConfiguration const* procConfig) : ModuleDescription{ParameterSetID(), modName, modLabel, procConfig, invalidID()} {}
48 
50 
54  }
55 
56  std::string const&
59  }
60 
61  std::string const&
64  }
65 
66  std::string const&
68  return processConfiguration().passID();
69  }
70 
71  ParameterSetID const&
74  }
75 
76  bool
78  if (moduleLabel() < rh.moduleLabel()) return true;
79  if (rh.moduleLabel() < moduleLabel()) return false;
80  if (processName() < rh.processName()) return true;
81  if (rh.processName() < processName()) return false;
82  if (moduleName() < rh.moduleName()) return true;
83  if (rh.moduleName() < moduleName()) return false;
84  if (parameterSetID() < rh.parameterSetID()) return true;
85  if (rh.parameterSetID() < parameterSetID()) return false;
86  if (releaseVersion() < rh.releaseVersion()) return true;
87  if (rh.releaseVersion() < releaseVersion()) return false;
88  if (passID() < rh.passID()) return true;
89  return false;
90  }
91 
92  bool
94  return !((*this) < rh || rh < (*this));
95  }
96 
97  bool
99  return !((*this) == rh);
100  }
101 
102  unsigned int
104  return s_id++;
105  }
106 
107  void
108  ModuleDescription::write(std::ostream& os) const {
109  os << "Module type=" << moduleName() << ", "
110  << "Module label=" << moduleLabel() << ", "
111  << "Parameter Set ID=" << parameterSetID();
112  //<< "Parameter Set ID=" << parameterSetID() << ", "
113  //<< "Process name=" << processName() << ", "
114  //<< "Release Version=" << releaseVersion() << ", "
115  //<< "Pass ID=" << passID() << ", "
116  //<< "Main Parameter Set ID=" << mainParameterSetID();
117  }
118 }
ParameterSetID const & mainParameterSetID() const
std::string const & processName() const
#define nullptr
std::string const & moduleName() const
std::string const & passID() const
static std::atomic< unsigned int > s_id
std::string const & moduleLabel() const
PassID const & passID() const
static unsigned int getUniqueID()
Returns a unique id each time called. Intended to be passed to ModuleDescription&#39;s constructor&#39;s modI...
ProcessConfiguration const * processConfigurationPtr_
std::string const & processName() const
ParameterSetID const & parameterSetID() const
std::string const & releaseVersion() const
bool operator!=(ModuleDescription const &rh) const
bool operator==(ModuleDescription const &rh) const
static constexpr unsigned int invalidID()
Returns a value identifying an invalid id (the max unsigned int value)
Hash< ParameterSetType > ParameterSetID
ParameterSetID parameterSetID_
ReleaseVersion const & releaseVersion() const
HLT enums.
ParameterSetID const & parameterSetID() const
void write(std::ostream &os) const
ProcessConfiguration const & processConfiguration() const
bool operator<(ModuleDescription const &rh) const