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_(), 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
edm::ParameterSetID
Hash< ParameterSetType > ParameterSetID
Definition: ParameterSetID.h:21
edm::ModuleDescription::moduleLabel
std::string const & moduleLabel() const
Definition: ModuleDescription.h:43
edm::ProcessConfiguration::releaseVersion
ReleaseVersion const & releaseVersion() const
Definition: ProcessConfiguration.h:27
edm::ModuleDescription::~ModuleDescription
~ModuleDescription()
Definition: ModuleDescription.cc:43
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::ModuleDescription::invalidID
static constexpr unsigned int invalidID()
Returns a value identifying an invalid id (the max unsigned int value)
Definition: ModuleDescription.h:66
s_id
static std::atomic< unsigned int > s_id
Definition: ModuleDescription.cc:8
edm::ModuleDescription::moduleName
std::string const & moduleName() const
Definition: ModuleDescription.h:42
edm::ModuleDescription::processConfigurationPtr_
ProcessConfiguration const * processConfigurationPtr_
Definition: ModuleDescription.h:80
edm::ModuleDescription::getUniqueID
static unsigned int getUniqueID()
Returns a unique id each time called. Intended to be passed to ModuleDescription's constructor's modI...
Definition: ModuleDescription.cc:87
edm::ModuleDescription::processName
std::string const & processName() const
Definition: ModuleDescription.cc:47
edm::ModuleDescription
Definition: ModuleDescription.h:21
edm::ProcessConfiguration::passID
PassID const & passID() const
Definition: ProcessConfiguration.h:28
ModuleDescription.h
edm::ModuleDescription::processConfiguration
ProcessConfiguration const & processConfiguration() const
Definition: ModuleDescription.cc:45
edm::ModuleDescription::operator==
bool operator==(ModuleDescription const &rh) const
Definition: ModuleDescription.cc:83
edm::Hash< ParameterSetType >
edm::ProcessConfiguration::processName
std::string const & processName() const
Definition: ProcessConfiguration.h:24
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ProcessConfiguration::parameterSetID
ParameterSetID const & parameterSetID() const
Definition: ProcessConfiguration.cc:31
edm::ModuleDescription::releaseVersion
std::string const & releaseVersion() const
Definition: ModuleDescription.cc:49
edm::ModuleDescription::operator!=
bool operator!=(ModuleDescription const &rh) const
Definition: ModuleDescription.cc:85
edm::ModuleDescription::mainParameterSetID
ParameterSetID const & mainParameterSetID() const
Definition: ModuleDescription.cc:53
edm::ModuleDescription::ModuleDescription
ModuleDescription()
Definition: ModuleDescription.cc:16
edm::ModuleDescription::operator<
bool operator<(ModuleDescription const &rh) const
Definition: ModuleDescription.cc:57
edm::ModuleDescription::parameterSetID
ParameterSetID const & parameterSetID() const
Definition: ModuleDescription.h:41
edm::ModuleDescription::passID
std::string const & passID() const
Definition: ModuleDescription.cc:51
edm::ModuleDescription::write
void write(std::ostream &os) const
Definition: ModuleDescription.cc:89
edm::ProcessConfiguration
Definition: ProcessConfiguration.h:14