summaryrefslogtreecommitdiff
path: root/libadhocutil/plugins.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-09-28 01:01:30 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2015-09-28 01:01:30 +0100
commit22e8e288d8e2f02a5bd2da743b257096cc7513ff (patch)
tree480adac2a8e2a5ae1fa757b2945ebdc7c1597746 /libadhocutil/plugins.h
parentUnambiguous create function name (diff)
downloadlibadhocutil-22e8e288d8e2f02a5bd2da743b257096cc7513ff.tar.bz2
libadhocutil-22e8e288d8e2f02a5bd2da743b257096cc7513ff.tar.xz
libadhocutil-22e8e288d8e2f02a5bd2da743b257096cc7513ff.zip
Access to plugin implementations from the very base class of plugin
Diffstat (limited to 'libadhocutil/plugins.h')
-rw-r--r--libadhocutil/plugins.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/libadhocutil/plugins.h b/libadhocutil/plugins.h
index 4e81b62..d73ffec 100644
--- a/libadhocutil/plugins.h
+++ b/libadhocutil/plugins.h
@@ -30,6 +30,12 @@ namespace AdHoc {
NoSuchPluginException(const std::string &, const std::type_info &);
};
+ /// Base class for all plugin implementations.
+ class DLL_PUBLIC AbstractPluginImplementation {
+ public:
+ virtual ~AbstractPluginImplementation() = 0;
+ };
+
/// Base class for untyped plugins.
class DLL_PUBLIC Plugin {
public:
@@ -40,6 +46,9 @@ namespace AdHoc {
/// Get the plugin type from the subclass.
virtual const std::type_info & type() const = 0;
+ /// Get the abstract base plugin implementation.
+ virtual const AbstractPluginImplementation * implementation() const = 0;
+
/// The name the plugin was installed with.
const std::string name;
/// The filename the plugin was installed in.
@@ -81,7 +90,7 @@ namespace AdHoc {
/// Get the type of this plugin.
const std::type_info & type() const override;
/// Get the implementation of this plugin.
- const T * implementation() const;
+ const T * implementation() const override;
private:
const T * impl;