CMS 3D CMS Logo

WorkerRegistry.h
Go to the documentation of this file.
1 #ifndef Framework_WorkerRegistry_h
2 #define Framework_WorkerRegistry_h
3 
12 #include <memory>
13 
14 #include <map>
15 #include <string>
16 
18 
19 namespace edm {
20 
21  class Worker;
22  class ActivityRegistry;
23  struct WorkerParams;
24  class ModuleRegistry;
25  class ParameterSet;
26  namespace maker {
27  class ModuleHolder;
28  }
29 
39  public:
40  explicit WorkerRegistry(std::shared_ptr<ActivityRegistry> areg);
41  WorkerRegistry(std::shared_ptr<ActivityRegistry> areg, std::shared_ptr<ModuleRegistry> iModReg);
43 
44  WorkerRegistry(WorkerRegistry&&) = default;
45  WorkerRegistry(WorkerRegistry const&) = delete; // Disallow copying and moving
46  WorkerRegistry& operator=(WorkerRegistry const&) = delete; // Disallow copying and moving
47 
49 
53 
56  Worker const* get(std::string const& moduleLabel) const;
57 
60 
61  void clear();
62 
63  private:
65  typedef std::map<std::string, edm::propagate_const<std::shared_ptr<Worker>>> WorkerMap;
66 
68 
71  std::shared_ptr<ActivityRegistry> actReg_; // We do not use propagate_const because the registry itself is mutable.
72 
73  }; // WorkerRegistry
74 
75 } // namespace edm
76 
77 #endif
edm::WorkerRegistry::operator=
WorkerRegistry & operator=(WorkerRegistry const &)=delete
ActivityRegistry
propagate_const.h
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::WorkerRegistry::m_workerMap
WorkerMap m_workerMap
internal map of registered workers (owned).
Definition: WorkerRegistry.h:70
edm::WorkerRegistry::clear
void clear()
Definition: WorkerRegistry.cc:26
edm::WorkerRegistry::WorkerRegistry
WorkerRegistry(std::shared_ptr< ActivityRegistry > areg)
Definition: WorkerRegistry.cc:18
edm::propagate_const
Definition: propagate_const.h:32
edm::WorkerRegistry::getWorker
Worker * getWorker(WorkerParams const &p, std::string const &moduleLabel)
Retrieve the particular instance of the worker.
Definition: WorkerRegistry.cc:28
edm::WorkerRegistry::get
Worker const * get(std::string const &moduleLabel) const
Definition: WorkerRegistry.cc:48
edm::Worker
Definition: Worker.h:91
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
ParameterSet
Definition: Functions.h:16
edm::WorkerParams
Definition: WorkerParams.h:22
edm::WorkerRegistry::actReg_
std::shared_ptr< ActivityRegistry > actReg_
Definition: WorkerRegistry.h:71
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::WorkerRegistry
The Registry of all workers that where requested Holds all instances of workers. In this implementati...
Definition: WorkerRegistry.h:38
edm::WorkerRegistry::WorkerMap
std::map< std::string, edm::propagate_const< std::shared_ptr< Worker > > > WorkerMap
the container of workers
Definition: WorkerRegistry.h:65
edm::WorkerRegistry::modRegistry_
edm::propagate_const< std::shared_ptr< ModuleRegistry > > modRegistry_
Definition: WorkerRegistry.h:67
edm::WorkerRegistry::deleteModule
void deleteModule(std::string const &moduleLabel)
Deletes the module of the Worker, but the Worker continues to exist.
Definition: WorkerRegistry.cc:56
HerwigMaxPtPartonFilter_cfi.moduleLabel
moduleLabel
Definition: HerwigMaxPtPartonFilter_cfi.py:4
edm::WorkerRegistry::~WorkerRegistry
~WorkerRegistry()
Definition: WorkerRegistry.cc:24