Rpi-hw  0.7.2
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
enumerate.hpp
1 /*
2  Title --- enumerate.hpp
3 
4  Copyright (C) 2013 Giacomo Trudu - wicker25[at]gmail[dot]com
5 
6  This file is part of Rpi-hw.
7 
8  Rpi-hw is free software: you can redistribute it and/or modify
9  it under the terms of the GNU Lesser General Public License as published by
10  the Free Software Foundation version 3 of the License.
11 
12  Rpi-hw is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public License
18  along with Rpi-hw. If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 
22 #ifndef _RPI_HW_ENUMERATE_HPP_
23 #define _RPI_HW_ENUMERATE_HPP_
24 
25 //! Generates a comma-separated list of enumerated expressions.
26 #define __ENUM( expr, from, to ) __ENUM_ ## from ## _ ## to ( expr )
27 
28 //! Generates a comma-separated list of parameters.
29 #define __ENUM_PARAMS( type, prefix, from, to ) __ENUM( type prefix, from, to )
30 
31 
32 // All repeat macros
33 #define __ENUM_0_0( expr ) expr ## 0
34 #define __ENUM_0_1( expr ) __ENUM_0_0( expr ), expr ## 1
35 #define __ENUM_0_2( expr ) __ENUM_0_1( expr ), expr ## 2
36 #define __ENUM_0_3( expr ) __ENUM_0_2( expr ), expr ## 3
37 #define __ENUM_0_4( expr ) __ENUM_0_3( expr ), expr ## 4
38 #define __ENUM_0_5( expr ) __ENUM_0_4( expr ), expr ## 5
39 #define __ENUM_0_6( expr ) __ENUM_0_5( expr ), expr ## 6
40 #define __ENUM_0_7( expr ) __ENUM_0_6( expr ), expr ## 7
41 #define __ENUM_0_8( expr ) __ENUM_0_7( expr ), expr ## 8
42 #define __ENUM_0_9( expr ) __ENUM_0_8( expr ), expr ## 9
43 #define __ENUM_0_10( expr ) __ENUM_0_9( expr ), expr ## 10
44 #define __ENUM_0_11( expr ) __ENUM_0_10( expr ), expr ## 11
45 #define __ENUM_0_12( expr ) __ENUM_0_11( expr ), expr ## 12
46 #define __ENUM_0_13( expr ) __ENUM_0_12( expr ), expr ## 13
47 #define __ENUM_0_14( expr ) __ENUM_0_13( expr ), expr ## 14
48 #define __ENUM_0_15( expr ) __ENUM_0_14( expr ), expr ## 15
49 #define __ENUM_0_16( expr ) __ENUM_0_15( expr ), expr ## 16
50 #define __ENUM_0_17( expr ) __ENUM_0_16( expr ), expr ## 17
51 #define __ENUM_0_18( expr ) __ENUM_0_17( expr ), expr ## 18
52 #define __ENUM_0_19( expr ) __ENUM_0_18( expr ), expr ## 19
53 #define __ENUM_0_20( expr ) __ENUM_0_19( expr ), expr ## 20
54 
55 #define __ENUM_1_1( expr ) expr ## 1
56 #define __ENUM_1_2( expr ) __ENUM_1_1( expr ), expr ## 2
57 #define __ENUM_1_3( expr ) __ENUM_1_2( expr ), expr ## 3
58 #define __ENUM_1_4( expr ) __ENUM_1_3( expr ), expr ## 4
59 #define __ENUM_1_5( expr ) __ENUM_1_4( expr ), expr ## 5
60 #define __ENUM_1_6( expr ) __ENUM_1_5( expr ), expr ## 6
61 #define __ENUM_1_7( expr ) __ENUM_1_6( expr ), expr ## 7
62 #define __ENUM_1_8( expr ) __ENUM_1_7( expr ), expr ## 8
63 #define __ENUM_1_9( expr ) __ENUM_1_8( expr ), expr ## 9
64 #define __ENUM_1_10( expr ) __ENUM_1_9( expr ), expr ## 10
65 #define __ENUM_1_11( expr ) __ENUM_1_10( expr ), expr ## 11
66 #define __ENUM_1_12( expr ) __ENUM_1_11( expr ), expr ## 12
67 #define __ENUM_1_13( expr ) __ENUM_1_12( expr ), expr ## 13
68 #define __ENUM_1_14( expr ) __ENUM_1_13( expr ), expr ## 14
69 #define __ENUM_1_15( expr ) __ENUM_1_14( expr ), expr ## 15
70 #define __ENUM_1_16( expr ) __ENUM_1_15( expr ), expr ## 16
71 #define __ENUM_1_17( expr ) __ENUM_1_16( expr ), expr ## 17
72 #define __ENUM_1_18( expr ) __ENUM_1_17( expr ), expr ## 18
73 #define __ENUM_1_19( expr ) __ENUM_1_18( expr ), expr ## 19
74 #define __ENUM_1_20( expr ) __ENUM_1_19( expr ), expr ## 20
75 
76 #define __ENUM_2_2( expr ) expr ## 2
77 #define __ENUM_2_3( expr ) __ENUM_2_2( expr ), expr ## 3
78 #define __ENUM_2_4( expr ) __ENUM_2_3( expr ), expr ## 4
79 #define __ENUM_2_5( expr ) __ENUM_2_4( expr ), expr ## 5
80 #define __ENUM_2_6( expr ) __ENUM_2_5( expr ), expr ## 6
81 #define __ENUM_2_7( expr ) __ENUM_2_6( expr ), expr ## 7
82 #define __ENUM_2_8( expr ) __ENUM_2_7( expr ), expr ## 8
83 #define __ENUM_2_9( expr ) __ENUM_2_8( expr ), expr ## 9
84 #define __ENUM_2_10( expr ) __ENUM_2_9( expr ), expr ## 10
85 #define __ENUM_2_11( expr ) __ENUM_2_10( expr ), expr ## 11
86 #define __ENUM_2_12( expr ) __ENUM_2_11( expr ), expr ## 12
87 #define __ENUM_2_13( expr ) __ENUM_2_12( expr ), expr ## 13
88 #define __ENUM_2_14( expr ) __ENUM_2_13( expr ), expr ## 14
89 #define __ENUM_2_15( expr ) __ENUM_2_14( expr ), expr ## 15
90 #define __ENUM_2_16( expr ) __ENUM_2_15( expr ), expr ## 16
91 #define __ENUM_2_17( expr ) __ENUM_2_16( expr ), expr ## 17
92 #define __ENUM_2_18( expr ) __ENUM_2_17( expr ), expr ## 18
93 #define __ENUM_2_19( expr ) __ENUM_2_18( expr ), expr ## 19
94 #define __ENUM_2_20( expr ) __ENUM_2_19( expr ), expr ## 20
95 
96 #define __ENUM_3_3( expr ) expr ## 3
97 #define __ENUM_3_4( expr ) __ENUM_3_3( expr ), expr ## 4
98 #define __ENUM_3_5( expr ) __ENUM_3_4( expr ), expr ## 5
99 #define __ENUM_3_6( expr ) __ENUM_3_5( expr ), expr ## 6
100 #define __ENUM_3_7( expr ) __ENUM_3_6( expr ), expr ## 7
101 #define __ENUM_3_8( expr ) __ENUM_3_7( expr ), expr ## 8
102 #define __ENUM_3_9( expr ) __ENUM_3_8( expr ), expr ## 9
103 #define __ENUM_3_10( expr ) __ENUM_3_9( expr ), expr ## 10
104 #define __ENUM_3_11( expr ) __ENUM_3_10( expr ), expr ## 11
105 #define __ENUM_3_12( expr ) __ENUM_3_11( expr ), expr ## 12
106 #define __ENUM_3_13( expr ) __ENUM_3_12( expr ), expr ## 13
107 #define __ENUM_3_14( expr ) __ENUM_3_13( expr ), expr ## 14
108 #define __ENUM_3_15( expr ) __ENUM_3_14( expr ), expr ## 15
109 #define __ENUM_3_16( expr ) __ENUM_3_15( expr ), expr ## 16
110 #define __ENUM_3_17( expr ) __ENUM_3_16( expr ), expr ## 17
111 #define __ENUM_3_18( expr ) __ENUM_3_17( expr ), expr ## 18
112 #define __ENUM_3_19( expr ) __ENUM_3_18( expr ), expr ## 19
113 #define __ENUM_3_20( expr ) __ENUM_3_19( expr ), expr ## 20
114 
115 #define __ENUM_4_4( expr ) expr ## 4
116 #define __ENUM_4_5( expr ) __ENUM_4_4( expr ), expr ## 5
117 #define __ENUM_4_6( expr ) __ENUM_4_5( expr ), expr ## 6
118 #define __ENUM_4_7( expr ) __ENUM_4_6( expr ), expr ## 7
119 #define __ENUM_4_8( expr ) __ENUM_4_7( expr ), expr ## 8
120 #define __ENUM_4_9( expr ) __ENUM_4_8( expr ), expr ## 9
121 #define __ENUM_4_10( expr ) __ENUM_4_9( expr ), expr ## 10
122 #define __ENUM_4_11( expr ) __ENUM_4_10( expr ), expr ## 11
123 #define __ENUM_4_12( expr ) __ENUM_4_11( expr ), expr ## 12
124 #define __ENUM_4_13( expr ) __ENUM_4_12( expr ), expr ## 13
125 #define __ENUM_4_14( expr ) __ENUM_4_13( expr ), expr ## 14
126 #define __ENUM_4_15( expr ) __ENUM_4_14( expr ), expr ## 15
127 #define __ENUM_4_16( expr ) __ENUM_4_15( expr ), expr ## 16
128 #define __ENUM_4_17( expr ) __ENUM_4_16( expr ), expr ## 17
129 #define __ENUM_4_18( expr ) __ENUM_4_17( expr ), expr ## 18
130 #define __ENUM_4_19( expr ) __ENUM_4_18( expr ), expr ## 19
131 #define __ENUM_4_20( expr ) __ENUM_4_19( expr ), expr ## 20
132 
133 #define __ENUM_5_5( expr ) expr ## 5
134 #define __ENUM_5_6( expr ) __ENUM_5_5( expr ), expr ## 6
135 #define __ENUM_5_7( expr ) __ENUM_5_6( expr ), expr ## 7
136 #define __ENUM_5_8( expr ) __ENUM_5_7( expr ), expr ## 8
137 #define __ENUM_5_9( expr ) __ENUM_5_8( expr ), expr ## 9
138 #define __ENUM_5_10( expr ) __ENUM_5_9( expr ), expr ## 10
139 #define __ENUM_5_11( expr ) __ENUM_5_10( expr ), expr ## 11
140 #define __ENUM_5_12( expr ) __ENUM_5_11( expr ), expr ## 12
141 #define __ENUM_5_13( expr ) __ENUM_5_12( expr ), expr ## 13
142 #define __ENUM_5_14( expr ) __ENUM_5_13( expr ), expr ## 14
143 #define __ENUM_5_15( expr ) __ENUM_5_14( expr ), expr ## 15
144 #define __ENUM_5_16( expr ) __ENUM_5_15( expr ), expr ## 16
145 #define __ENUM_5_17( expr ) __ENUM_5_16( expr ), expr ## 17
146 #define __ENUM_5_18( expr ) __ENUM_5_17( expr ), expr ## 18
147 #define __ENUM_5_19( expr ) __ENUM_5_18( expr ), expr ## 19
148 #define __ENUM_5_20( expr ) __ENUM_5_19( expr ), expr ## 20
149 
150 #define __ENUM_6_6( expr ) expr ## 6
151 #define __ENUM_6_7( expr ) __ENUM_6_6( expr ), expr ## 7
152 #define __ENUM_6_8( expr ) __ENUM_6_7( expr ), expr ## 8
153 #define __ENUM_6_9( expr ) __ENUM_6_8( expr ), expr ## 9
154 #define __ENUM_6_10( expr ) __ENUM_6_9( expr ), expr ## 10
155 #define __ENUM_6_11( expr ) __ENUM_6_10( expr ), expr ## 11
156 #define __ENUM_6_12( expr ) __ENUM_6_11( expr ), expr ## 12
157 #define __ENUM_6_13( expr ) __ENUM_6_12( expr ), expr ## 13
158 #define __ENUM_6_14( expr ) __ENUM_6_13( expr ), expr ## 14
159 #define __ENUM_6_15( expr ) __ENUM_6_14( expr ), expr ## 15
160 #define __ENUM_6_16( expr ) __ENUM_6_15( expr ), expr ## 16
161 #define __ENUM_6_17( expr ) __ENUM_6_16( expr ), expr ## 17
162 #define __ENUM_6_18( expr ) __ENUM_6_17( expr ), expr ## 18
163 #define __ENUM_6_19( expr ) __ENUM_6_18( expr ), expr ## 19
164 #define __ENUM_6_20( expr ) __ENUM_6_19( expr ), expr ## 20
165 
166 #define __ENUM_7_7( expr ) expr ## 7
167 #define __ENUM_7_8( expr ) __ENUM_7_7( expr ), expr ## 8
168 #define __ENUM_7_9( expr ) __ENUM_7_8( expr ), expr ## 9
169 #define __ENUM_7_10( expr ) __ENUM_7_9( expr ), expr ## 10
170 #define __ENUM_7_11( expr ) __ENUM_7_10( expr ), expr ## 11
171 #define __ENUM_7_12( expr ) __ENUM_7_11( expr ), expr ## 12
172 #define __ENUM_7_13( expr ) __ENUM_7_12( expr ), expr ## 13
173 #define __ENUM_7_14( expr ) __ENUM_7_13( expr ), expr ## 14
174 #define __ENUM_7_15( expr ) __ENUM_7_14( expr ), expr ## 15
175 #define __ENUM_7_16( expr ) __ENUM_7_15( expr ), expr ## 16
176 #define __ENUM_7_17( expr ) __ENUM_7_16( expr ), expr ## 17
177 #define __ENUM_7_18( expr ) __ENUM_7_17( expr ), expr ## 18
178 #define __ENUM_7_19( expr ) __ENUM_7_18( expr ), expr ## 19
179 #define __ENUM_7_20( expr ) __ENUM_7_19( expr ), expr ## 20
180 
181 #define __ENUM_8_8( expr ) expr ## 8
182 #define __ENUM_8_9( expr ) __ENUM_8_8( expr ), expr ## 9
183 #define __ENUM_8_10( expr ) __ENUM_8_9( expr ), expr ## 10
184 #define __ENUM_8_11( expr ) __ENUM_8_10( expr ), expr ## 11
185 #define __ENUM_8_12( expr ) __ENUM_8_11( expr ), expr ## 12
186 #define __ENUM_8_13( expr ) __ENUM_8_12( expr ), expr ## 13
187 #define __ENUM_8_14( expr ) __ENUM_8_13( expr ), expr ## 14
188 #define __ENUM_8_15( expr ) __ENUM_8_14( expr ), expr ## 15
189 #define __ENUM_8_16( expr ) __ENUM_8_15( expr ), expr ## 16
190 #define __ENUM_8_17( expr ) __ENUM_8_16( expr ), expr ## 17
191 #define __ENUM_8_18( expr ) __ENUM_8_17( expr ), expr ## 18
192 #define __ENUM_8_19( expr ) __ENUM_8_18( expr ), expr ## 19
193 #define __ENUM_8_20( expr ) __ENUM_8_19( expr ), expr ## 20
194 
195 #define __ENUM_9_9( expr ) expr ## 9
196 #define __ENUM_9_10( expr ) __ENUM_9_9( expr ), expr ## 10
197 #define __ENUM_9_11( expr ) __ENUM_9_10( expr ), expr ## 11
198 #define __ENUM_9_12( expr ) __ENUM_9_11( expr ), expr ## 12
199 #define __ENUM_9_13( expr ) __ENUM_9_12( expr ), expr ## 13
200 #define __ENUM_9_14( expr ) __ENUM_9_13( expr ), expr ## 14
201 #define __ENUM_9_15( expr ) __ENUM_9_14( expr ), expr ## 15
202 #define __ENUM_9_16( expr ) __ENUM_9_15( expr ), expr ## 16
203 #define __ENUM_9_17( expr ) __ENUM_9_16( expr ), expr ## 17
204 #define __ENUM_9_18( expr ) __ENUM_9_17( expr ), expr ## 18
205 #define __ENUM_9_19( expr ) __ENUM_9_18( expr ), expr ## 19
206 #define __ENUM_9_20( expr ) __ENUM_9_19( expr ), expr ## 20
207 
208 #define __ENUM_10_10( expr ) expr ## 10
209 #define __ENUM_10_11( expr ) __ENUM_10_10( expr ), expr ## 11
210 #define __ENUM_10_12( expr ) __ENUM_10_11( expr ), expr ## 12
211 #define __ENUM_10_13( expr ) __ENUM_10_12( expr ), expr ## 13
212 #define __ENUM_10_14( expr ) __ENUM_10_13( expr ), expr ## 14
213 #define __ENUM_10_15( expr ) __ENUM_10_14( expr ), expr ## 15
214 #define __ENUM_10_16( expr ) __ENUM_10_15( expr ), expr ## 16
215 #define __ENUM_10_17( expr ) __ENUM_10_16( expr ), expr ## 17
216 #define __ENUM_10_18( expr ) __ENUM_10_17( expr ), expr ## 18
217 #define __ENUM_10_19( expr ) __ENUM_10_18( expr ), expr ## 19
218 #define __ENUM_10_20( expr ) __ENUM_10_19( expr ), expr ## 20
219 
220 #define __ENUM_11_11( expr ) expr ## 11
221 #define __ENUM_11_12( expr ) __ENUM_11_11( expr ), expr ## 12
222 #define __ENUM_11_13( expr ) __ENUM_11_12( expr ), expr ## 13
223 #define __ENUM_11_14( expr ) __ENUM_11_13( expr ), expr ## 14
224 #define __ENUM_11_15( expr ) __ENUM_11_14( expr ), expr ## 15
225 #define __ENUM_11_16( expr ) __ENUM_11_15( expr ), expr ## 16
226 #define __ENUM_11_17( expr ) __ENUM_11_16( expr ), expr ## 17
227 #define __ENUM_11_18( expr ) __ENUM_11_17( expr ), expr ## 18
228 #define __ENUM_11_19( expr ) __ENUM_11_18( expr ), expr ## 19
229 #define __ENUM_11_20( expr ) __ENUM_11_19( expr ), expr ## 20
230 
231 #define __ENUM_12_12( expr ) expr ## 12
232 #define __ENUM_12_13( expr ) __ENUM_12_12( expr ), expr ## 13
233 #define __ENUM_12_14( expr ) __ENUM_12_13( expr ), expr ## 14
234 #define __ENUM_12_15( expr ) __ENUM_12_14( expr ), expr ## 15
235 #define __ENUM_12_16( expr ) __ENUM_12_15( expr ), expr ## 16
236 #define __ENUM_12_17( expr ) __ENUM_12_16( expr ), expr ## 17
237 #define __ENUM_12_18( expr ) __ENUM_12_17( expr ), expr ## 18
238 #define __ENUM_12_19( expr ) __ENUM_12_18( expr ), expr ## 19
239 #define __ENUM_12_20( expr ) __ENUM_12_19( expr ), expr ## 20
240 
241 #define __ENUM_13_13( expr ) expr ## 13
242 #define __ENUM_13_14( expr ) __ENUM_13_13( expr ), expr ## 14
243 #define __ENUM_13_15( expr ) __ENUM_13_14( expr ), expr ## 15
244 #define __ENUM_13_16( expr ) __ENUM_13_15( expr ), expr ## 16
245 #define __ENUM_13_17( expr ) __ENUM_13_16( expr ), expr ## 17
246 #define __ENUM_13_18( expr ) __ENUM_13_17( expr ), expr ## 18
247 #define __ENUM_13_19( expr ) __ENUM_13_18( expr ), expr ## 19
248 #define __ENUM_13_20( expr ) __ENUM_13_19( expr ), expr ## 20
249 
250 #define __ENUM_14_14( expr ) expr ## 14
251 #define __ENUM_14_15( expr ) __ENUM_14_14( expr ), expr ## 15
252 #define __ENUM_14_16( expr ) __ENUM_14_15( expr ), expr ## 16
253 #define __ENUM_14_17( expr ) __ENUM_14_16( expr ), expr ## 17
254 #define __ENUM_14_18( expr ) __ENUM_14_17( expr ), expr ## 18
255 #define __ENUM_14_19( expr ) __ENUM_14_18( expr ), expr ## 19
256 #define __ENUM_14_20( expr ) __ENUM_14_19( expr ), expr ## 20
257 
258 #define __ENUM_15_15( expr ) expr ## 15
259 #define __ENUM_15_16( expr ) __ENUM_15_15( expr ), expr ## 16
260 #define __ENUM_15_17( expr ) __ENUM_15_16( expr ), expr ## 17
261 #define __ENUM_15_18( expr ) __ENUM_15_17( expr ), expr ## 18
262 #define __ENUM_15_19( expr ) __ENUM_15_18( expr ), expr ## 19
263 #define __ENUM_15_20( expr ) __ENUM_15_19( expr ), expr ## 20
264 
265 #define __ENUM_16_16( expr ) expr ## 16
266 #define __ENUM_16_17( expr ) __ENUM_16_16( expr ), expr ## 17
267 #define __ENUM_16_18( expr ) __ENUM_16_17( expr ), expr ## 18
268 #define __ENUM_16_19( expr ) __ENUM_16_18( expr ), expr ## 19
269 #define __ENUM_16_20( expr ) __ENUM_16_19( expr ), expr ## 20
270 
271 #define __ENUM_17_17( expr ) expr ## 17
272 #define __ENUM_17_18( expr ) __ENUM_17_17( expr ), expr ## 18
273 #define __ENUM_17_19( expr ) __ENUM_17_18( expr ), expr ## 19
274 #define __ENUM_17_20( expr ) __ENUM_17_19( expr ), expr ## 20
275 
276 #define __ENUM_18_18( expr ) expr ## 18
277 #define __ENUM_18_19( expr ) __ENUM_18_18( expr ), expr ## 19
278 #define __ENUM_18_20( expr ) __ENUM_18_19( expr ), expr ## 20
279 
280 #define __ENUM_19_19( expr ) expr ## 19
281 #define __ENUM_19_20( expr ) __ENUM_19_19( expr ), expr ## 20
282 
283 #define __ENUM_20_20( expr ) expr ## 20
284 
285 #endif /* _RPI_HW_ENUMERATE_HPP_ */