summaryrefslogtreecommitdiff
path: root/include/pluginManager.h
diff options
context:
space:
mode:
authormethodus <methodus@web.de>2012-09-30 15:52:54 +0200
committermethodus <methodus@web.de>2012-09-30 15:52:54 +0200
commitc8e697daf68f1c545ee3962d2f2e9b411c56b4f2 (patch)
tree48bc206a65ad956ab4284113c33d4b1d50398495 /include/pluginManager.h
parentdd3e8652f530c35febcc3f595e38443395f79198 (diff)
downloadvdr-plugin-upnp-c8e697daf68f1c545ee3962d2f2e9b411c56b4f2.tar.gz
vdr-plugin-upnp-c8e697daf68f1c545ee3962d2f2e9b411c56b4f2.tar.bz2
Working on plugin interface. PluginManager almost done.
Diffstat (limited to 'include/pluginManager.h')
-rw-r--r--include/pluginManager.h38
1 files changed, 30 insertions, 8 deletions
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 <string>
+#include <map>
+#include <list>
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<cUPnPResourceProvider> ProviderList;
- typedef std::list<cMediaProfiler> 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<boost::shared_ptr<DLL>> DLLList;
+
+ DLLList dlls;
+ cMediaManager* manager;
- ProviderList providers;
- ProfilerList profilers;
};
} // namespace upnp