diff Framework/Loaders/SeriesThumbnailsLoader.cpp @ 1299:c38c89684d83 broker

replacing std::auto_ptr by std::unique_ptr
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 02 Mar 2020 17:21:24 +0100
parents 0ca50d275b9a
children 30deba7bc8e2
line wrap: on
line diff
--- a/Framework/Loaders/SeriesThumbnailsLoader.cpp	Sun Feb 23 15:32:24 2020 +0100
+++ b/Framework/Loaders/SeriesThumbnailsLoader.cpp	Mon Mar 02 17:21:24 2020 +0100
@@ -78,7 +78,7 @@
   {
     assert(thumbnail != NULL);
   
-    std::auto_ptr<Thumbnail> protection(thumbnail);
+    std::unique_ptr<Thumbnail> protection(thumbnail);
   
     Thumbnails::iterator found = thumbnails_.find(seriesInstanceUid);
     if (found == thumbnails_.end())
@@ -254,7 +254,7 @@
       arguments["0020000E"] = GetSeriesInstanceUid();
       arguments["includefield"] = "00080016";
 
-      std::auto_ptr<IOracleCommand> command(
+      std::unique_ptr<IOracleCommand> command(
         GetSource().CreateDicomWebCommand(
           "/instances", arguments, headers, new DicomWebSopClassHandler(
             GetLoader(), GetSource(), GetStudyInstanceUid(), GetSeriesInstanceUid())));
@@ -326,7 +326,7 @@
       }
       else
       {
-        std::auto_ptr<GetOrthancImageCommand> command(new GetOrthancImageCommand);
+        std::unique_ptr<GetOrthancImageCommand> command(new GetOrthancImageCommand);
         command->SetUri("/instances/" + instanceId_ + "/preview");
         command->SetHttpHeader("Accept", Orthanc::MIME_JPEG);
         command->AcquirePayload(new ThumbnailInformation(
@@ -375,7 +375,7 @@
 
           const std::string instance = json[INSTANCES][index].asString();
 
-          std::auto_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand);
+          std::unique_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand);
           command->SetUri("/instances/" + instance + "/metadata/SopClassUid");
           command->AcquirePayload(
             new OrthancSopClassHandler(
@@ -389,7 +389,7 @@
     
   void SeriesThumbnailsLoader::Schedule(IOracleCommand* command)
   {
-    std::auto_ptr<ILoadersContext::ILock> lock(context_.Lock());
+    std::unique_ptr<ILoadersContext::ILock> lock(context_.Lock());
     lock->Schedule(GetSharedObserver(), priority_, command);
   }    
 
@@ -412,7 +412,7 @@
   {
     assert(message.GetOrigin().HasPayload());
 
-    std::auto_ptr<Orthanc::ImageAccessor> resized(Orthanc::ImageProcessing::FitSize(message.GetImage(), width_, height_));
+    std::unique_ptr<Orthanc::ImageAccessor> resized(Orthanc::ImageProcessing::FitSize(message.GetImage(), width_, height_));
 
     std::string jpeg;
     Orthanc::JpegWriter writer;
@@ -540,7 +540,7 @@
       // https://github.com/emscripten-core/emscripten/pull/8486
       headers["Accept"] = Orthanc::MIME_JPEG;
 
-      std::auto_ptr<IOracleCommand> command(
+      std::unique_ptr<IOracleCommand> command(
         source.CreateDicomWebCommand(
           uri, arguments, headers, new DicomWebThumbnailHandler(
             shared_from_this(), source, studyInstanceUid, seriesInstanceUid)));
@@ -551,7 +551,7 @@
       // Dummy SOP Instance UID, as we are working at the "series" level
       Orthanc::DicomInstanceHasher hasher(patientId, studyInstanceUid, seriesInstanceUid, "dummy");
 
-      std::auto_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand);
+      std::unique_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand);
       command->SetUri("/series/" + hasher.HashSeries());
       command->AcquirePayload(new SelectOrthancInstanceHandler(
                                 shared_from_this(), source, studyInstanceUid, seriesInstanceUid));