#include <FWCore/Framework/src/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_ |
Definition at line 17 of file Factory.h.
typedef std::map<std::string, Maker*> edm::Factory::MakerMap |
edm::Factory::~Factory | ( | ) |
edm::Factory::Factory | ( | ) | [private] |
Definition at line 29 of file Factory.cc.
References singleInstance_.
00030 { 00031 return &singleInstance_; 00032 }
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, lat::endl(), FDEBUG, DBSPlugin::get(), edm::ParameterSet::getParameter(), it, makers_, edm::WorkerParams::pset_, edm::WorkerParams::releaseVersion_, and w.
00037 { 00038 std::string modtype = p.pset_->getParameter<std::string>("@module_type"); 00039 FDEBUG(1) << "Factory: module_type = " << modtype << std::endl; 00040 MakerMap::iterator it = makers_.find(modtype); 00041 00042 if(it == makers_.end()) 00043 { 00044 std::auto_ptr<Maker> wm(MakerPluginFactory::get()->create(modtype)); 00045 00046 if(wm.get()==0) 00047 throw edm::Exception(errors::Configuration,"UnknownModule") 00048 << "Module " << modtype 00049 << " with version " << p.releaseVersion_ 00050 << " was not registered.\n" 00051 << "Perhaps your module type is misspelled or is not a " 00052 << "framework plugin.\n" 00053 << "Try running EdmPluginDump to obtain a list of " 00054 << "available Plugins."; 00055 00056 FDEBUG(1) << "Factory: created worker of type " << modtype << std::endl; 00057 00058 std::pair<MakerMap::iterator,bool> ret = 00059 makers_.insert(std::make_pair<std::string,Maker*>(modtype,wm.get())); 00060 00061 // if(ret.second==false) 00062 // throw runtime_error("Worker Factory map insert failed"); 00063 00064 it = ret.first; 00065 wm.release(); 00066 } 00067 00068 std::auto_ptr<Worker> w(it->second->makeWorker(p,pre,post)); 00069 return w; 00070 }
MakerMap edm::Factory::makers_ [mutable, private] |
Factory edm::Factory::singleInstance_ [static, private] |