diff Plugins/Engine/PluginsManager.h @ 898:7000fc86fe62 plugins

improved plugin api
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 18 Jun 2014 09:18:28 +0200
parents bafc9d592632
children bb0a51561016
line wrap: on
line diff
--- a/Plugins/Engine/PluginsManager.h	Tue Jun 17 17:43:39 2014 +0200
+++ b/Plugins/Engine/PluginsManager.h	Wed Jun 18 09:18:28 2014 +0200
@@ -33,7 +33,7 @@
 #pragma once
 
 #include "SharedLibrary.h"
-#include "../OrthancCPlugin/OrthancCPlugin.h"
+#include "IPluginServiceProvider.h"
 
 #include <map>
 #include <list>
@@ -47,9 +47,15 @@
 
   private:
     typedef std::map<std::string, SharedLibrary*>  Plugins;
+
     OrthancPluginContext  context_;
     Plugins  plugins_;
     RestCallbacks  restCallbacks_;
+    IPluginServiceProvider *serviceProvider_;
+
+    static int32_t InvokeService(OrthancPluginContext* context,
+                                 OrthancPluginService service,
+                                 const void* parameters);
 
     static void RegisterRestCallback(const OrthancPluginContext* context,
                                      const char* path, 
@@ -65,6 +71,18 @@
     void ScanFolderForPlugins(const std::string& path,
                               bool isRecursive);
 
+    void SetServiceProvider(IPluginServiceProvider& provider)
+    {
+      serviceProvider_ = &provider;
+    }
+
+    bool HasServiceProvider() const
+    {
+      return serviceProvider_ != NULL;
+    }
+
+    IPluginServiceProvider& GetServiceProvider() const;
+
     const RestCallbacks& GetRestCallbacks() const
     {
       return restCallbacks_;