diff 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
line wrap: on
line diff
--- a/OrthancServer/ServerContext.h	Wed Dec 12 15:40:18 2012 +0100
+++ b/OrthancServer/ServerContext.h	Wed Dec 12 17:53:14 2012 +0100
@@ -32,10 +32,12 @@
 
 #pragma once
 
-#include "ServerIndex.h"
+#include "../Core/Cache/MemoryCache.h"
 #include "../Core/FileStorage/CompressedFileStorageAccessor.h"
 #include "../Core/FileStorage/FileStorage.h"
 #include "../Core/RestApi/RestApiOutput.h"
+#include "ServerIndex.h"
+#include "FromDcmtkBridge.h"
 
 namespace Orthanc
 {
@@ -47,10 +49,26 @@
   class ServerContext
   {
   private:
+    class DicomCacheProvider : public ICachePageProvider
+    {
+    private:
+      ServerContext& context_;
+
+    public:
+      DicomCacheProvider(ServerContext& context) : context_(context)
+      {
+      }
+      
+      virtual IDynamicObject* Provide(const std::string& id);
+    };
+
     FileStorage storage_;
     ServerIndex index_;
     CompressedFileStorageAccessor accessor_;
     bool compressionEnabled_;
+    
+    DicomCacheProvider provider_;
+    MemoryCache dicomCache_;
 
   public:
     ServerContext(const boost::filesystem::path& path);
@@ -86,5 +104,8 @@
     void ReadFile(std::string& result,
                   const std::string& instancePublicId,
                   FileContentType content);
+
+    // TODO IMPLEMENT MULTITHREADING FOR THIS METHOD
+    ParsedDicomFile& GetDicomFile(const std::string& instancePublicId);
   };
 }