diff Framework/OrthancInstancesCache.cpp @ 8:4c3437217518

fix for compatibility with simplified OrthancPluginCppWrapper
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 05 Dec 2018 09:16:51 +0100
parents 95226b754d9e
children 7e207ade2f1a
line wrap: on
line diff
--- a/Framework/OrthancInstancesCache.cpp	Fri Sep 21 12:52:23 2018 +0200
+++ b/Framework/OrthancInstancesCache.cpp	Wed Dec 05 09:16:51 2018 +0100
@@ -153,15 +153,10 @@
   }
     
 
-  OrthancInstancesCache::OrthancInstancesCache(OrthancPluginContext* context) :
-    context_(context),
+  OrthancInstancesCache::OrthancInstancesCache() :
     memorySize_(0),
     maxMemorySize_(512 * MB)  // 512 MB by default
   {
-    if (context == NULL)
-    {
-      throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer);
-    }
   }
     
 
@@ -227,7 +222,7 @@
     }
       
     // The instance was not in the cache, load it
-    std::auto_ptr<SourceDicomInstance> instance(new SourceDicomInstance(context_, instanceId));
+    std::auto_ptr<SourceDicomInstance> instance(new SourceDicomInstance(instanceId));
     size = instance->GetInfo().GetSize();
     md5 = instance->GetInfo().GetMD5();
 
@@ -256,7 +251,7 @@
     }
       
     // The instance was not in the cache, load it
-    std::auto_ptr<SourceDicomInstance> instance(new SourceDicomInstance(context_, instanceId));
+    std::auto_ptr<SourceDicomInstance> instance(new SourceDicomInstance(instanceId));
     instance->GetChunk(chunk, md5, 0, instance->GetInfo().GetSize());
 
     // Store the just-loaded DICOM instance into the cache