CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Attributes

edm::InputSourceFactory Class Reference

#include <InputSourceFactory.h>

List of all members.

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.

  {
  }
edm::InputSourceFactory::InputSourceFactory ( ) [private]

Definition at line 17 of file InputSourceFactory.cc.

  {
  }

Member Function Documentation

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

Definition at line 23 of file InputSourceFactory.cc.

References singleInstance_.

Referenced by makeInputSource().

  {
    // will not work with plugin factories
    //static InputSourceFactory f;
    //return &f;

    return &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, Exception, FDEBUG, get(), and edm::ParameterSet::getParameter().

  {
    std::string modtype = conf.getParameter<std::string>("@module_type");
    FDEBUG(1) << "InputSourceFactory: module_type = " << modtype << std::endl;
    std::auto_ptr<InputSource> wm;
    wm = std::auto_ptr<InputSource>(InputSourcePluginFactory::get()->create(modtype,conf,desc));
    
    if(wm.get()==0) {
        throw edm::Exception(errors::Configuration,"NoSourceModule")
          << "InputSource Factory:\n"
          << "Cannot find source type from ParameterSet: "
          << modtype << "\n"
          << "Perhaps your source type is misspelled or is not an EDM Plugin?\n"
          << "Try running EdmPluginDump to obtain a list of available Plugins.";
    }

    wm->registerProducts();

    FDEBUG(1) << "InputSourceFactory: created input source "
              << modtype
              << std::endl;

    return wm;
  }

Member Data Documentation

Definition at line 29 of file InputSourceFactory.h.

Referenced by get().