comparison OrthancServer/ServerContext.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 5bd4c9f85b4c
children 32fcc5dc7562
comparison
equal deleted inserted replaced
1231:703fcd797186 1232:f1c01451a8ee
47 #include <boost/filesystem.hpp> 47 #include <boost/filesystem.hpp>
48 48
49 namespace Orthanc 49 namespace Orthanc
50 { 50 {
51 class OrthancPlugins; 51 class OrthancPlugins;
52 class PluginsManager;
52 53
53 /** 54 /**
54 * This class is responsible for maintaining the storage area on the 55 * This class is responsible for maintaining the storage area on the
55 * filesystem (including compression), as well as the index of the 56 * filesystem (including compression), as well as the index of the
56 * DICOM store. It implements the required locking mechanisms. 57 * DICOM store. It implements the required locking mechanisms.
89 ServerScheduler scheduler_; 90 ServerScheduler scheduler_;
90 91
91 boost::mutex luaMutex_; 92 boost::mutex luaMutex_;
92 LuaContext lua_; 93 LuaContext lua_;
93 OrthancPlugins* plugins_; // TODO Turn it into a listener pattern (idem for Lua callbacks) 94 OrthancPlugins* plugins_; // TODO Turn it into a listener pattern (idem for Lua callbacks)
95 const PluginsManager* pluginsManager_;
94 96
95 public: 97 public:
96 class DicomCacheLocker : public boost::noncopyable 98 class DicomCacheLocker : public boost::noncopyable
97 { 99 {
98 private: 100 private:
193 ServerScheduler& GetScheduler() 195 ServerScheduler& GetScheduler()
194 { 196 {
195 return scheduler_; 197 return scheduler_;
196 } 198 }
197 199
198 void SetOrthancPlugins(OrthancPlugins& plugins) 200 void SetOrthancPlugins(const PluginsManager& manager,
199 { 201 OrthancPlugins& plugins)
202 {
203 pluginsManager_ = &manager;
200 plugins_ = &plugins; 204 plugins_ = &plugins;
201 } 205 }
202 206
203 void ResetOrthancPlugins() 207 void ResetOrthancPlugins()
204 { 208 {
209 pluginsManager_ = NULL;
205 plugins_ = NULL; 210 plugins_ = NULL;
206 } 211 }
207 212
208 bool DeleteResource(Json::Value& target, 213 bool DeleteResource(Json::Value& target,
209 const std::string& uuid, 214 const std::string& uuid,
210 ResourceType expectedType); 215 ResourceType expectedType);
211 216
212 void SignalChange(const ServerIndexChange& change); 217 void SignalChange(const ServerIndexChange& change);
218
219 bool HasPlugins() const;
220
221 const PluginsManager& GetPluginsManager() const;
222
223 const OrthancPlugins& GetOrthancPlugins() const;
213 }; 224 };
214 } 225 }