#include <Factory.h>
Public Types | |
typedef std::map< std::string, Maker * > | MakerMap |
Public Member Functions | |
std::auto_ptr< Worker > | makeWorker (const WorkerParams &, sigc::signal< void, const ModuleDescription & > &pre, sigc::signal< void, const ModuleDescription & > &post) const |
~Factory () | |
Static Public Member Functions | |
static Factory * | get () |
Private Member Functions | |
Factory () | |
Private Attributes | |
MakerMap | makers_ |
Static Private Attributes | |
static Factory | singleInstance_ |
typedef std::map<std::string, Maker*> edm::Factory::MakerMap |
edm::Factory::~Factory | ( | ) |
Definition at line 19 of file Factory.cc.
References edm::cleanup(), edm::for_all(), and makers_.
edm::Factory::Factory | ( | ) | [private] |
Definition at line 24 of file Factory.cc.
: makers_() { }
Factory * edm::Factory::get | ( | void | ) | [static] |
std::auto_ptr< Worker > edm::Factory::makeWorker | ( | const WorkerParams & | p, |
sigc::signal< void, const ModuleDescription & > & | pre, | ||
sigc::signal< void, const ModuleDescription & > & | post | ||
) | const |
Definition at line 34 of file Factory.cc.
References edm::errors::Configuration, SurfaceDeformationFactory::create(), FDEBUG, reco::get(), edm::ParameterSet::getParameter(), makers_, edm::WorkerParams::processConfiguration_, edm::WorkerParams::pset_, runTheMatrix::ret, and w().
{ std::string modtype = p.pset_->getParameter<std::string>("@module_type"); FDEBUG(1) << "Factory: module_type = " << modtype << std::endl; MakerMap::iterator it = makers_.find(modtype); if(it == makers_.end()) { std::auto_ptr<Maker> wm(MakerPluginFactory::get()->create(modtype)); if(wm.get()==0) throw edm::Exception(errors::Configuration,"UnknownModule") << "Module " << modtype << " with version " << p.processConfiguration_->releaseVersion() << " was not registered.\n" << "Perhaps your module type is misspelled or is not a " << "framework plugin.\n" << "Try running EdmPluginDump to obtain a list of " << "available Plugins."; FDEBUG(1) << "Factory: created worker of type " << modtype << std::endl; std::pair<MakerMap::iterator,bool> ret = makers_.insert(std::pair<std::string,Maker*>(modtype,wm.get())); // if(ret.second==false) // throw runtime_error("Worker Factory map insert failed"); it = ret.first; wm.release(); } std::auto_ptr<Worker> w(it->second->makeWorker(p,pre,post)); return w; }
MakerMap edm::Factory::makers_ [mutable, private] |
Definition at line 34 of file Factory.h.
Referenced by makeWorker(), and ~Factory().
Factory edm::Factory::singleInstance_ [static, private] |