diff Plugins/Engine/PluginsManager.h @ 1232:f1c01451a8ee

Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 04 Dec 2014 17:04:40 +0100
parents 9b8298234254
children 6e7e5ed91c2d
line wrap: on
line diff
--- a/Plugins/Engine/PluginsManager.h	Fri Nov 28 12:39:22 2014 +0100
+++ b/Plugins/Engine/PluginsManager.h	Thu Dec 04 17:04:40 2014 +0100
@@ -43,7 +43,34 @@
   class PluginsManager : boost::noncopyable
   {
   private:
-    typedef std::map<std::string, SharedLibrary*>  Plugins;
+    class Plugin
+    {
+    private:
+      SharedLibrary library_;
+      std::string  version_;
+
+    public:
+      Plugin(const std::string& path) : library_(path)
+      {
+      }
+
+      SharedLibrary& GetLibrary()
+      {
+        return library_;
+      }
+
+      void SetVersion(const std::string& version)
+      {
+        version_ = version;
+      }
+
+      const std::string& GetVersion() const
+      {
+        return version_;
+      }
+    };
+
+    typedef std::map<std::string, Plugin*>  Plugins;
 
     OrthancPluginContext  context_;
     Plugins  plugins_;
@@ -67,5 +94,11 @@
     {
       serviceProviders_.push_back(&provider);
     }
+
+    void ListPlugins(std::list<std::string>& result) const;
+
+    bool HasPlugin(const std::string& name) const;
+
+    const std::string& GetPluginVersion(const std::string& name) const;
   };
 }