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 ModuleTypeResolverMaker;
26  class ParameterSet;
27  namespace maker {
28  class ModuleHolder;
29  }
30 
40  public:
41  explicit WorkerRegistry(std::shared_ptr<ActivityRegistry> areg, ModuleTypeResolverMaker const* resolverMaker);
42  WorkerRegistry(std::shared_ptr<ActivityRegistry> areg, std::shared_ptr<ModuleRegistry> iModReg);
44 
45  WorkerRegistry(WorkerRegistry&&) = default;
46  WorkerRegistry(WorkerRegistry const&) = delete; // Disallow copying and moving
47  WorkerRegistry& operator=(WorkerRegistry const&) = delete; // Disallow copying and moving
48 
50 
54 
57  Worker const* get(std::string const& moduleLabel) const;
58 
61 
62  void clear();
63 
64  private:
66  typedef std::map<std::string, edm::propagate_const<std::shared_ptr<Worker>>> WorkerMap;
67 
69 
72  std::shared_ptr<ActivityRegistry> actReg_; // We do not use propagate_const because the registry itself is mutable.
73 
74  }; // WorkerRegistry
75 
76 } // namespace edm
77 
78 #endif
std::shared_ptr< ActivityRegistry > actReg_
WorkerRegistry & operator=(WorkerRegistry const &)=delete
void deleteModule(std::string const &moduleLabel)
Deletes the module of the Worker, but the Worker continues to exist.
WorkerMap m_workerMap
internal map of registered workers (owned).
edm::propagate_const< std::shared_ptr< ModuleRegistry > > modRegistry_
std::map< std::string, edm::propagate_const< std::shared_ptr< Worker > > > WorkerMap
the container of workers
HLT enums.
Worker * getWorker(WorkerParams const &p, std::string const &moduleLabel)
Retrieve the particular instance of the worker.
The Registry of all workers that where requested Holds all instances of workers. In this implementati...
WorkerRegistry(std::shared_ptr< ActivityRegistry > areg, ModuleTypeResolverMaker const *resolverMaker)