CMS 3D CMS Logo

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