1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
62
63
64
65
66
67
68
69
70
71
72
75
76
77
81
82
83
84
85
86
87
88
89
90
93
94
95
99
100
101
102
103
106
107
108
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/* ... */
#ifndef FRONTENDHEAP_HPP
#define FRONTENDHEAP_HPP
#include <common/Meta.hpp>
#include <common/Partition.hpp>
#include <mvp/MVPHeap.hpp>
#include <touchgfx/transitions/NoTransition.hpp>
#include <touchgfx/transitions/SlideTransition.hpp>
#include <gui/common/FrontendApplication.hpp>
#include <gui/model/Model.hpp>
#include <gui/main_menu_screen/MainMenuCarouselView.hpp>
#include <gui/main_menu_screen/MainMenuAnimatingButtonsView.hpp>
#include <gui/main_menu_screen/MainMenuPresenter.hpp>
#include <gui/product_presenter_screen/ProductPresenterView.hpp>
#include <gui/product_presenter_screen/ProductPresenterPresenter.hpp>
#include <gui/game2048_screen/Game2048View.hpp>
#include <gui/game2048_screen/Game2048Presenter.hpp>
#include <gui/game2D_screen/Game2DView.hpp>
#include <gui/game2D_screen/Game2DPresenter.hpp>
#include <gui/custom_controls_screen/CustomControlsView.hpp>
#include <gui/custom_controls_screen/CustomControlsPresenter.hpp>
#include <gui/graph_screen/GraphView.hpp>
#include <gui/graph_screen/GraphPresenter.hpp>
20 includes
/* ... */
class FrontendHeap : public MVPHeap
{
public:
/* ... */
typedef meta::TypeList< MainMenuCarouselView,
meta::TypeList<MainMenuAnimatingButtonsView,
meta::TypeList<ProductPresenterView,
meta::TypeList<Game2048View,
meta::TypeList<Game2DView,
meta::TypeList<CustomControlsView,
meta::TypeList<GraphView,
meta::Nil
> > > > > > > ViewTypes;
/* ... */
typedef meta::select_type_maxsize< ViewTypes >::type MaxViewType;
/* ... */
typedef meta::TypeList< MainMenuPresenter,
meta::TypeList<ProductPresenterPresenter,
meta::TypeList<Game2048Presenter,
meta::TypeList<Game2DPresenter,
meta::TypeList<CustomControlsPresenter,
meta::TypeList<GraphPresenter,
meta::Nil
> > > > > > PresenterTypes;
/* ... */
typedef meta::select_type_maxsize< PresenterTypes >::type MaxPresenterType;
/* ... */
typedef meta::TypeList< NoTransition,
meta::Nil
> TransitionTypes;
/* ... */
typedef meta::select_type_maxsize< TransitionTypes >::type MaxTransitionType;
static FrontendHeap& getInstance()
{
static FrontendHeap instance;
return instance;
}{ ... }
Partition< PresenterTypes, 1 > presenters;
Partition< ViewTypes, 1 > views;
Partition< TransitionTypes, 1 > transitions;
FrontendApplication app;
Model model;public:
private:
FrontendHeap()
: MVPHeap(presenters, views, transitions, app),
presenters(),
views(),
transitions(),
app(model, *this)
{
app.gotoMainMenuCarouselScreen();
}{ ... }
}private:;...
/* ... */#endif