comparison Platforms/Generic/DelayedCallCommand.cpp @ 726:4f2416d519b4

moving layers, widgets and loaders to Deprecated namespace
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 21 May 2019 11:43:25 +0200
parents 2a8ac2d426db
children e713f1a99861 1c7ae79c426d
comparison
equal deleted inserted replaced
714:d2c0e347ddc2 726:4f2416d519b4
22 #include "DelayedCallCommand.h" 22 #include "DelayedCallCommand.h"
23 #include "boost/thread/thread.hpp" 23 #include "boost/thread/thread.hpp"
24 24
25 #include <iostream> 25 #include <iostream>
26 26
27 namespace OrthancStone 27 namespace Deprecated
28 { 28 {
29 DelayedCallCommand::DelayedCallCommand(MessageBroker& broker, 29 DelayedCallCommand::DelayedCallCommand(OrthancStone::MessageBroker& broker,
30 MessageHandler<IDelayedCallExecutor::TimeoutMessage>* callback, // takes ownership 30 OrthancStone::MessageHandler<IDelayedCallExecutor::TimeoutMessage>* callback, // takes ownership
31 unsigned int timeoutInMs, 31 unsigned int timeoutInMs,
32 Orthanc::IDynamicObject* payload /* takes ownership */, 32 Orthanc::IDynamicObject* payload /* takes ownership */,
33 NativeStoneApplicationContext& context 33 OrthancStone::NativeStoneApplicationContext& context
34 ) : 34 ) :
35 IObservable(broker), 35 IObservable(broker),
36 callback_(callback), 36 callback_(callback),
37 payload_(payload), 37 payload_(payload),
38 context_(context), 38 context_(context),
53 void DelayedCallCommand::Commit() 53 void DelayedCallCommand::Commit()
54 { 54 {
55 // We want to make sure that, i.e, the UpdateThread is not 55 // We want to make sure that, i.e, the UpdateThread is not
56 // triggered while we are updating the "model" with the result of 56 // triggered while we are updating the "model" with the result of
57 // an OracleCommand 57 // an OracleCommand
58 NativeStoneApplicationContext::GlobalMutexLocker lock(context_); 58 OrthancStone::NativeStoneApplicationContext::GlobalMutexLocker lock(context_);
59 59
60 if (callback_.get() != NULL) 60 if (callback_.get() != NULL)
61 { 61 {
62 IDelayedCallExecutor::TimeoutMessage message; // TODO: add payload 62 IDelayedCallExecutor::TimeoutMessage message; // TODO: add payload
63 callback_->Apply(message); 63 callback_->Apply(message);