CMS 3D CMS Logo

ModuleRegistry.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_ModuleRegistry_h
2 #define FWCore_Framework_ModuleRegistry_h
3 // -*- C++ -*-
4 //
5 // Package: FWCore/Framework
6 // Class : ModuleRegistry
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Fri, 23 Aug 2013 16:21:10 GMT
19 //
20 
21 // system include files
22 #include <map>
23 #include <memory>
24 #include <string>
25 
26 // user include files
30 
31 // forward declarations
32 namespace edm {
33  class ParameterSet;
34  struct MakeModuleParams;
35  class ModuleDescription;
36  class PreallocationConfiguration;
37  namespace maker {
38  class ModuleHolder;
39  }
40 
42  public:
43  ModuleRegistry() = default;
44  explicit ModuleRegistry(ModuleTypeResolverMaker const* resolverMaker) : typeResolverMaker_(resolverMaker) {}
45  std::shared_ptr<maker::ModuleHolder> getModule(MakeModuleParams const& p,
46  std::string const& moduleLabel,
47  signalslot::Signal<void(ModuleDescription const&)>& iPre,
48  signalslot::Signal<void(ModuleDescription const&)>& iPost);
49 
50  maker::ModuleHolder* replaceModule(std::string const& iModuleLabel,
51  edm::ParameterSet const& iPSet,
53 
54  void deleteModule(std::string const& iModuleLabel,
55  signalslot::Signal<void(ModuleDescription const&)>& iPre,
56  signalslot::Signal<void(ModuleDescription const&)>& iPost);
57 
58  template <typename F>
59  void forAllModuleHolders(F iFunc) {
60  for (auto& labelMod : labelToModule_) {
61  maker::ModuleHolder* t = labelMod.second.get();
62  iFunc(t);
63  }
64  }
65 
66  private:
67  std::map<std::string, edm::propagate_const<std::shared_ptr<maker::ModuleHolder>>> labelToModule_;
69  };
70 } // namespace edm
71 
72 #endif
ModuleTypeResolverMaker const * typeResolverMaker_
std::shared_ptr< maker::ModuleHolder > getModule(MakeModuleParams const &p, std::string const &moduleLabel, signalslot::Signal< void(ModuleDescription const &)> &iPre, signalslot::Signal< void(ModuleDescription const &)> &iPost)
ModuleRegistry()=default
std::map< std::string, edm::propagate_const< std::shared_ptr< maker::ModuleHolder > > > labelToModule_
ModuleRegistry(ModuleTypeResolverMaker const *resolverMaker)
void forAllModuleHolders(F iFunc)
HLT enums.
maker::ModuleHolder * replaceModule(std::string const &iModuleLabel, edm::ParameterSet const &iPSet, edm::PreallocationConfiguration const &)
void deleteModule(std::string const &iModuleLabel, signalslot::Signal< void(ModuleDescription const &)> &iPre, signalslot::Signal< void(ModuleDescription const &)> &iPost)
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:163