Mercurial > hg > orthanc-stone
diff Platforms/Generic/WebServiceCommandBase.h @ 300:b4abaeb783b1 am-callable-and-promise
messaging refactoring almost complete: works fine in native
author | am@osimis.io |
---|---|
date | Tue, 18 Sep 2018 15:23:21 +0200 |
parents | 3897f9f28cfa |
children | 547e1cf7aa7b |
line wrap: on
line diff
--- a/Platforms/Generic/WebServiceCommandBase.h Fri Sep 14 16:44:01 2018 +0200 +++ b/Platforms/Generic/WebServiceCommandBase.h Tue Sep 18 15:23:21 2018 +0200 @@ -37,32 +37,6 @@ class WebServiceCommandBase : public IOracleCommand, IObservable { protected: - IWebService::ICallback& callback_; - Orthanc::WebServiceParameters parameters_; - std::string uri_; - std::map<std::string, std::string> headers_; - std::auto_ptr<Orthanc::IDynamicObject> payload_; - bool success_; - std::string answer_; - NativeStoneApplicationContext& context_; - - public: - WebServiceCommandBase(MessageBroker& broker, - IWebService::ICallback& callback, - const Orthanc::WebServiceParameters& parameters, - const std::string& uri, - const std::map<std::string, std::string>& headers, - Orthanc::IDynamicObject* payload /* takes ownership */, - NativeStoneApplicationContext& context); - - virtual void Execute() = 0; - - virtual void Commit(); - }; - - class NewWebServiceCommandBase : public IOracleCommand, IObservable - { - protected: std::auto_ptr<MessageHandler<IWebService::NewHttpRequestSuccessMessage>> successCallback_; std::auto_ptr<MessageHandler<IWebService::NewHttpRequestErrorMessage>> failureCallback_; Orthanc::WebServiceParameters parameters_; @@ -74,7 +48,7 @@ NativeStoneApplicationContext& context_; public: - NewWebServiceCommandBase(MessageBroker& broker, + WebServiceCommandBase(MessageBroker& broker, MessageHandler<IWebService::NewHttpRequestSuccessMessage>* successCallback, // takes ownership MessageHandler<IWebService::NewHttpRequestErrorMessage>* failureCallback, // takes ownership const Orthanc::WebServiceParameters& parameters,