1 #ifndef Framework_ComponentFactory_h 2 #define Framework_ComponentFactory_h 37 namespace eventsetup {
39 class EventSetupsController;
48 typedef std::map<std::string, std::shared_ptr<Maker> >
MakerMap;
54 bool replaceExisting =
false)
const {
55 std::string modtype = iConfiguration.template getParameter<std::string>(
"@module_type");
57 typename MakerMap::iterator it =
makers_.find(modtype);
62 if (wm.get() ==
nullptr) {
68 " has not been registered.\n" 69 "Perhaps your module type is misspelled or is not a " 71 "Try running EdmPluginDump to obtain a list of " 72 "available Plugins.");
77 std::pair<typename MakerMap::iterator, bool> ret =
80 if (ret.second ==
false) {
89 return it->second->addTo(esController, iProvider, iConfiguration, replaceExisting);
92 std::string edmtype = iConfiguration.template getParameter<std::string>(
"@module_edm_type");
93 std::string label = iConfiguration.template getParameter<std::string>(
"@module_label");
94 std::ostringstream ost;
95 ost <<
"Constructing " << edmtype <<
": class=" << modtype <<
" label='" << label <<
"'";
99 return std::shared_ptr<base_type>();
118 #define COMPONENTFACTORY_GET(_type_) \ 119 EDM_REGISTER_PLUGINFACTORY(edmplugin::PluginFactory<edm::eventsetup::ComponentMakerBase<_type_>*()>, \ 121 static edm::eventsetup::ComponentFactory<_type_> const s_dummyfactory; \ 123 namespace eventsetup { \ 125 edm::eventsetup::ComponentFactory<_type_> const* edm::eventsetup::ComponentFactory<_type_>::get() { \ 126 return &s_dummyfactory; \ 130 typedef int componentfactory_get_needs_semicolon
ComponentMakerBase< T > Maker
def create(alignables, pedeDump, additionalData, outputFile, config)
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="")
std::shared_ptr< base_type > addTo(EventSetupsController &esController, EventSetupProvider &iProvider, edm::ParameterSet const &iConfiguration, 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())