Mercurial > hg > orthanc
comparison OrthancServer/ServerContext.h @ 1434:f9cd40166269
refactoring of OrthancPlugins, improvement in ServeFolders
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 30 Jun 2015 16:04:05 +0200 |
parents | 461e7554bff7 |
children | 0a3e3be59094 |
comparison
equal
deleted
inserted
replaced
1433:461e7554bff7 | 1434:f9cd40166269 |
---|---|
37 #include "../Core/FileStorage/CompressedFileStorageAccessor.h" | 37 #include "../Core/FileStorage/CompressedFileStorageAccessor.h" |
38 #include "../Core/FileStorage/IStorageArea.h" | 38 #include "../Core/FileStorage/IStorageArea.h" |
39 #include "../Core/Lua/LuaContext.h" | 39 #include "../Core/Lua/LuaContext.h" |
40 #include "../Core/RestApi/RestApiOutput.h" | 40 #include "../Core/RestApi/RestApiOutput.h" |
41 #include "../Plugins/Engine/OrthancPlugins.h" | 41 #include "../Plugins/Engine/OrthancPlugins.h" |
42 #include "../Plugins/Engine/PluginsManager.h" | |
43 #include "DicomInstanceToStore.h" | 42 #include "DicomInstanceToStore.h" |
44 #include "DicomProtocol/ReusableDicomUserConnection.h" | 43 #include "DicomProtocol/ReusableDicomUserConnection.h" |
45 #include "IServerListener.h" | 44 #include "IServerListener.h" |
46 #include "LuaScripting.h" | 45 #include "LuaScripting.h" |
47 #include "ParsedDicomFile.h" | 46 #include "ParsedDicomFile.h" |
112 ServerScheduler scheduler_; | 111 ServerScheduler scheduler_; |
113 | 112 |
114 LuaScripting lua_; | 113 LuaScripting lua_; |
115 OrthancPlugins* plugins_; | 114 OrthancPlugins* plugins_; |
116 ServerListeners listeners_; | 115 ServerListeners listeners_; |
117 const PluginsManager* pluginsManager_; | |
118 | 116 |
119 SharedArchive queryRetrieveArchive_; | 117 SharedArchive queryRetrieveArchive_; |
120 std::string defaultLocalAet_; | 118 std::string defaultLocalAet_; |
121 | 119 |
122 public: | 120 public: |
197 ServerScheduler& GetScheduler() | 195 ServerScheduler& GetScheduler() |
198 { | 196 { |
199 return scheduler_; | 197 return scheduler_; |
200 } | 198 } |
201 | 199 |
202 void SetOrthancPlugins(const PluginsManager& manager, | |
203 OrthancPlugins& plugins) | |
204 { | |
205 pluginsManager_ = &manager; | |
206 plugins_ = &plugins; | |
207 listeners_.clear(); | |
208 listeners_.push_back(ServerListener(lua_, "Lua")); // TODO REFACTOR THIS | |
209 listeners_.push_back(ServerListener(plugins, "plugin")); // TODO REFACTOR THIS | |
210 } | |
211 | |
212 void ResetOrthancPlugins() | |
213 { | |
214 pluginsManager_ = NULL; | |
215 plugins_ = NULL; | |
216 listeners_.clear(); | |
217 listeners_.push_back(ServerListener(lua_, "Lua")); // TODO REFACTOR THIS | |
218 } | |
219 | |
220 bool DeleteResource(Json::Value& target, | 200 bool DeleteResource(Json::Value& target, |
221 const std::string& uuid, | 201 const std::string& uuid, |
222 ResourceType expectedType); | 202 ResourceType expectedType); |
223 | 203 |
224 void SignalChange(const ServerIndexChange& change); | 204 void SignalChange(const ServerIndexChange& change); |
225 | 205 |
206 SharedArchive& GetQueryRetrieveArchive() | |
207 { | |
208 return queryRetrieveArchive_; | |
209 } | |
210 | |
211 const std::string& GetDefaultLocalApplicationEntityTitle() const | |
212 { | |
213 return defaultLocalAet_; | |
214 } | |
215 | |
216 LuaScripting& GetLua() | |
217 { | |
218 return lua_; | |
219 } | |
220 | |
221 | |
222 /** | |
223 * Management of the plugins | |
224 **/ | |
225 | |
226 void SetPlugins(OrthancPlugins& plugins); | |
227 | |
228 void ResetPlugins(); | |
229 | |
226 bool HasPlugins() const; | 230 bool HasPlugins() const; |
227 | 231 |
228 const PluginsManager& GetPluginsManager() const; | 232 const OrthancPlugins& GetPlugins() const; |
229 | 233 |
230 const OrthancPlugins& GetOrthancPlugins() const; | |
231 | |
232 SharedArchive& GetQueryRetrieveArchive() | |
233 { | |
234 return queryRetrieveArchive_; | |
235 } | |
236 | |
237 const std::string& GetDefaultLocalApplicationEntityTitle() const | |
238 { | |
239 return defaultLocalAet_; | |
240 } | |
241 | |
242 LuaScripting& GetLua() | |
243 { | |
244 return lua_; | |
245 } | |
246 }; | 234 }; |
247 } | 235 } |