#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 & | operator= (WorkerRegistry const &) |
WorkerRegistry (boost::shared_ptr< ActivityRegistry > areg) | |
WorkerRegistry (WorkerRegistry const &) | |
~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 32 of file WorkerRegistry.h.
typedef std::map<std::string, boost::shared_ptr<Worker> > edm::WorkerRegistry::WorkerMap [private] |
the container of workers
Definition at line 51 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 | ( | ) |
edm::WorkerRegistry::WorkerRegistry | ( | WorkerRegistry const & | ) |
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(), and m_workerMap.
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()){ auto 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()); }
WorkerRegistry& edm::WorkerRegistry::operator= | ( | WorkerRegistry const & | ) |
boost::shared_ptr<ActivityRegistry> edm::WorkerRegistry::actReg_ [private] |
Definition at line 55 of file WorkerRegistry.h.
Referenced by getWorker().
WorkerMap edm::WorkerRegistry::m_workerMap [private] |
internal map of registered workers (owned).
Definition at line 54 of file WorkerRegistry.h.
Referenced by clear(), getWorker(), and ~WorkerRegistry().