diff Framework/Loaders/OracleScheduler.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 474360793956
line wrap: on
line diff
--- a/Framework/Loaders/OracleScheduler.cpp	Sun Feb 23 15:32:24 2020 +0100
+++ b/Framework/Loaders/OracleScheduler.cpp	Mon Mar 02 17:21:24 2020 +0100
@@ -30,7 +30,7 @@
   private:
     Priority   priority_;
     boost::weak_ptr<IObserver>  receiver_;
-    std::auto_ptr<IOracleCommand>  command_;
+    std::unique_ptr<IOracleCommand>  command_;
 
   public:
     ReceiverPayload(Priority priority,
@@ -68,7 +68,7 @@
   {
   private:
     boost::weak_ptr<IObserver>     receiver_;
-    std::auto_ptr<IOracleCommand>  command_;
+    std::unique_ptr<IOracleCommand>  command_;
 
   public:
     ScheduledCommand(boost::shared_ptr<IObserver> receiver,
@@ -103,7 +103,7 @@
       }
       else
       {
-        std::auto_ptr<IOracleCommand> wrapped(command_->Clone());
+        std::unique_ptr<IOracleCommand> wrapped(command_->Clone());
         dynamic_cast<OracleCommandBase&>(*wrapped).AcquirePayload(new ReceiverPayload(priority, receiver_, command_.release()));
         return wrapped.release();
       }
@@ -198,7 +198,7 @@
     Queue::iterator item = queue.begin();
     assert(item != queue.end());
 
-    std::auto_ptr<ScheduledCommand> command(dynamic_cast<ScheduledCommand*>(item->second));
+    std::unique_ptr<ScheduledCommand> command(dynamic_cast<ScheduledCommand*>(item->second));
     queue.erase(item);
 
     if (command.get() != NULL)
@@ -522,7 +522,7 @@
                                  int priority,
                                  IOracleCommand* command /* Takes ownership */)
   {
-    std::auto_ptr<ScheduledCommand> pending(new ScheduledCommand(receiver, dynamic_cast<IOracleCommand*>(command)));
+    std::unique_ptr<ScheduledCommand> pending(new ScheduledCommand(receiver, dynamic_cast<IOracleCommand*>(command)));
 
     /**
      * Safeguard to remember that a new "Handle()" method and a call