test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
VectorInputSourceFactory.cc
Go to the documentation of this file.
1 
7 
8 #include <iostream>
9 
10 EDM_REGISTER_PLUGINFACTORY(edm::VectorInputSourcePluginFactory,"CMS EDM Framework VectorInputSource");
11 
12 namespace edm {
13 
15  }
16 
18  }
19 
21 
23  // will not work with plugin factories
24  //static InputSourceFactory f;
25  //return &f;
26 
27  return &singleInstance_;
28  }
29 
30  std::unique_ptr<VectorInputSource>
32  VectorInputSourceDescription const& desc) const {
33  std::string modtype = conf.getParameter<std::string>("@module_type");
34  FDEBUG(1) << "VectorInputSourceFactory: module_type = " << modtype << std::endl;
35  std::unique_ptr<VectorInputSource> wm(VectorInputSourcePluginFactory::get()->create(modtype,conf,desc));
36 
37  if(wm.get() == nullptr) {
38  throw edm::Exception(errors::Configuration,"NoSourceModule")
39  << "VectorInputSource Factory:\n"
40  << "Cannot find source type from ParameterSet: "
41  << modtype << "\n"
42  << "Perhaps your source type is misspelled or is not an EDM Plugin?\n"
43  << "Try running EdmPluginDump to obtain a list of available Plugins.";
44  }
45 
46  FDEBUG(1) << "VectorInputSourceFactory: created input source "
47  << modtype
48  << std::endl;
49 
50  return wm;
51  }
52 
53 }
T getParameter(std::string const &) const
#define FDEBUG(lev)
Definition: DebugMacros.h:18
std::unique_ptr< VectorInputSource > makeVectorInputSource(ParameterSet const &, VectorInputSourceDescription const &) const
static VectorInputSourceFactory const singleInstance_
#define EDM_REGISTER_PLUGINFACTORY(_factory_, _category_)
Definition: PluginFactory.h:90
static VectorInputSourceFactory const * get()
T get(const Candidate &c)
Definition: component.h:55