comparison Plugins/Engine/PluginsManager.h @ 1630:ffd23c0104af

"/system" URI gives information about the plugins used for storage area and DB back-end
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 21 Sep 2015 13:26:45 +0200
parents 357c4bb15701
children eb8fbcf008b5
comparison
equal deleted inserted replaced
1629:bad4772b605c 1630:ffd23c0104af
38 #include <map> 38 #include <map>
39 #include <list> 39 #include <list>
40 40
41 namespace Orthanc 41 namespace Orthanc
42 { 42 {
43 class PluginsManager : boost::noncopyable 43 class PluginsManager : public boost::noncopyable
44 { 44 {
45 private: 45 private:
46 class Plugin 46 class Plugin : public boost::noncopyable
47 { 47 {
48 private: 48 private:
49 SharedLibrary library_; 49 OrthancPluginContext context_;
50 std::string version_; 50 SharedLibrary library_;
51 std::string version_;
52 PluginsManager& pluginManager_;
51 53
52 public: 54 public:
53 Plugin(const std::string& path) : library_(path) 55 Plugin(PluginsManager& pluginManager,
54 { 56 const std::string& path);
55 }
56 57
57 SharedLibrary& GetLibrary() 58 SharedLibrary& GetSharedLibrary()
58 { 59 {
59 return library_; 60 return library_;
60 } 61 }
61 62
62 void SetVersion(const std::string& version) 63 void SetVersion(const std::string& version)
66 67
67 const std::string& GetVersion() const 68 const std::string& GetVersion() const
68 { 69 {
69 return version_; 70 return version_;
70 } 71 }
72
73 PluginsManager& GetPluginManager()
74 {
75 return pluginManager_;
76 }
77
78 OrthancPluginContext& GetContext()
79 {
80 return context_;
81 }
71 }; 82 };
72 83
73 typedef std::map<std::string, Plugin*> Plugins; 84 typedef std::map<std::string, Plugin*> Plugins;
74 85
75 OrthancPluginContext context_;
76 Plugins plugins_; 86 Plugins plugins_;
77 std::list<IPluginServiceProvider*> serviceProviders_; 87 std::list<IPluginServiceProvider*> serviceProviders_;
78 88
79 static OrthancPluginErrorCode InvokeService(OrthancPluginContext* context, 89 static OrthancPluginErrorCode InvokeService(OrthancPluginContext* context,
80 _OrthancPluginService service, 90 _OrthancPluginService service,