# HG changeset patch # User Sebastien Jodogne # Date 1584453743 -3600 # Node ID 6110a4995ace12fb34a598bdbcc9ba93b9532289 # Parent c6658187e4b1f66152f60122b64c2b0744f32b65 replacing std::auto_ptr by std::unique_ptr in GDCM sample plugin diff -r c6658187e4b1 -r 6110a4995ace Plugins/Samples/GdcmDecoder/GdcmDecoderCache.cpp --- a/Plugins/Samples/GdcmDecoder/GdcmDecoderCache.cpp Tue Mar 17 14:46:06 2020 +0100 +++ b/Plugins/Samples/GdcmDecoder/GdcmDecoderCache.cpp Tue Mar 17 15:02:23 2020 +0100 @@ -21,6 +21,7 @@ #include "GdcmDecoderCache.h" +#include "../../../Core/Compatibility.h" #include "OrthancImageWrapper.h" namespace OrthancPlugins @@ -83,13 +84,13 @@ } // This is not the same image - std::auto_ptr decoder(new GdcmImageDecoder(dicom, size)); - std::auto_ptr image(new OrthancImageWrapper(context, decoder->Decode(context, frameIndex))); + std::unique_ptr decoder(new GdcmImageDecoder(dicom, size)); + std::unique_ptr image(new OrthancImageWrapper(context, decoder->Decode(context, frameIndex))); { // Cache the newly created decoder for further use boost::mutex::scoped_lock lock(mutex_); - decoder_ = decoder; + decoder_.reset(decoder.release()); size_ = size; md5_ = md5; } diff -r c6658187e4b1 -r 6110a4995ace Plugins/Samples/GdcmDecoder/GdcmDecoderCache.h --- a/Plugins/Samples/GdcmDecoder/GdcmDecoderCache.h Tue Mar 17 14:46:06 2020 +0100 +++ b/Plugins/Samples/GdcmDecoder/GdcmDecoderCache.h Tue Mar 17 15:02:23 2020 +0100 @@ -21,6 +21,7 @@ #pragma once +#include "../../../Core/Compatibility.h" #include "GdcmImageDecoder.h" #include "OrthancImageWrapper.h" @@ -33,7 +34,7 @@ { private: boost::mutex mutex_; - std::auto_ptr decoder_; + std::unique_ptr decoder_; size_t size_; std::string md5_; diff -r c6658187e4b1 -r 6110a4995ace Plugins/Samples/GdcmDecoder/GdcmImageDecoder.cpp --- a/Plugins/Samples/GdcmDecoder/GdcmImageDecoder.cpp Tue Mar 17 14:46:06 2020 +0100 +++ b/Plugins/Samples/GdcmDecoder/GdcmImageDecoder.cpp Tue Mar 17 15:02:23 2020 +0100 @@ -21,6 +21,7 @@ #include "GdcmImageDecoder.h" +#include "../../../Core/Compatibility.h" #include "OrthancImageWrapper.h" #include @@ -40,9 +41,9 @@ size_t size_; gdcm::ImageReader reader_; - std::auto_ptr lut_; - std::auto_ptr photometric_; - std::auto_ptr interleaved_; + std::unique_ptr lut_; + std::unique_ptr photometric_; + std::unique_ptr interleaved_; std::string decoded_; PImpl(const void* dicom, diff -r c6658187e4b1 -r 6110a4995ace Plugins/Samples/GdcmDecoder/Plugin.cpp --- a/Plugins/Samples/GdcmDecoder/Plugin.cpp Tue Mar 17 14:46:06 2020 +0100 +++ b/Plugins/Samples/GdcmDecoder/Plugin.cpp Tue Mar 17 15:02:23 2020 +0100 @@ -19,6 +19,7 @@ **/ +#include "../../../Core/Compatibility.h" #include "GdcmDecoderCache.h" #include "OrthancImageWrapper.h" @@ -35,7 +36,7 @@ { try { - std::auto_ptr image; + std::unique_ptr image; #if 0 // Do not use the cache diff -r c6658187e4b1 -r 6110a4995ace Plugins/Samples/ModalityWorklists/Plugin.cpp --- a/Plugins/Samples/ModalityWorklists/Plugin.cpp Tue Mar 17 14:46:06 2020 +0100 +++ b/Plugins/Samples/ModalityWorklists/Plugin.cpp Tue Mar 17 15:02:23 2020 +0100 @@ -19,6 +19,7 @@ **/ +#include "../../../Core/Compatibility.h" #include "../Common/OrthancPluginCppWrapper.h" #include @@ -142,7 +143,7 @@ try { // Construct an object to match the worklists in the database against the C-Find query - std::auto_ptr matcher(CreateMatcher(query, issuerAet)); + std::unique_ptr matcher(CreateMatcher(query, issuerAet)); // Loop over the regular files in the database folder namespace fs = boost::filesystem;