diff Applications/BasicApplicationContext.cpp @ 81:8677d95753f8 wasm

switching to Oracle in SDL samples
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 24 May 2017 22:54:09 +0200
parents 1553b67b24e5
children 02c3a7a4938f
line wrap: on
line diff
--- a/Applications/BasicApplicationContext.cpp	Wed May 24 22:33:20 2017 +0200
+++ b/Applications/BasicApplicationContext.cpp	Wed May 24 22:54:09 2017 +0200
@@ -41,8 +41,9 @@
   }
   
 
-  BasicApplicationContext::BasicApplicationContext(OrthancSynchronousWebService& orthanc) :
-    orthanc_(orthanc),
+  BasicApplicationContext::BasicApplicationContext(Orthanc::WebServiceParameters& orthanc) :
+    oracle_(viewportMutex_, 4),  // Use 4 threads to download
+    webService_(oracle_, orthanc),
     stopped_(true),
     updateDelay_(100)   // By default, 100ms between each refresh of the content
   {
@@ -82,7 +83,7 @@
                                                         bool isProgressiveDownload,
                                                         size_t downloadThreadCount)
   {
-    std::auto_ptr<VolumeImage> volume
+    /*std::auto_ptr<VolumeImage> volume
       (new VolumeImage(new OrthancSeriesLoader(GetWebService().GetConnection(), series)));
 
     if (isProgressiveDownload)
@@ -99,19 +100,23 @@
     VolumeImage& result = *volume;
     volumes_.push_back(volume.release());
 
-    return result;
+    return result;*/
+
+    throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented);
   }
 
 
   DicomStructureSet& BasicApplicationContext::AddStructureSet(const std::string& instance)
   {
-    std::auto_ptr<DicomStructureSet> structureSet
+    /*std::auto_ptr<DicomStructureSet> structureSet
       (new DicomStructureSet(GetWebService().GetConnection(), instance));
 
     DicomStructureSet& result = *structureSet;
     structureSets_.push_back(structureSet.release());
 
-    return result;
+    return result;*/
+
+    throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented);
   }
 
 
@@ -130,6 +135,8 @@
 
   void BasicApplicationContext::Start()
   {
+    oracle_.Start();
+
     for (Volumes::iterator it = volumes_.begin(); it != volumes_.end(); ++it)
     {
       assert(*it != NULL);
@@ -160,5 +167,7 @@
       assert(*it != NULL);
       (*it)->Stop();
     }
+
+    oracle_.Stop();
   }
 }