1 #ifndef Framework_ComponentFactory_h 2 #define Framework_ComponentFactory_h 39 class ModuleTypeResolverBase;
41 namespace eventsetup {
42 class EventSetupProvider;
43 class EventSetupsController;
52 typedef std::map<std::string, std::shared_ptr<Maker>>
MakerMap;
59 bool replaceExisting =
false)
const {
60 std::string modtype = iConfiguration.template getParameter<std::string>(
"@module_type");
62 typename MakerMap::iterator it =
makers_.find(modtype);
65 std::shared_ptr<Maker> wm(
70 std::pair<typename MakerMap::iterator, bool>
ret =
73 if (
ret.second ==
false) {
82 return it->second->addTo(esController, iProvider, iConfiguration, replaceExisting);
85 std::string edmtype = iConfiguration.template getParameter<std::string>(
"@module_edm_type");
86 std::string label = iConfiguration.template getParameter<std::string>(
"@module_label");
87 std::ostringstream ost;
88 ost <<
"Constructing " << edmtype <<
": class=" << modtype <<
" label='" <<
label <<
"'";
92 return std::shared_ptr<base_type>();
112 #define COMPONENTFACTORY_GET(_type_) \ 113 EDM_REGISTER_PLUGINFACTORY(edmplugin::PluginFactory<edm::eventsetup::ComponentMakerBase<_type_>*()>, \ 115 static edm::eventsetup::ComponentFactory<_type_> const s_dummyfactory; \ 117 namespace eventsetup { \ 119 edm::eventsetup::ComponentFactory<_type_> const* edm::eventsetup::ComponentFactory<_type_>::get() { \ 120 return &s_dummyfactory; \ 124 typedef int componentfactory_get_needs_semicolon
ComponentMakerBase< T > Maker
ret
prodAgent to be discontinued
const ComponentFactory & operator=(const ComponentFactory &)
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
auto resolveMaker(std::string const &moduleType, ModuleTypeResolverBase const *resolver)
std::shared_ptr< base_type > addTo(EventSetupsController &esController, EventSetupProvider &iProvider, edm::ParameterSet &iConfiguration, ModuleTypeResolverBase const *resolver, bool replaceExisting=false) const
void addContext(std::string const &context)
std::map< std::string, std::shared_ptr< Maker > > MakerMap
auto wrap(F iFunc) -> decltype(iFunc())