CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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_(), moduleName_(), moduleLabel_(), processConfigurationPtr_(nullptr), id_(invalidID()) {}
18 
20  std::string const& modName,
21  std::string const& modLabel)
22  : ModuleDescription{pid, modName, modLabel, nullptr, invalidID()} {}
23 
25  std::string const& modName,
26  std::string const& modLabel,
27  ProcessConfiguration const* procConfig,
28  unsigned int iID)
29  : parameterSetID_(pid),
30  moduleName_(modName),
31  moduleLabel_(modLabel),
32  processConfigurationPtr_(procConfig),
33  id_(iID) {}
34 
36  : ModuleDescription{ParameterSetID(), modName, modLabel, nullptr, invalidID()} {}
37 
39  std::string const& modLabel,
40  ProcessConfiguration const* procConfig)
41  : ModuleDescription{ParameterSetID(), modName, modLabel, procConfig, invalidID()} {}
42 
44 
46 
48 
50 
52 
55  }
56 
58  if (moduleLabel() < rh.moduleLabel())
59  return true;
60  if (rh.moduleLabel() < moduleLabel())
61  return false;
62  if (processName() < rh.processName())
63  return true;
64  if (rh.processName() < processName())
65  return false;
66  if (moduleName() < rh.moduleName())
67  return true;
68  if (rh.moduleName() < moduleName())
69  return false;
70  if (parameterSetID() < rh.parameterSetID())
71  return true;
72  if (rh.parameterSetID() < parameterSetID())
73  return false;
74  if (releaseVersion() < rh.releaseVersion())
75  return true;
76  if (rh.releaseVersion() < releaseVersion())
77  return false;
78  if (passID() < rh.passID())
79  return true;
80  return false;
81  }
82 
83  bool ModuleDescription::operator==(ModuleDescription const& rh) const { return !((*this) < rh || rh < (*this)); }
84 
85  bool ModuleDescription::operator!=(ModuleDescription const& rh) const { return !((*this) == rh); }
86 
87  unsigned int ModuleDescription::getUniqueID() { return s_id++; }
88 
89  void ModuleDescription::write(std::ostream& os) const {
90  os << "Module type=" << moduleName() << ", "
91  << "Module label=" << moduleLabel() << ", "
92  << "Parameter Set ID=" << parameterSetID();
93  //<< "Parameter Set ID=" << parameterSetID() << ", "
94  //<< "Process name=" << processName() << ", "
95  //<< "Release Version=" << releaseVersion() << ", "
96  //<< "Pass ID=" << passID() << ", "
97  //<< "Main Parameter Set ID=" << mainParameterSetID();
98  }
99 } // namespace edm
ParameterSetID const & mainParameterSetID() const
std::string const & processName() const
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
ReleaseVersion const & releaseVersion() const
ParameterSetID const & parameterSetID() const
moduleLabel_(iConfig.getParameter< string >("@module_label"))
void write(std::ostream &os) const
ProcessConfiguration const & processConfiguration() const
bool operator<(ModuleDescription const &rh) const