diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-09-28 01:27:01 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-09-28 01:27:01 +0100 |
commit | 3a7a60b618b82416e6774bd8dff4b706d39e6aaa (patch) | |
tree | 5d8f52127deeb08b3f9ab92309449771a92a8c50 /libadhocutil/plugins.h | |
parent | Access to plugin implementations from the very base class of plugin (diff) | |
download | libadhocutil-3a7a60b618b82416e6774bd8dff4b706d39e6aaa.tar.bz2 libadhocutil-3a7a60b618b82416e6774bd8dff4b706d39e6aaa.tar.xz libadhocutil-3a7a60b618b82416e6774bd8dff4b706d39e6aaa.zip |
No need for plugin implementations to be const
Diffstat (limited to 'libadhocutil/plugins.h')
-rw-r--r-- | libadhocutil/plugins.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libadhocutil/plugins.h b/libadhocutil/plugins.h index d73ffec..69d0182 100644 --- a/libadhocutil/plugins.h +++ b/libadhocutil/plugins.h @@ -47,7 +47,7 @@ namespace AdHoc { virtual const std::type_info & type() const = 0; /// Get the abstract base plugin implementation. - virtual const AbstractPluginImplementation * implementation() const = 0; + virtual AbstractPluginImplementation * implementation() const = 0; /// The name the plugin was installed with. const std::string name; @@ -84,16 +84,16 @@ namespace AdHoc { class DLL_PUBLIC PluginOf : public Plugin { public: /// Constructor taking an instance and name, filename and line of install for Plugin. - PluginOf(const T * t, const std::string & n, const std::string & f, int l); + PluginOf(T * t, const std::string & n, const std::string & f, int l); ~PluginOf(); /// Get the type of this plugin. const std::type_info & type() const override; /// Get the implementation of this plugin. - const T * implementation() const override; + T * implementation() const override; private: - const T * impl; + T * impl; }; /// Container for loaded plugins. @@ -124,7 +124,7 @@ namespace AdHoc { * @param f Filename of plugin. * @param l Line number. */ - template<typename T> void add(const T * i, const std::string & n, const std::string & f, int l); + template<typename T> void add(T * i, const std::string & n, const std::string & f, int l); /** * Uninstall a plugin. @@ -142,7 +142,7 @@ namespace AdHoc { * Get the implementation from specific plugin. * @param n Name of plugin. */ - template<typename T> const T * getImplementation(const std::string & n) const; + template<typename T> T * getImplementation(const std::string & n) const; /** * Get all plugins of a given time. |