WHY_CPP  0.1
application.h
1 #pragma once
2 
3 #include <whycpp/application_config.h>
4 #include <memory>
5 
7 class Context;
8 
25 class Application {
26  public:
27  explicit Application(ApplicationListener* listener, const ApplicationConfig& congig);
28  virtual ~Application();
29 
30  void Run();
31  private:
32  // please, keep tis order, it's important for the object destruction order
33  // Destuction order: [listener, loop, context, sdl context]
34  const std::unique_ptr<Context> context;
35  const std::unique_ptr<ApplicationListener> listener;
36  const ApplicationConfig config;
37 };
38