comparison Platforms/Generic/WebServiceCommandBase.cpp @ 274:dc1beee33134 am-2

split SdlApplication into NativeApplication and SdlApplication
author am@osimis.io
date Fri, 24 Aug 2018 13:52:55 +0200
parents 46c5296d867e
children 87376a645ee1
comparison
equal deleted inserted replaced
273:f21ba2468570 274:dc1beee33134
29 IWebService::ICallback& callback, 29 IWebService::ICallback& callback,
30 const Orthanc::WebServiceParameters& parameters, 30 const Orthanc::WebServiceParameters& parameters,
31 const std::string& uri, 31 const std::string& uri,
32 const IWebService::Headers& headers, 32 const IWebService::Headers& headers,
33 Orthanc::IDynamicObject* payload /* takes ownership */, 33 Orthanc::IDynamicObject* payload /* takes ownership */,
34 BasicSdlApplicationContext& context) : 34 BasicNativeApplicationContext& context) :
35 IObservable(broker), 35 IObservable(broker),
36 callback_(callback), 36 callback_(callback),
37 parameters_(parameters), 37 parameters_(parameters),
38 uri_(uri), 38 uri_(uri),
39 headers_(headers), 39 headers_(headers),
46 } 46 }
47 47
48 48
49 void WebServiceCommandBase::Commit() 49 void WebServiceCommandBase::Commit()
50 { 50 {
51 BasicSdlApplicationContext::GlobalMutexLocker lock(context_); // we want to make sure that, i.e, the UpdateThread is not triggered while we are updating the "model" with the result of a WebServiceCommand 51 BasicNativeApplicationContext::GlobalMutexLocker lock(context_); // we want to make sure that, i.e, the UpdateThread is not triggered while we are updating the "model" with the result of a WebServiceCommand
52 52
53 if (success_) 53 if (success_)
54 { 54 {
55 IWebService::ICallback::HttpRequestSuccessMessage message(uri_, answer_.c_str(), answer_.size(), payload_.release()); 55 IWebService::ICallback::HttpRequestSuccessMessage message(uri_, answer_.c_str(), answer_.size(), payload_.release());
56 EmitMessage(message); 56 EmitMessage(message);