* @param type the name of the plugin type\r
* @param factory the factory function for the plugin type\r
*/\r
- void registerFactory(const char* type, typename PluginManager::Factory* factory) {\r
- if (type && factory)\r
+ void registerFactory(const std::string& type, typename PluginManager::Factory* factory) {\r
+ if (!type.empty() && factory)\r
m_map[type]=factory;\r
}\r
\r
* \r
* @param type the name of the plugin type\r
*/\r
- void deregisterFactory(const char* type) {\r
- if (type)\r
+ void deregisterFactory(const std::string& type) {\r
+ if (!type.empty())\r
m_map.erase(type);\r
}\r
\r
* @param p parameters to configure plugin\r
* @return the constructed plugin \r
*/\r
- T* newPlugin(const char* type, const Params& p) {\r
+ T* newPlugin(const std::string& type, const Params& p) {\r
typename std::map<std::string, typename PluginManager::Factory*>::const_iterator i=m_map.find(type);\r
if (i==m_map.end())\r
- throw UnknownExtensionException("Unable to build plugin of type '$1'",params(1,type));\r
+ throw UnknownExtensionException("Unable to build plugin of type '$1'",params(1,type.c_str()));\r
return i->second(p);\r
}\r
\r