comparison OrthancServer/Sources/ServerContext.h @ 4792:434843934307 storage-cache

Added a StorageCache in the StorageAccessor
author Alain Mazy <am@osimis.io>
date Thu, 30 Sep 2021 12:14:19 +0200
parents da1edb7d6332
children 7afbb54bd028
comparison
equal deleted inserted replaced
4790:9754d5f2f38a 4792:434843934307
41 41
42 #include "../../OrthancFramework/Sources/DicomFormat/DicomElement.h" 42 #include "../../OrthancFramework/Sources/DicomFormat/DicomElement.h"
43 #include "../../OrthancFramework/Sources/DicomParsing/DicomModification.h" 43 #include "../../OrthancFramework/Sources/DicomParsing/DicomModification.h"
44 #include "../../OrthancFramework/Sources/DicomParsing/IDicomTranscoder.h" 44 #include "../../OrthancFramework/Sources/DicomParsing/IDicomTranscoder.h"
45 #include "../../OrthancFramework/Sources/DicomParsing/ParsedDicomCache.h" 45 #include "../../OrthancFramework/Sources/DicomParsing/ParsedDicomCache.h"
46 #include "../../OrthancFramework/Sources/FileStorage/StorageCache.h"
46 #include "../../OrthancFramework/Sources/MultiThreading/Semaphore.h" 47 #include "../../OrthancFramework/Sources/MultiThreading/Semaphore.h"
47 48
48 49
49 namespace Orthanc 50 namespace Orthanc
50 { 51 {
167 168
168 virtual void SignalJobFailure(const std::string& jobId) ORTHANC_OVERRIDE; 169 virtual void SignalJobFailure(const std::string& jobId) ORTHANC_OVERRIDE;
169 170
170 ServerIndex index_; 171 ServerIndex index_;
171 IStorageArea& area_; 172 IStorageArea& area_;
173 StorageCache storageCache_;
172 174
173 bool compressionEnabled_; 175 bool compressionEnabled_;
174 bool storeMD5_; 176 bool storeMD5_;
175 177
176 Semaphore largeDicomThrottler_; // New in Orthanc 1.9.0 (notably for very large DICOM files in WSI) 178 Semaphore largeDicomThrottler_; // New in Orthanc 1.9.0 (notably for very large DICOM files in WSI)
286 ServerIndex& GetIndex() 288 ServerIndex& GetIndex()
287 { 289 {
288 return index_; 290 return index_;
289 } 291 }
290 292
293 void SetMaximumStorageCacheSize(size_t size)
294 {
295 return storageCache_.SetMaximumSize(size);
296 }
297
291 void SetCompressionEnabled(bool enabled); 298 void SetCompressionEnabled(bool enabled);
292 299
293 bool IsCompressionEnabled() const 300 bool IsCompressionEnabled() const
294 { 301 {
295 return compressionEnabled_; 302 return compressionEnabled_;
323 void ReadDicomAsJson(Json::Value& result, 330 void ReadDicomAsJson(Json::Value& result,
324 const std::string& instancePublicId); 331 const std::string& instancePublicId);
325 332
326 void ReadDicom(std::string& dicom, 333 void ReadDicom(std::string& dicom,
327 const std::string& instancePublicId); 334 const std::string& instancePublicId);
328 335
336 void ReadDicomForHeader(std::string& dicom,
337 const std::string& instancePublicId);
338
329 bool ReadDicomUntilPixelData(std::string& dicom, 339 bool ReadDicomUntilPixelData(std::string& dicom,
330 const std::string& instancePublicId); 340 const std::string& instancePublicId);
331 341
332 // This method is for low-level operations on "/instances/.../attachments/..." 342 // This method is for low-level operations on "/instances/.../attachments/..."
333 void ReadAttachment(std::string& result, 343 void ReadAttachment(std::string& result,