CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Attributes
edm::InputSourceFactory Class Reference

#include <InputSourceFactory.h>

Public Member Functions

std::auto_ptr< InputSourcemakeInputSource (ParameterSet const &, InputSourceDescription const &) const
 
 ~InputSourceFactory ()
 

Static Public Member Functions

static InputSourceFactoryget ()
 

Private Member Functions

 InputSourceFactory ()
 

Static Private Attributes

static InputSourceFactory singleInstance_
 

Detailed Description

Definition at line 16 of file InputSourceFactory.h.

Constructor & Destructor Documentation

edm::InputSourceFactory::~InputSourceFactory ( )

Definition at line 13 of file InputSourceFactory.cc.

14  {
15  }
edm::InputSourceFactory::InputSourceFactory ( )
private

Definition at line 17 of file InputSourceFactory.cc.

18  {
19  }

Member Function Documentation

InputSourceFactory * edm::InputSourceFactory::get ( void  )
static

Definition at line 23 of file InputSourceFactory.cc.

References singleInstance_.

Referenced by Options.Options::__getitem__(), and edm::makeInput().

24  {
25  // will not work with plugin factories
26  //static InputSourceFactory f;
27  //return &f;
28 
29  return &singleInstance_;
30  }
static InputSourceFactory singleInstance_
std::auto_ptr< InputSource > edm::InputSourceFactory::makeInputSource ( ParameterSet const &  conf,
InputSourceDescription const &  desc 
) const

Definition at line 33 of file InputSourceFactory.cc.

References edm::errors::Configuration, ExpressReco_HICollisions_FallBack::e, edm::hlt::Exception, FDEBUG, reco::get(), and edm::ParameterSet::getParameter().

Referenced by edm::makeInput().

36  {
37  std::string modtype = conf.getParameter<std::string>("@module_type");
38  FDEBUG(1) << "InputSourceFactory: module_type = " << modtype << std::endl;
39  std::auto_ptr<InputSource> wm;
40  try {
41  wm = std::auto_ptr<InputSource>(InputSourcePluginFactory::get()->create(modtype,conf,desc));
42  }
43  catch(edm::Exception& ex) {
44  ex << "\nError occurred while creating source " << modtype << "\n";
45  throw;
46  }
47  catch(cms::Exception& e) {
48  e << "\nError occurred while creating source " << modtype << "\n";
49  throw;
50  }
51 
52  if(wm.get()==0) {
53  throw edm::Exception(errors::Configuration,"NoSourceModule")
54  << "InputSource Factory:\n"
55  << "Cannot find source type from ParameterSet: "
56  << modtype << "\n"
57  << "Perhaps your source type is misspelled or is not an EDM Plugin?\n"
58  << "Try running EdmPluginDump to obtain a list of available Plugins.";
59  }
60 
61  wm->registerProducts();
62 
63  FDEBUG(1) << "InputSourceFactory: created input source "
64  << modtype
65  << std::endl;
66 
67  return wm;
68  }
#define FDEBUG(lev)
Definition: DebugMacros.h:18
tuple conf
Definition: dbtoconf.py:185
T get(const Candidate &c)
Definition: component.h:56

Member Data Documentation

InputSourceFactory edm::InputSourceFactory::singleInstance_
staticprivate

Definition at line 29 of file InputSourceFactory.h.

Referenced by get().