CMS 3D CMS Logo

Factory.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_Factory_h
2 #define FWCore_Framework_Factory_h
3 
7 
8 #include <map>
9 #include <string>
10 #include <memory>
14 
15 namespace edm {
16  class ModuleTypeResolverMaker;
17 
18  class Factory {
19  public:
20  typedef std::map<std::string, std::unique_ptr<Maker const>> MakerMap;
21 
22  ~Factory();
23 
24  static Factory const* get();
25 
26  //This function is not const-thread safe
27  std::shared_ptr<maker::ModuleHolder> makeModule(const MakeModuleParams&,
29  signalslot::Signal<void(const ModuleDescription&)>& pre,
30  signalslot::Signal<void(const ModuleDescription&)>& post) const;
31 
32  std::shared_ptr<maker::ModuleHolder> makeReplacementModule(const edm::ParameterSet&) const;
33 
34  private:
35  Factory();
36  Maker const* findMaker(const MakeModuleParams& p, const ModuleTypeResolverMaker*) const;
37  static Factory const singleInstance_;
38  //It is not safe to create modules across threads
40  };
41 
42 } // namespace edm
43 #endif
#define CMS_SA_ALLOW
std::shared_ptr< maker::ModuleHolder > makeReplacementModule(const edm::ParameterSet &) const
Definition: Factory.cc:43
std::shared_ptr< maker::ModuleHolder > makeModule(const MakeModuleParams &, const ModuleTypeResolverMaker *, signalslot::Signal< void(const ModuleDescription &)> &pre, signalslot::Signal< void(const ModuleDescription &)> &post) const
Definition: Factory.cc:33
static Factory const singleInstance_
Definition: Factory.h:37
HLT enums.
std::map< std::string, std::unique_ptr< Maker const > > MakerMap
Definition: Factory.h:20
Maker const * findMaker(const MakeModuleParams &p, const ModuleTypeResolverMaker *) const
Definition: Factory.cc:23
MakerMap makers_
Definition: Factory.h:39