diff Plugins/Engine/PluginsManager.h @ 899:bb0a51561016 plugins

refactoring
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 18 Jun 2014 13:29:09 +0200
parents 7000fc86fe62
children 9b8298234254
line wrap: on
line diff
--- a/Plugins/Engine/PluginsManager.h	Wed Jun 18 09:18:28 2014 +0200
+++ b/Plugins/Engine/PluginsManager.h	Wed Jun 18 13:29:09 2014 +0200
@@ -42,25 +42,17 @@
 {
   class PluginsManager : boost::noncopyable
   {
-  public:
-    typedef std::list< std::pair<std::string, OrthancPluginRestCallback> >  RestCallbacks;
-
   private:
     typedef std::map<std::string, SharedLibrary*>  Plugins;
 
     OrthancPluginContext  context_;
     Plugins  plugins_;
-    RestCallbacks  restCallbacks_;
-    IPluginServiceProvider *serviceProvider_;
+    std::list<IPluginServiceProvider*> serviceProviders_;
 
     static int32_t InvokeService(OrthancPluginContext* context,
                                  OrthancPluginService service,
                                  const void* parameters);
 
-    static void RegisterRestCallback(const OrthancPluginContext* context,
-                                     const char* path, 
-                                     OrthancPluginRestCallback callback);
-
   public:
     PluginsManager();
 
@@ -71,21 +63,9 @@
     void ScanFolderForPlugins(const std::string& path,
                               bool isRecursive);
 
-    void SetServiceProvider(IPluginServiceProvider& provider)
-    {
-      serviceProvider_ = &provider;
-    }
-
-    bool HasServiceProvider() const
+    void RegisterServiceProvider(IPluginServiceProvider& provider)
     {
-      return serviceProvider_ != NULL;
-    }
-
-    IPluginServiceProvider& GetServiceProvider() const;
-
-    const RestCallbacks& GetRestCallbacks() const
-    {
-      return restCallbacks_;
+      serviceProviders_.push_back(&provider);
     }
   };
 }