1 #ifndef Framework_ComponentFactory_h
2 #define Framework_ComponentFactory_h
25 #include "boost/shared_ptr.hpp"
37 namespace eventsetup {
50 typedef std::map<std::string, boost::shared_ptr<Maker> >
MakerMap;
57 std::string modtype = iConfiguration.template getParameter<std::string>(
"@module_type");
59 typename MakerMap::iterator it =
makers_.find(modtype);
71 " has not been registered.\n"
72 "Perhaps your module type is misspelled or is not a "
74 "Try running EdmPluginDump to obtain a list of "
75 "available Plugins.");
80 std::pair<typename MakerMap::iterator,bool>
ret =
81 makers_.insert(std::pair<std::string,boost::shared_ptr<Maker> >(modtype,wm));
83 if(ret.second ==
false) {
92 return it->second->addTo(esController, iProvider, iConfiguration);
102 std::string edmtype = iConfiguration.template getParameter<std::string>(
"@module_edm_type");
103 std::string
label = iConfiguration.template getParameter<std::string>(
"@module_label");
104 std::ostringstream ost;
105 ost <<
"Constructing " << edmtype <<
": class=" << modtype <<
" label='" << label <<
"'";
109 return boost::shared_ptr<base_type>();
129 #define COMPONENTFACTORY_GET(_type_) \
130 EDM_REGISTER_PLUGINFACTORY(edmplugin::PluginFactory<edm::eventsetup::ComponentMakerBase<_type_>* ()>,_type_::name()); \
131 static edm::eventsetup::ComponentFactory<_type_> s_dummyfactory; \
132 namespace edm { namespace eventsetup { \
133 template<> edm::eventsetup::ComponentFactory<_type_>* edm::eventsetup::ComponentFactory<_type_>::get() \
134 { return &s_dummyfactory; } \
136 typedef int componentfactory_get_needs_semicolon
ComponentMakerBase< T > Maker
std::map< std::string, boost::shared_ptr< Maker > > MakerMap
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="")
void stdToEDM(std::exception const &e)
void charPtrToEDM(char const *c)
void stringToEDM(std::string &s)
void addContext(std::string const &context)
boost::shared_ptr< base_type > addTo(EventSetupsController &esController, EventSetupProvider &iProvider, edm::ParameterSet const &iConfiguration) const