CMS 3D CMS Logo

InputSourceFactory.cc
Go to the documentation of this file.
1 
6 
7 #include <iostream>
8 
9 EDM_REGISTER_PLUGINFACTORY(edm::InputSourcePluginFactory, "CMS EDM Framework InputSource");
10 namespace edm {
11 
13 
15 
17 
19  // will not work with plugin factories
20  //static InputSourceFactory f;
21  //return &f;
22 
23  return &singleInstance_;
24  }
25 
26  std::unique_ptr<InputSource> InputSourceFactory::makeInputSource(ParameterSet const& conf,
27  InputSourceDescription const& desc) const
28 
29  {
30  std::string modtype = conf.getParameter<std::string>("@module_type");
31  FDEBUG(1) << "InputSourceFactory: module_type = " << modtype << std::endl;
32  auto wm = InputSourcePluginFactory::get()->create(modtype, conf, desc);
33 
34  if (wm.get() == nullptr) {
35  throw edm::Exception(errors::Configuration, "NoSourceModule")
36  << "InputSource Factory:\n"
37  << "Cannot find source type from ParameterSet: " << modtype << "\n"
38  << "Perhaps your source type is misspelled or is not an EDM Plugin?\n"
39  << "Try running EdmPluginDump to obtain a list of available Plugins.";
40  }
41 
42  wm->registerProducts();
43 
44  FDEBUG(1) << "InputSourceFactory: created input source " << modtype << std::endl;
45 
46  return wm;
47  }
48 
49 } // namespace edm
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::InputSourceFactory::singleInstance_
static const InputSourceFactory singleInstance_
Definition: InputSourceFactory.h:26
edm::InputSourceFactory::get
static InputSourceFactory const * get()
Definition: InputSourceFactory.cc:18
edm::InputSourceDescription
Definition: InputSourceDescription.h:20
edm::InputSourceFactory::InputSourceFactory
InputSourceFactory()
Definition: InputSourceFactory.cc:14
EDMException.h
edm::InputSourceFactory::makeInputSource
std::unique_ptr< InputSource > makeInputSource(ParameterSet const &, InputSourceDescription const &) const
Definition: InputSourceFactory.cc:26
EDM_REGISTER_PLUGINFACTORY
#define EDM_REGISTER_PLUGINFACTORY(_factory_, _category_)
Definition: PluginFactory.h:89
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
FDEBUG
#define FDEBUG(lev)
Definition: DebugMacros.h:19
edmplugin::PluginFactory
Definition: PluginFactory.h:34
edm::InputSourceFactory
Definition: InputSourceFactory.h:16
get
#define get
edm::InputSourceFactory::~InputSourceFactory
~InputSourceFactory()
Definition: InputSourceFactory.cc:12
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
InputSourceFactory.h
Exception
Definition: hltDiff.cc:246
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
DebugMacros.h
ParameterSet.h
edm::errors::Configuration
Definition: EDMException.h:36