Mercurial > hg > orthanc-stone
comparison Applications/StoneApplicationContext.h @ 288:8c8da145fefa am-2
renamings and doc
author | am@osimis.io |
---|---|
date | Thu, 30 Aug 2018 16:52:40 +0200 |
parents | Applications/BasicApplicationContext.h@46c5296d867e |
children | 72355b637945 |
comparison
equal
deleted
inserted
replaced
287:2038d76bf13f | 288:8c8da145fefa |
---|---|
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 "../Framework/Toolbox/IWebService.h" | |
25 #include "../Framework/Viewport/WidgetViewport.h" | |
26 | |
27 #include <list> | |
28 | |
29 namespace OrthancStone | |
30 { | |
31 // a StoneApplicationContext contains the services that a StoneApplication | |
32 // uses and that depends on the environment in which the Application executes. | |
33 // I.e, the StoneApplicationContext provides a WebService interface such that | |
34 // the StoneApplication can perform HTTP requests. In a WASM environment, | |
35 // the WebService is provided by the browser while, in a native environment, | |
36 // the WebService is provided by the OracleWebService (a C++ Http client) | |
37 class StoneApplicationContext : public boost::noncopyable | |
38 { | |
39 | |
40 protected: | |
41 IWebService* webService_; | |
42 public: | |
43 StoneApplicationContext() | |
44 : webService_(NULL) | |
45 { | |
46 } | |
47 | |
48 IWebService& GetWebService() {return *webService_;} | |
49 void SetWebService(IWebService& webService) | |
50 { | |
51 webService_ = &webService; | |
52 } | |
53 | |
54 virtual ~StoneApplicationContext() {} | |
55 }; | |
56 } |