Select one of the symbols to view example projects that use it.
 
Outline
#define META_HPP
touchgfx
Files
loading...
CodeScopeSTM32 Libraries and SamplesTouchGFXtouchgfx/framework/include/common/Meta.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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/** ****************************************************************************** * This file is part of the TouchGFX 4.10.0 distribution. * * <h2><center>&copy; Copyright (c) 2018 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under Ultimate Liberty license * SLA0044, the "License"; You may not use this file except in compliance with * the License. You may obtain a copy of the License at: * www.st.com/SLA0044 * ****************************************************************************** *//* ... */ #ifndef META_HPP #define META_HPP namespace touchgfx { /** * Template meta-programming tools are grouped in this namespace *//* ... */ namespace meta { /** * @struct Nil Meta.hpp common/Meta.hpp * * @brief Nil-type, indicates the end of a TypeList. * * Nil-type, indicates the end of a TypeList. *//* ... */ struct Nil { }; /** * @struct TypeList Meta.hpp common/Meta.hpp * * @brief TypeList, used for generating compile-time lists of types. * * TypeList, used for generating compile-time lists of types. * * @tparam First Type of the first. * @tparam Next Type of the next. *//* ... */ template< typename First, typename Next > struct TypeList { typedef First first; ///< The first element in the TypeList typedef Next next; ///< Remainder of the TypeList ...}; /** * @fn template < typename T1, typename T2, bool choose1 = (sizeof(T1) > sizeof(T2)) > struct type_max * * @brief Meta-function, selects the "maximum" type, i.e. the largest type. * * Meta-function, selects the "maximum" type, i.e. the largest type. * * @tparam T1 Generic type parameter. * @tparam T2 Generic type parameter. * @tparam choose1 True if sizeof(T1) is larger than sizeof(T2). *//* ... */ template < typename T1, typename T2, bool choose1 = (sizeof(T1) > sizeof(T2)) > struct type_max { typedef T1 type; ///< The resulting type (default case: sizeof(T1)>sizeof(T2)) ...}; /** * @struct type_max<T1,T2,false> Meta.hpp common/Meta.hpp * * @brief Specialization for the case where sizeof(T2) >= sizeof(T1). * * Specialization for the case where sizeof(T2) >= sizeof(T1). * * @tparam T1 Generic type parameter. * @tparam T2 Generic type parameter. *//* ... */ template<typename T1, typename T2> struct type_max<T1, T2, false> { typedef T2 type; ///< The resulting type (default case: sizeof(T2)>=sizeof(T1)) ...}; /** * @struct select_type_maxsize Meta.hpp common/Meta.hpp * * @brief Meta-function signature, selects maximum type from TypeList. * * Meta-function signature, selects maximum type from TypeList. * * @tparam T Generic type parameter. *//* ... */ template<typename T> struct select_type_maxsize; /** * @struct select_type_maxsize<TypeList<First,Next>> Meta.hpp common/Meta.hpp * * @brief Specialization to dive into the list (inherits result from type_max). * * @tparam First Type of the first. * @tparam Next Type of the next. *//* ... */ template< typename First, typename Next > struct select_type_maxsize< TypeList< First, Next > > : public type_max< First, typename select_type_maxsize< Next >::type > { }; /** * @struct select_type_maxsize<TypeList<First,Nil>> Meta.hpp common/Meta.hpp * * @brief Specialization for loop termination (when type Nil encountered). * * Specialization for loop termination (when type Nil encountered). * * @tparam First Type of the first. *//* ... */ template< typename First > struct select_type_maxsize< TypeList< First, Nil > > { typedef First type; ...}; /** * @struct list_join Meta.hpp common/Meta.hpp * * @brief Meta-function signature, joins typelist with type (or another typelist). * * Meta-function signature, joins typelist with type (or another typelist). * * @tparam TList Type of the list. * @tparam T Generic type parameter. *//* ... */ template< typename TList, typename T > struct list_join; /** * @struct list_join<Nil,Nil> Meta.hpp common/Meta.hpp * * @brief Specialization for termination. * * Specialization for termination. *//* ... */ template<> struct list_join< Nil, Nil> { typedef Nil result; ...}; /** * @struct list_join<Nil,T> Meta.hpp common/Meta.hpp * * @brief Specialization for "end-of-LHS", with RHS as type. * * Specialization for "end-of-LHS", with RHS as type. * * @tparam T Generic type parameter. *//* ... */ template< typename T > struct list_join< Nil, T> { typedef TypeList< T, Nil> result; ...}; /** * @struct list_join<Nil,TypeList<First,Next>> Meta.hpp common/Meta.hpp * * @brief Specialization for "end-of-LHS", with RHS as a TypeList. * * Specialization for "end-of-LHS", with RHS as a TypeList. * * @tparam First Type of the first. * @tparam Next Type of the next. *//* ... */ template< typename First, typename Next> struct list_join< Nil, TypeList< First, Next > > { typedef TypeList< First, Next > result; ...}; /** * @struct list_join<TypeList<First,Next>,T> Meta.hpp common/Meta.hpp * * @brief Recursively joins a typelist (LHS) with a type or a type-list (RHS). * * Recursively joins a typelist (LHS) with a type or a type-list (RHS). * * @tparam First Type of the first. * @tparam Next Type of the next. * @tparam T Generic type parameter. *//* ... */ template< typename First, typename Next, typename T> struct list_join< TypeList< First, Next >, T > { typedef TypeList< First, typename list_join<Next, T>::result > result; ...}; ...} // namespace meta ...} // namespace touchgfx /* ... */ #endif // META_HPP