Mercurial > hg > orthanc-stone
diff Framework/Toolbox/OrthancWebService.cpp @ 58:468c48eaa01c wasm
refactoring
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 03 May 2017 17:35:52 +0200 |
parents | d20e25cfcf3a |
children | 288c948199e5 |
line wrap: on
line diff
--- a/Framework/Toolbox/OrthancWebService.cpp Wed May 03 14:45:21 2017 +0200 +++ b/Framework/Toolbox/OrthancWebService.cpp Wed May 03 17:35:52 2017 +0200 @@ -40,7 +40,7 @@ orthanc_.reset(new OrthancPlugins::OrthancHttpConnection(parameters)); } - void OrthancWebService::ScheduleGetRequest(IRequestObserver& observer, + void OrthancWebService::ScheduleGetRequest(ICallback& callback, const std::string& uri, Orthanc::IDynamicObject* payload) { @@ -50,15 +50,15 @@ { std::string answer; orthanc_->RestApiGet(answer, uri); - observer.NotifyAnswer(answer, tmp.release()); + callback.NotifyAnswer(uri, answer, tmp.release()); } catch (Orthanc::OrthancException&) { - observer.NotifyError(tmp.release()); + callback.NotifyError(uri, tmp.release()); } } - void OrthancWebService::SchedulePostRequest(IRequestObserver& observer, + void OrthancWebService::SchedulePostRequest(ICallback& callback, const std::string& uri, const std::string& body, Orthanc::IDynamicObject* payload) @@ -69,11 +69,11 @@ { std::string answer; orthanc_->RestApiPost(answer, uri, body); - observer.NotifyAnswer(answer, tmp.release()); + callback.NotifyAnswer(uri, answer, tmp.release()); } catch (Orthanc::OrthancException&) { - observer.NotifyError(tmp.release()); + callback.NotifyError(uri, tmp.release()); } } }