Parameter to plugin should be a const reference.
authorScott Cantor <cantor.2@osu.edu>
Tue, 11 Jul 2006 02:56:38 +0000 (02:56 +0000)
committerScott Cantor <cantor.2@osu.edu>
Tue, 11 Jul 2006 02:56:38 +0000 (02:56 +0000)
xmltooling/PluginManager.h

index 9308c80..592253e 100644 (file)
@@ -49,7 +49,7 @@ namespace xmltooling {
         ~PluginManager() {}\r
 \r
         /** Factory function for plugin. */\r
-        typedef T* Factory(typename Params&);\r
+        typedef T* Factory(typename const Params&);\r
 \r
         /**\r
          * Registers the factory for a given type.\r
@@ -81,7 +81,7 @@ namespace xmltooling {
          * @param p     parameters to configure plugin\r
          * @return      the constructed plugin  \r
          */\r
-        T* newPlugin(const char* type, typename Params& p) {\r
+        T* newPlugin(const char* type, typename const Params& p) {\r
             std::map<std::string, typename 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