Mercurial > hg > orthanc-stone
annotate Platforms/Generic/WebServiceCommandBase.h @ 277:a38465cc909f am-2
Qt: refresh ok + mouse interaction ok
author | am@osimis.io |
---|---|
date | Mon, 27 Aug 2018 14:41:49 +0200 |
parents | dc1beee33134 |
children | 87376a645ee1 |
rev | line source |
---|---|
251 | 1 /** |
2 * Stone of Orthanc | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
5 * Copyright (C) 2017-2018 Osimis S.A., Belgium | |
6 * | |
7 * This program is free software: you can redistribute it and/or | |
8 * modify it under the terms of the GNU Affero General Public License | |
9 * as published by the Free Software Foundation, either version 3 of | |
10 * the License, or (at your option) any later version. | |
11 * | |
12 * This program is distributed in the hope that it will be useful, but | |
13 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 * Affero General Public License for more details. | |
16 * | |
17 * You should have received a copy of the GNU Affero General Public License | |
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
19 **/ | |
20 | |
21 | |
22 #pragma once | |
23 | |
24 #include "IOracleCommand.h" | |
25 | |
26 #include "../../Framework/Toolbox/IWebService.h" | |
27 #include "../../Framework/Messages/IObservable.h" | |
274
dc1beee33134
split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
271
diff
changeset
|
28 #include "../../Applications/Generic/BasicNativeApplicationContext.h" |
251 | 29 |
30 #include <Core/WebServiceParameters.h> | |
31 | |
32 #include <memory> | |
33 | |
34 namespace OrthancStone | |
35 { | |
36 class WebServiceCommandBase : public IOracleCommand, IObservable | |
37 { | |
38 protected: | |
39 IWebService::ICallback& callback_; | |
40 Orthanc::WebServiceParameters parameters_; | |
41 std::string uri_; | |
257 | 42 std::map<std::string, std::string> headers_; |
251 | 43 std::auto_ptr<Orthanc::IDynamicObject> payload_; |
44 bool success_; | |
45 std::string answer_; | |
274
dc1beee33134
split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
271
diff
changeset
|
46 BasicNativeApplicationContext& context_; |
251 | 47 |
48 public: | |
49 WebServiceCommandBase(MessageBroker& broker, | |
271
46c5296d867e
OracleWebService and BasicSdlApplicationContext using the same global mutex
am@osimis.io
parents:
257
diff
changeset
|
50 IWebService::ICallback& callback, |
46c5296d867e
OracleWebService and BasicSdlApplicationContext using the same global mutex
am@osimis.io
parents:
257
diff
changeset
|
51 const Orthanc::WebServiceParameters& parameters, |
46c5296d867e
OracleWebService and BasicSdlApplicationContext using the same global mutex
am@osimis.io
parents:
257
diff
changeset
|
52 const std::string& uri, |
46c5296d867e
OracleWebService and BasicSdlApplicationContext using the same global mutex
am@osimis.io
parents:
257
diff
changeset
|
53 const std::map<std::string, std::string>& headers, |
46c5296d867e
OracleWebService and BasicSdlApplicationContext using the same global mutex
am@osimis.io
parents:
257
diff
changeset
|
54 Orthanc::IDynamicObject* payload /* takes ownership */, |
274
dc1beee33134
split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
271
diff
changeset
|
55 BasicNativeApplicationContext& context); |
251 | 56 |
57 virtual void Execute() = 0; | |
58 | |
59 virtual void Commit(); | |
60 }; | |
61 } |