changeset 3749:edabdf07ee83

replacing deprecated std::auto_ptr by boost::movelib in C++ plugin wrapper
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 16 Mar 2020 11:13:30 +0100
parents 113a7b994a12
children 0ba17d2bcdc9
files Plugins/Samples/Common/OrthancPluginCppWrapper.cpp
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp	Thu Mar 12 21:48:35 2020 +0100
+++ b/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp	Mon Mar 16 11:13:30 2020 +0100
@@ -33,8 +33,9 @@
 
 #include "OrthancPluginCppWrapper.h"
 
+#include <boost/algorithm/string/predicate.hpp>
+#include <boost/move/unique_ptr.hpp>
 #include <boost/thread.hpp>
-#include <boost/algorithm/string/predicate.hpp>
 #include <json/reader.h>
 #include <json/writer.h>
 
@@ -2168,7 +2169,7 @@
     static const char* KEY_ASYNCHRONOUS = "Asynchronous";
     static const char* KEY_PRIORITY = "Priority";
 
-    std::auto_ptr<OrthancJob> protection(job);
+    boost::movelib::unique_ptr<OrthancJob> protection(job);
   
     if (body.type() != Json::objectValue)
     {
@@ -3059,7 +3060,7 @@
             }
             else
             {
-              std::auto_ptr<IChunkedRequestReader> reader(PostHandler(url, request));
+              boost::movelib::unique_ptr<IChunkedRequestReader> reader(PostHandler(url, request));
               if (reader.get() == NULL)
               {
                 ORTHANC_PLUGINS_THROW_EXCEPTION(Plugin);
@@ -3092,7 +3093,7 @@
             }
             else
             {
-              std::auto_ptr<IChunkedRequestReader> reader(PutHandler(url, request));
+              boost::movelib::unique_ptr<IChunkedRequestReader> reader(PutHandler(url, request));
               if (reader.get() == NULL)
               {
                 ORTHANC_PLUGINS_THROW_EXCEPTION(Plugin);