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);
42  ~WorkerRegistry();
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 
52  Worker* getWorker(WorkerParams const& p, std::string const& moduleLabel);
53  void clear();
54 
55  private:
57  typedef std::map<std::string, edm::propagate_const<std::shared_ptr<Worker>>> WorkerMap;
58 
60 
62  WorkerMap m_workerMap;
63  std::shared_ptr<ActivityRegistry> actReg_; // We do not use propagate_const because the registry itself is mutable.
64 
65  }; // WorkerRegistry
66 
67 } // namespace edm
68 
69 #endif
std::shared_ptr< ActivityRegistry > actReg_
void clear(CLHEP::HepGenMatrix &m)
Helper function: Reset all elements of a matrix to 0.
Definition: matutil.cc:167
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.
The Registry of all workers that where requested Holds all instances of workers. In this implementati...