Mercurial > hg > orthanc-stone
diff Framework/Oracle/ThreadedOracle.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 | 7ec8fea061b9 |
children | 257f2c9a02ac |
line wrap: on
line diff
--- a/Framework/Oracle/ThreadedOracle.cpp Sun Feb 23 15:32:24 2020 +0100 +++ b/Framework/Oracle/ThreadedOracle.cpp Mon Mar 02 17:21:24 2020 +0100 @@ -32,7 +32,7 @@ { private: boost::weak_ptr<IObserver> receiver_; - std::auto_ptr<IOracleCommand> command_; + std::unique_ptr<IOracleCommand> command_; public: Item(boost::weak_ptr<IObserver> receiver, @@ -66,7 +66,7 @@ { private: boost::weak_ptr<IObserver> receiver_; - std::auto_ptr<SleepOracleCommand> command_; + std::unique_ptr<SleepOracleCommand> command_; boost::posix_time::ptime expiration_; public: @@ -154,7 +154,7 @@ void ThreadedOracle::Step() { - std::auto_ptr<Orthanc::IDynamicObject> object(queue_.Dequeue(100)); + std::unique_ptr<Orthanc::IDynamicObject> object(queue_.Dequeue(100)); if (object.get() != NULL) { @@ -164,7 +164,7 @@ { SleepOracleCommand& command = dynamic_cast<SleepOracleCommand&>(item.GetCommand()); - std::auto_ptr<SleepOracleCommand> copy(new SleepOracleCommand(command.GetDelay())); + std::unique_ptr<SleepOracleCommand> copy(new SleepOracleCommand(command.GetDelay())); if (command.HasPayload()) { @@ -412,7 +412,7 @@ bool ThreadedOracle::Schedule(boost::shared_ptr<IObserver> receiver, IOracleCommand* command) { - std::auto_ptr<Item> item(new Item(receiver, command)); + std::unique_ptr<Item> item(new Item(receiver, command)); { boost::mutex::scoped_lock lock(mutex_);