diff Platforms/Generic/WebServicePostCommand.cpp @ 251:192e6e349e69 am-2

first usage of new message system (in SDL only)
author am@osimis.io
date Mon, 02 Jul 2018 18:13:46 +0200
parents 5412adf19980
children 9afafb192180
line wrap: on
line diff
--- a/Platforms/Generic/WebServicePostCommand.cpp	Mon Jul 02 16:36:17 2018 +0200
+++ b/Platforms/Generic/WebServicePostCommand.cpp	Mon Jul 02 18:13:46 2018 +0200
@@ -25,16 +25,14 @@
 
 namespace OrthancStone
 {
-  WebServicePostCommand::WebServicePostCommand(IWebService::ICallback& callback,
+  WebServicePostCommand::WebServicePostCommand(MessageBroker& broker,
+                                               IWebService::ICallback& callback,
                                                const Orthanc::WebServiceParameters& parameters,
                                                const std::string& uri,
                                                const std::string& body,
                                                Orthanc::IDynamicObject* payload /* takes ownership */) :
-    callback_(callback),
-    parameters_(parameters),
-    uri_(uri),
-    body_(body),
-    payload_(payload)
+    WebServiceCommandBase(broker, callback, parameters, uri, payload),
+    body_(body)
   {
   }
 
@@ -47,15 +45,4 @@
     success_ = client.Apply(answer_);
   }
 
-  void WebServicePostCommand::Commit()
-  {
-    if (success_)
-    {
-      callback_.NotifySuccess(uri_, answer_.c_str(), answer_.size(), payload_.release());
-    }
-    else
-    {
-      callback_.NotifyError(uri_, payload_.release());
-    }
-  }
 }