comparison Applications/StoneApplicationContext.h @ 417:aee3d7941c9b

preparing to load images using DICOMweb
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 15 Nov 2018 17:28:15 +0100
parents 72355b637945
children c23df8b3433b
comparison
equal deleted inserted replaced
415:c0589c3173fd 417:aee3d7941c9b
20 20
21 21
22 #pragma once 22 #pragma once
23 23
24 #include "../Framework/Toolbox/IWebService.h" 24 #include "../Framework/Toolbox/IWebService.h"
25 #include "../Framework/Toolbox/OrthancApiClient.h"
25 #include "../Framework/Viewport/WidgetViewport.h" 26 #include "../Framework/Viewport/WidgetViewport.h"
26 27
27 #include <list> 28 #include <list>
28 29
29 namespace OrthancStone 30 namespace OrthancStone
32 // uses and that depends on the environment in which the Application executes. 33 // uses and that depends on the environment in which the Application executes.
33 // I.e, the StoneApplicationContext provides a WebService interface such that 34 // I.e, the StoneApplicationContext provides a WebService interface such that
34 // the StoneApplication can perform HTTP requests. In a WASM environment, 35 // 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 browser while, in a native environment,
36 // the WebService is provided by the OracleWebService (a C++ Http client) 37 // the WebService is provided by the OracleWebService (a C++ Http client)
38
37 class StoneApplicationContext : public boost::noncopyable 39 class StoneApplicationContext : public boost::noncopyable
38 { 40 {
41 protected:
42 // TODO ADD THE MessageBroker HERE
43
44 IWebService* webService_;
45 std::auto_ptr<OrthancApiClient> orthanc_;
39 46
40 protected:
41 IWebService* webService_;
42 public: 47 public:
43 StoneApplicationContext() 48 StoneApplicationContext() :
44 : webService_(NULL) 49 webService_(NULL)
45 { 50 {
46 }
47
48 IWebService& GetWebService() {return *webService_;}
49 void SetWebService(IWebService& webService)
50 {
51 webService_ = &webService;
52 } 51 }
53 52
54 virtual ~StoneApplicationContext() 53 virtual ~StoneApplicationContext()
55 { 54 {
56 } 55 }
56
57 IWebService& GetWebService();
58
59 OrthancApiClient& GetOrthancApiClient();
60
61 void Initialize(MessageBroker& broker,
62 IWebService& webService,
63 const std::string& orthancBaseUrl);
57 }; 64 };
58 } 65 }