Select one of the symbols to view example projects that use it.
 
Outline
#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>
FrontendHeap
Files
loading...
CodeScopeSTM32 Libraries and SamplesTouchGFXGui/gui/include/gui/common/FrontendHeap.hpp
 
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/** ****************************************************************************** * This file is part of the TouchGFX 4.10.0 distribution. * * @attention * * Copyright (c) 2018 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** *//* ... */ #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 /** * This class provides the memory that shall be used for memory allocations * in the frontend. A single instance of the FrontendHeap is allocated once (in heap * memory), and all other frontend objects such as views, presenters and data model are * allocated within the scope of this FrontendHeap. As such, the RAM usage of the entire * user interface is sizeof(FrontendHeap). * * @note The FrontendHeap reserves memory for the most memory-consuming presenter and * view only. The largest of these classes are determined at compile-time using template * magic. As such, it is important to add all presenters, views and transitions to the * type lists in this class. * *//* ... */ class FrontendHeap : public MVPHeap { public: /** * A list of all view types. Must end with meta::Nil. * @note All view types used in the application MUST be added to this list! *//* ... */ 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; /** * Determine (compile time) the View type of largest size. *//* ... */ typedef meta::select_type_maxsize< ViewTypes >::type MaxViewType; /** * A list of all presenter types. Must end with meta::Nil. * @note All presenter types used in the application MUST be added to this list! *//* ... */ typedef meta::TypeList< MainMenuPresenter, meta::TypeList<ProductPresenterPresenter, meta::TypeList<Game2048Presenter, meta::TypeList<Game2DPresenter, meta::TypeList<CustomControlsPresenter, meta::TypeList<GraphPresenter, meta::Nil > > > > > > PresenterTypes; /** * Determine (compile time) the Presenter type of largest size. *//* ... */ typedef meta::select_type_maxsize< PresenterTypes >::type MaxPresenterType; /** * A list of all transition types. Must end with meta::Nil. * @note All transition types used in the application MUST be added to this list! *//* ... */ typedef meta::TypeList< NoTransition, meta::Nil > TransitionTypes; /** * Determine (compile time) the Transition type of largest size. *//* ... */ 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) { // Goto start screen app.gotoMainMenuCarouselScreen(); //app.gotoMainMenuAnimatingButtonsScreen(); //app.gotoProductPresenterScreen(); //app.gotoGame2048Screen(); //app.gotoGame2DScreen(); //app.gotoCustomControlsScreen(); //app.gotoGraphScreen(); }{ ... } }private:;... /* ... */#endif