#include <WorkerRegistry.h>
Public Member Functions | |
void | clear () |
Worker * | getWorker (WorkerParams const &p, std::string const &moduleLabel) |
Retrieve the particular instance of the worker. | |
WorkerRegistry (boost::shared_ptr< ActivityRegistry > areg) | |
~WorkerRegistry () | |
Private Types | |
typedef std::map< std::string, boost::shared_ptr< Worker > > | WorkerMap |
the container of workers | |
Private Attributes | |
boost::shared_ptr < ActivityRegistry > | actReg_ |
WorkerMap | m_workerMap |
internal map of registered workers (owned). |
Definition at line 33 of file WorkerRegistry.h.
typedef std::map<std::string, boost::shared_ptr<Worker> > edm::WorkerRegistry::WorkerMap [private] |
the container of workers
Definition at line 49 of file WorkerRegistry.h.
edm::WorkerRegistry::WorkerRegistry | ( | boost::shared_ptr< ActivityRegistry > | areg | ) | [explicit] |
Definition at line 16 of file WorkerRegistry.cc.
: m_workerMap(), actReg_(areg) { }
edm::WorkerRegistry::~WorkerRegistry | ( | ) |
void edm::WorkerRegistry::clear | ( | void | ) |
Worker * edm::WorkerRegistry::getWorker | ( | WorkerParams const & | p, |
std::string const & | moduleLabel | ||
) |
Retrieve the particular instance of the worker.
If the worker with that set of parameters does not exist, create it
Definition at line 30 of file WorkerRegistry.cc.
References actReg_, reco::get(), m_workerMap, and moduleLabel().
Referenced by edm::Schedule::fillWorkers(), and edm::Schedule::Schedule().
{ WorkerMap::iterator workerIt = m_workerMap.find(moduleLabel); // if the worker is not there, make it if (workerIt == m_workerMap.end()){ std::auto_ptr<Worker> workerPtr= Factory::get()->makeWorker(p,actReg_->preModuleConstructionSignal_, actReg_->postModuleConstructionSignal_); workerPtr->setActivityRegistry(actReg_); // Transfer ownership of worker to the registry m_workerMap[moduleLabel].reset(workerPtr.release()); return m_workerMap[moduleLabel].get(); } return (workerIt->second.get()); }
boost::shared_ptr<ActivityRegistry> edm::WorkerRegistry::actReg_ [private] |
Definition at line 53 of file WorkerRegistry.h.
Referenced by getWorker().
WorkerMap edm::WorkerRegistry::m_workerMap [private] |
internal map of registered workers (owned).
Definition at line 52 of file WorkerRegistry.h.
Referenced by clear(), getWorker(), and ~WorkerRegistry().