comparison Framework/Toolbox/OrthancWebService.h @ 57:d20e25cfcf3a wasm

IWebService
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 03 May 2017 14:45:21 +0200
parents
children 468c48eaa01c
comparison
equal deleted inserted replaced
56:9e3c2e75b870 57:d20e25cfcf3a
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 Osimis, 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 "IWebService.h"
25 #include "../../Resources/Orthanc/Plugins/Samples/Common/IOrthancConnection.h"
26 #include "../../Resources/Orthanc/Core/WebServiceParameters.h"
27
28 #include <memory>
29
30 namespace OrthancStone
31 {
32 class OrthancWebService : public IWebService
33 {
34 private:
35 std::auto_ptr<OrthancPlugins::IOrthancConnection> orthanc_;
36
37 public:
38 OrthancWebService(OrthancPlugins::IOrthancConnection* orthanc); // Takes ownership
39
40 OrthancWebService(const Orthanc::WebServiceParameters& parameters);
41
42 OrthancPlugins::IOrthancConnection& GetConnection()
43 {
44 return *orthanc_;
45 }
46
47 virtual void ScheduleGetRequest(IRequestObserver& observer,
48 const std::string& uri,
49 Orthanc::IDynamicObject* payload);
50
51 virtual void SchedulePostRequest(IRequestObserver& observer,
52 const std::string& uri,
53 const std::string& body,
54 Orthanc::IDynamicObject* payload);
55 };
56 }