comparison Applications/Samples/SampleApplicationBase.h @ 221:d7b2590744f8 am

wip: building applications reusable in SDL and WASM
author am@osimis.io
date Mon, 11 Jun 2018 14:01:02 +0200
parents 4cff7b1ed31d
children ce4405d98b92
comparison
equal deleted inserted replaced
219:26e3bfe30e66 221:d7b2590744f8
19 **/ 19 **/
20 20
21 21
22 #pragma once 22 #pragma once
23 23
24 #include "../IBasicApplication.h" 24 #include "../../Applications/Sdl/BasicSdlApplication.h"
25 #include "SampleApplicationContext.h"
25 26
26 namespace OrthancStone 27 namespace OrthancStone
27 { 28 {
28 namespace Samples 29 namespace Samples
29 { 30 {
30 class SampleApplicationBase : public IBasicApplication 31
32 #ifdef ORTHANC_ENABLE_SDL
33 class SampleSdlApplicationBase : BasicSdlApplication {
34 private:
35 std::unique_ptr<SampleApplicationContext> context_;
36
37 BasicApplicationContext& CreateApplicationContext(Orthanc::WebServiceParameters& orthanc) {
38 context_.reset(new SampleApplicationContext(orthanc));
39 }
40 };
41
42 typedef SampleApplicationBase_ SampleSdlApplicationBase;
43 #else
44
45 #endif
46
47 class SampleApplicationBase : public SampleApplicationBase_
31 { 48 {
32 public: 49 public:
33 virtual std::string GetTitle() const 50 virtual std::string GetTitle() const
34 { 51 {
35 return "Stone of Orthanc - Sample"; 52 return "Stone of Orthanc - Sample";
36 } 53 }
54 };
37 55
38 virtual void DeclareCommandLineOptions(boost::program_options::options_description& options)
39 {
40 }
41 56
42 virtual void Finalize()
43 {
44 }
45 };
46 } 57 }
47 } 58 }