comparison OrthancServer/ServerContext.h @ 1066:bb82e5e818e9

OnStoredInstance callback in plugins
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 25 Jul 2014 18:39:02 +0200
parents 84b6d7bca6db
children 6c5a77637b23
comparison
equal deleted inserted replaced
1065:921532f67770 1066:bb82e5e818e9
43 #include "Scheduler/ServerScheduler.h" 43 #include "Scheduler/ServerScheduler.h"
44 #include "DicomInstanceToStore.h" 44 #include "DicomInstanceToStore.h"
45 45
46 namespace Orthanc 46 namespace Orthanc
47 { 47 {
48 class PluginsHttpHandler;
49
48 /** 50 /**
49 * This class is responsible for maintaining the storage area on the 51 * This class is responsible for maintaining the storage area on the
50 * filesystem (including compression), as well as the index of the 52 * filesystem (including compression), as well as the index of the
51 * DICOM store. It implements the required locking mechanisms. 53 * DICOM store. It implements the required locking mechanisms.
52 **/ 54 **/
67 }; 69 };
68 70
69 bool ApplyReceivedInstanceFilter(const Json::Value& simplified, 71 bool ApplyReceivedInstanceFilter(const Json::Value& simplified,
70 const std::string& remoteAet); 72 const std::string& remoteAet);
71 73
72 void ApplyOnStoredInstance(const std::string& instanceId, 74 void ApplyLuaOnStoredInstance(const std::string& instanceId,
73 const Json::Value& simplifiedDicom, 75 const Json::Value& simplifiedDicom,
74 const Json::Value& metadata); 76 const Json::Value& metadata);
75 77
76 FileStorage storage_; 78 FileStorage storage_;
77 ServerIndex index_; 79 ServerIndex index_;
78 CompressedFileStorageAccessor accessor_; 80 CompressedFileStorageAccessor accessor_;
79 bool compressionEnabled_; 81 bool compressionEnabled_;
84 ReusableDicomUserConnection scu_; 86 ReusableDicomUserConnection scu_;
85 ServerScheduler scheduler_; 87 ServerScheduler scheduler_;
86 88
87 boost::mutex luaMutex_; 89 boost::mutex luaMutex_;
88 LuaContext lua_; 90 LuaContext lua_;
91 PluginsHttpHandler* plugins_; // TODO Turn it into a listener pattern (idem for Lua callbacks)
89 92
90 public: 93 public:
91 class DicomCacheLocker : public boost::noncopyable 94 class DicomCacheLocker : public boost::noncopyable
92 { 95 {
93 private: 96 private:
181 184
182 ServerScheduler& GetScheduler() 185 ServerScheduler& GetScheduler()
183 { 186 {
184 return scheduler_; 187 return scheduler_;
185 } 188 }
189
190 void SetPluginsHttpHandler(PluginsHttpHandler& plugin)
191 {
192 plugins_ = &plugin;
193 }
186 }; 194 };
187 } 195 }