comparison Core/MultiThreading/RunnableWorkersPool.cpp @ 3712:2a170a8f1faf

replacing std::auto_ptr by std::unique_ptr
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 02 Mar 2020 15:32:45 +0100
parents 94f4a18a79cc
children
comparison
equal deleted inserted replaced
3709:1f4910999fe7 3712:2a170a8f1faf
33 33
34 #include "../PrecompiledHeaders.h" 34 #include "../PrecompiledHeaders.h"
35 #include "RunnableWorkersPool.h" 35 #include "RunnableWorkersPool.h"
36 36
37 #include "SharedMessageQueue.h" 37 #include "SharedMessageQueue.h"
38 #include "../Compatibility.h"
38 #include "../OrthancException.h" 39 #include "../OrthancException.h"
39 #include "../Logging.h" 40 #include "../Logging.h"
40 41
41 namespace Orthanc 42 namespace Orthanc
42 { 43 {
53 { 54 {
54 while (that->continue_) 55 while (that->continue_)
55 { 56 {
56 try 57 try
57 { 58 {
58 std::auto_ptr<IDynamicObject> obj(that->queue_.Dequeue(100)); 59 std::unique_ptr<IDynamicObject> obj(that->queue_.Dequeue(100));
59 if (obj.get() != NULL) 60 if (obj.get() != NULL)
60 { 61 {
61 IRunnableBySteps& runnable = *dynamic_cast<IRunnableBySteps*>(obj.get()); 62 IRunnableBySteps& runnable = *dynamic_cast<IRunnableBySteps*>(obj.get());
62 63
63 bool wishToContinue = runnable.Step(); 64 bool wishToContinue = runnable.Step();