From c8e697daf68f1c545ee3962d2f2e9b411c56b4f2 Mon Sep 17 00:00:00 2001 From: methodus Date: Sun, 30 Sep 2012 15:52:54 +0200 Subject: Working on plugin interface. PluginManager almost done. --- include/pluginManager.h | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) (limited to 'include/pluginManager.h') diff --git a/include/pluginManager.h b/include/pluginManager.h index 215f224..5c38e34 100644 --- a/include/pluginManager.h +++ b/include/pluginManager.h @@ -9,21 +9,43 @@ #define PLUGINMANAGER_H_ #include "../include/plugin.h" +#include +#include +#include namespace upnp { +class cMediaManager; + class cPluginManager { public: - cUPnPResourceProvider* CreateResourceProviderInstance(const std::string& schema); -private: - void LoadPlugins(); - void UnloadPlugins(); + typedef void*(*FunctionPtr)(void); - typedef std::list ProviderList; - typedef std::list ProfilerList; + cPluginManager(cMediaManager* manager); + virtual ~cPluginManager(); + + bool LoadPlugins(const std::string& directory); +private: + class DLL { + public: + DLL(const std::string& file); + virtual ~DLL(); + + bool Load(); + FunctionPtr GetProvider() const { return provider; }; + FunctionPtr GetProfiler() const { return profiler; }; + private: + std::string file; + void* handle; + FunctionPtr provider; + FunctionPtr profiler; + }; + + typedef std::list> DLLList; + + DLLList dlls; + cMediaManager* manager; - ProviderList providers; - ProfilerList profilers; }; } // namespace upnp -- cgit v1.2.3