comparison OrthancServer/ServerContext.h @ 285:4031f73fe0e4

access to the raw dicom tags
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 12 Dec 2012 17:53:14 +0100
parents 6d9be2b470b4
children 4eea080e6e7a
comparison
equal deleted inserted replaced
284:06aa7b7b6723 285:4031f73fe0e4
30 **/ 30 **/
31 31
32 32
33 #pragma once 33 #pragma once
34 34
35 #include "ServerIndex.h" 35 #include "../Core/Cache/MemoryCache.h"
36 #include "../Core/FileStorage/CompressedFileStorageAccessor.h" 36 #include "../Core/FileStorage/CompressedFileStorageAccessor.h"
37 #include "../Core/FileStorage/FileStorage.h" 37 #include "../Core/FileStorage/FileStorage.h"
38 #include "../Core/RestApi/RestApiOutput.h" 38 #include "../Core/RestApi/RestApiOutput.h"
39 #include "ServerIndex.h"
40 #include "FromDcmtkBridge.h"
39 41
40 namespace Orthanc 42 namespace Orthanc
41 { 43 {
42 /** 44 /**
43 * This class is responsible for maintaining the storage area on the 45 * This class is responsible for maintaining the storage area on the
45 * DICOM store. It implements the required locking mechanisms. 47 * DICOM store. It implements the required locking mechanisms.
46 **/ 48 **/
47 class ServerContext 49 class ServerContext
48 { 50 {
49 private: 51 private:
52 class DicomCacheProvider : public ICachePageProvider
53 {
54 private:
55 ServerContext& context_;
56
57 public:
58 DicomCacheProvider(ServerContext& context) : context_(context)
59 {
60 }
61
62 virtual IDynamicObject* Provide(const std::string& id);
63 };
64
50 FileStorage storage_; 65 FileStorage storage_;
51 ServerIndex index_; 66 ServerIndex index_;
52 CompressedFileStorageAccessor accessor_; 67 CompressedFileStorageAccessor accessor_;
53 bool compressionEnabled_; 68 bool compressionEnabled_;
69
70 DicomCacheProvider provider_;
71 MemoryCache dicomCache_;
54 72
55 public: 73 public:
56 ServerContext(const boost::filesystem::path& path); 74 ServerContext(const boost::filesystem::path& path);
57 75
58 ServerIndex& GetIndex() 76 ServerIndex& GetIndex()
84 102
85 // TODO CACHING MECHANISM AT THIS POINT 103 // TODO CACHING MECHANISM AT THIS POINT
86 void ReadFile(std::string& result, 104 void ReadFile(std::string& result,
87 const std::string& instancePublicId, 105 const std::string& instancePublicId,
88 FileContentType content); 106 FileContentType content);
107
108 // TODO IMPLEMENT MULTITHREADING FOR THIS METHOD
109 ParsedDicomFile& GetDicomFile(const std::string& instancePublicId);
89 }; 110 };
90 } 111 }