Exercises: Add plugin system task

This commit is contained in:
Alex Hirsch
2020-11-19 23:47:47 +01:00
parent 5d850c2d9d
commit 9039c95690
2 changed files with 46 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
#ifndef PLUGIN_HPP
#define PLUGIN_HPP
#include <memory>
/// Interface for plugins.
class Plugin {
public:
virtual void run() = 0;
virtual ~Plugin(){};
};
/// Symbol of the plugin constructor function.
const auto PLUGIN_CONSTRUCTOR = "create_plugin";
/// Type of the plugin constructor function.
using PLUGIN_CONSTRUCTOR_T = std::unique_ptr<Plugin> (*)();
#endif // PLUGIN_HPP