1 #ifndef Framework_ComponentFactory_h
2 #define Framework_ComponentFactory_h
24 #include "boost/shared_ptr.hpp"
36 namespace eventsetup {
48 typedef std::map<std::string, boost::shared_ptr<Maker> >
MakerMap;
53 std::string
const& iProcessName,
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) {
91 return it->second->addTo(iProvider,iConfiguration,iProcessName,iVersion,iPass);
94 toThrow<<modtype<<
"\n";
95 toThrow.
append(iException);
98 return boost::shared_ptr<base_type>();
118 #define COMPONENTFACTORY_GET(_type_) \
119 EDM_REGISTER_PLUGINFACTORY(edmplugin::PluginFactory<edm::eventsetup::ComponentMakerBase<_type_>* ()>,_type_::name()); \
120 static edm::eventsetup::ComponentFactory<_type_> s_dummyfactory; \
121 namespace edm { namespace eventsetup { \
122 template<> edm::eventsetup::ComponentFactory<_type_>* edm::eventsetup::ComponentFactory<_type_>::get() \
123 { return &s_dummyfactory; } \
125 typedef int componentfactory_get_needs_semicolon
ComponentMakerBase< T > Maker
void append(Exception const &another)
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="")
boost::shared_ptr< base_type > addTo(EventSetupProvider &iProvider, edm::ParameterSet const &iConfiguration, std::string const &iProcessName, ReleaseVersion const &iVersion, PassID const &iPass) const
std::string ReleaseVersion