Skip to content
Flecs v4.1
decl.hpp
Go to the documentation of this file.
1/**
2 * @file addons/cpp/mixins/units/decl.hpp
3 * @brief Units module declarations.
4 */
5
6#pragma once
7
8namespace flecs {
9/** Units module. */
10struct units {
11
12/**
13 * @defgroup cpp_addons_units Units
14 * @ingroup cpp_addons
15 * Common unit annotations for reflection framework.
16 *
17 * @{
18 */
19
20/** Prefixes scope. */
21struct Prefixes { };
22
23/**
24 * @defgroup cpp_addons_units_prefixes Prefixes
25 * @ingroup cpp_addons_units
26 * Prefixes to indicate unit count (e.g., Kilo, Mega).
27 *
28 * @{
29 */
30
31/** Yocto prefix (10^-24). */
32struct Yocto { };
33/** Zepto prefix (10^-21). */
34struct Zepto { };
35/** Atto prefix (10^-18). */
36struct Atto { };
37/** Femto prefix (10^-15). */
38struct Femto { };
39/** Pico prefix (10^-12). */
40struct Pico { };
41/** Nano prefix (10^-9). */
42struct Nano { };
43/** Micro prefix (10^-6). */
44struct Micro { };
45/** Milli prefix (10^-3). */
46struct Milli { };
47/** Centi prefix (10^-2). */
48struct Centi { };
49/** Deci prefix (10^-1). */
50struct Deci { };
51/** Deca prefix (10^1). */
52struct Deca { };
53/** Hecto prefix (10^2). */
54struct Hecto { };
55/** Kilo prefix (10^3). */
56struct Kilo { };
57/** Mega prefix (10^6). */
58struct Mega { };
59/** Giga prefix (10^9). */
60struct Giga { };
61/** Tera prefix (10^12). */
62struct Tera { };
63/** Peta prefix (10^15). */
64struct Peta { };
65/** Exa prefix (10^18). */
66struct Exa { };
67/** Zetta prefix (10^21). */
68struct Zetta { };
69/** Yotta prefix (10^24). */
70struct Yotta { };
71/** Kibi prefix (2^10). */
72struct Kibi { };
73/** Mebi prefix (2^20). */
74struct Mebi { };
75/** Gibi prefix (2^30). */
76struct Gibi { };
77/** Tebi prefix (2^40). */
78struct Tebi { };
79/** Pebi prefix (2^50). */
80struct Pebi { };
81/** Exbi prefix (2^60). */
82struct Exbi { };
83/** Zebi prefix (2^70). */
84struct Zebi { };
85/** Yobi prefix (2^80). */
86struct Yobi { };
87
88/** @} */
89
90/**
91 * @defgroup cpp_addons_units_quantities Quantities
92 * @ingroup cpp_addons_units
93 * Quantities that group units (e.g., Length).
94 *
95 * @{
96 */
97
98/** Duration quantity. */
99struct Duration { };
100/** Time quantity. */
101struct Time { };
102/** Mass quantity. */
103struct Mass { };
104/** Electric current quantity. */
106/** Luminous intensity quantity. */
108/** Force quantity. */
109struct Force { };
110/** Amount quantity. */
111struct Amount { };
112/** Length quantity. */
113struct Length { };
114/** Pressure quantity. */
115struct Pressure { };
116/** Speed quantity. */
117struct Speed { };
118/** Temperature quantity. */
119struct Temperature { };
120/** Data quantity. */
121struct Data { };
122/** Data rate quantity. */
123struct DataRate { };
124/** Angle quantity. */
125struct Angle { };
126/** Frequency quantity. */
127struct Frequency { };
128/** URI quantity. */
129struct Uri { };
130/** Color quantity. */
131struct Color { };
132
133/** @} */
134
135/** Duration units. */
136struct duration {
137/**
138 * @defgroup cpp_addons_units_duration Duration
139 * @ingroup cpp_addons_units
140 * @{
141 */
142
143/** PicoSeconds unit. */
144struct PicoSeconds { };
145/** NanoSeconds unit. */
146struct NanoSeconds { };
147/** MicroSeconds unit. */
148struct MicroSeconds { };
149/** MilliSeconds unit. */
150struct MilliSeconds { };
151/** Seconds unit. */
152struct Seconds { };
153/** Minutes unit. */
154struct Minutes { };
155/** Hours unit. */
156struct Hours { };
157/** Days unit. */
158struct Days { };
159
160/** @} */
161};
162
163/** Angle units. */
164struct angle {
165/**
166 * @defgroup cpp_addons_units_angle Angle
167 * @ingroup cpp_addons_units
168 * @{
169 */
170
171/** Radians unit. */
172struct Radians { };
173/** Degrees unit. */
174struct Degrees { };
175
176/** @} */
177};
178
179
180/** Time units. */
181struct time {
182/**
183 * @defgroup cpp_addons_units_time Time
184 * @ingroup cpp_addons_units
185 * @{
186 */
187
188/** Date unit. */
189struct Date { };
190
191/** @} */
192};
193
194
195/** Mass units. */
196struct mass {
197/**
198 * @defgroup cpp_addons_units_mass Mass
199 * @ingroup cpp_addons_units
200 * @{
201 */
202
203/** Grams unit. */
204struct Grams { };
205/** KiloGrams unit. */
206struct KiloGrams { };
207
208/** @} */
209};
210
211
212/** Electric current units. */
214/**
215 * @defgroup cpp_addons_units_electric_current Electric Current
216 * @ingroup cpp_addons_units
217 * @{
218 */
219
220/** Ampere unit. */
221struct Ampere { };
222
223/** @} */
224};
225
226
227/** Amount units. */
228struct amount {
229/**
230 * @defgroup cpp_addons_units_amount Amount
231 * @ingroup cpp_addons_units
232 * @{
233 */
234
235/** Mole unit. */
236struct Mole { };
237
238/** @} */
239};
240
241
242/** Luminous intensity units. */
244/**
245 * @defgroup cpp_addons_units_luminous_intensity Luminous Intensity
246 * @ingroup cpp_addons_units
247 * @{
248 */
249
250/** Candela unit. */
251struct Candela { };
252
253/** @} */
254};
255
256
257/** Force units. */
258struct force {
259/**
260 * @defgroup cpp_addons_units_force Force
261 * @ingroup cpp_addons_units
262 * @{
263 */
264
265/** Newton unit. */
266struct Newton { };
267
268/** @} */
269};
270
271
272/** Length units. */
273struct length {
274/**
275 * @defgroup cpp_addons_units_length Length
276 * @ingroup cpp_addons_units
277 * @{
278 */
279
280/** Meters unit. */
281struct Meters { };
282/** PicoMeters unit. */
283struct PicoMeters { };
284/** NanoMeters unit. */
285struct NanoMeters { };
286/** MicroMeters unit. */
287struct MicroMeters { };
288/** MilliMeters unit. */
289struct MilliMeters { };
290/** CentiMeters unit. */
291struct CentiMeters { };
292/** KiloMeters unit. */
293struct KiloMeters { };
294/** Miles unit. */
295struct Miles { };
296/** Pixels unit. */
297struct Pixels { };
298
299/** @} */
300};
301
302
303/** Pressure units. */
304struct pressure {
305/**
306 * @defgroup cpp_addons_units_pressure Pressure
307 * @ingroup cpp_addons_units
308 * @{
309 */
310
311/** Pascal unit. */
312struct Pascal { };
313/** Bar unit. */
314struct Bar { };
315
316/** @} */
317};
318
319
320/** Speed units. */
321struct speed {
322/**
323 * @defgroup cpp_addons_units_speed Speed
324 * @ingroup cpp_addons_units
325 * @{
326 */
327
328/** MetersPerSecond unit. */
330/** KiloMetersPerSecond unit. */
332/** KiloMetersPerHour unit. */
334/** MilesPerHour unit. */
335struct MilesPerHour { };
336
337/** @} */
338};
339
340
341/** Temperature units. */
343/**
344 * @defgroup cpp_addons_units_temperature Temperature
345 * @ingroup cpp_addons_units
346 * @{
347 */
348
349/** Kelvin unit. */
350struct Kelvin { };
351/** Celsius unit. */
352struct Celsius { };
353/** Fahrenheit unit. */
354struct Fahrenheit { };
355
356/** @} */
357};
358
359
360/** Data units. */
361struct data {
362/**
363 * @defgroup cpp_addons_units_data Data
364 * @ingroup cpp_addons_units
365 * @{
366 */
367
368/** Bits unit. */
369struct Bits { };
370/** KiloBits unit. */
371struct KiloBits { };
372/** MegaBits unit. */
373struct MegaBits { };
374/** GigaBits unit. */
375struct GigaBits { };
376/** Bytes unit. */
377struct Bytes { };
378/** KiloBytes unit. */
379struct KiloBytes { };
380/** MegaBytes unit. */
381struct MegaBytes { };
382/** GigaBytes unit. */
383struct GigaBytes { };
384/** KibiBytes unit. */
385struct KibiBytes { };
386/** MebiBytes unit. */
387struct MebiBytes { };
388/** GibiBytes unit. */
389struct GibiBytes { };
390
391/** @} */
392};
393
394/** Data rate units. */
395struct datarate {
396/**
397 * @defgroup cpp_addons_units_datarate Data Rate
398 * @ingroup cpp_addons_units
399 * @{
400 */
401
402/** BitsPerSecond unit. */
403struct BitsPerSecond { };
404/** KiloBitsPerSecond unit. */
406/** MegaBitsPerSecond unit. */
408/** GigaBitsPerSecond unit. */
410/** BytesPerSecond unit. */
411struct BytesPerSecond { };
412/** KiloBytesPerSecond unit. */
414/** MegaBytesPerSecond unit. */
416/** GigaBytesPerSecond unit. */
418
419/** @} */
420};
421
422
423/** Frequency units. */
424struct frequency {
425/**
426 * @defgroup cpp_addons_units_frequency Frequency
427 * @ingroup cpp_addons_units
428 * @{
429 */
430
431/** Hertz unit. */
432struct Hertz { };
433/** KiloHertz unit. */
434struct KiloHertz { };
435/** MegaHertz unit. */
436struct MegaHertz { };
437/** GigaHertz unit. */
438struct GigaHertz { };
439
440/** @} */
441};
442
443
444/** URI units. */
445struct uri {
446/**
447 * @defgroup cpp_addons_units_uri Uri
448 * @ingroup cpp_addons_units
449 * @{
450 */
451
452/** Hyperlink unit. */
453struct Hyperlink { };
454/** Image unit. */
455struct Image { };
456/** File unit. */
457struct File { };
458
459/** @} */
460};
461
462
463/** Color units. */
464struct color {
465/**
466 * @defgroup cpp_addons_units_color Color
467 * @ingroup cpp_addons_units
468 * @{
469 */
470
471/** RGB color unit. */
472struct Rgb { };
473/** HSL color unit. */
474struct Hsl { };
475/** CSS color unit. */
476struct Css { };
477
478/** @} */
479};
480
481/** Percentage unit. */
482struct Percentage { };
483/** Bel unit. */
484struct Bel { };
485/** DeciBel unit. */
486struct DeciBel { };
487
488/** Construct the units module. */
490
491/** @} */
492
493};
494}
units(flecs::world &world)
Construct the units module.
Definition impl.hpp:10
Amount quantity.
Definition decl.hpp:111
Angle quantity.
Definition decl.hpp:125
Atto prefix (10^-18).
Definition decl.hpp:36
Bel unit.
Definition decl.hpp:484
Centi prefix (10^-2).
Definition decl.hpp:48
Color quantity.
Definition decl.hpp:131
Data rate quantity.
Definition decl.hpp:123
Data quantity.
Definition decl.hpp:121
Deca prefix (10^1).
Definition decl.hpp:52
DeciBel unit.
Definition decl.hpp:486
Deci prefix (10^-1).
Definition decl.hpp:50
Duration quantity.
Definition decl.hpp:99
Electric current quantity.
Definition decl.hpp:105
Exa prefix (10^18).
Definition decl.hpp:66
Exbi prefix (2^60).
Definition decl.hpp:82
Femto prefix (10^-15).
Definition decl.hpp:38
Force quantity.
Definition decl.hpp:109
Frequency quantity.
Definition decl.hpp:127
Gibi prefix (2^30).
Definition decl.hpp:76
Giga prefix (10^9).
Definition decl.hpp:60
Hecto prefix (10^2).
Definition decl.hpp:54
Kibi prefix (2^10).
Definition decl.hpp:72
Kilo prefix (10^3).
Definition decl.hpp:56
Length quantity.
Definition decl.hpp:113
Luminous intensity quantity.
Definition decl.hpp:107
Mass quantity.
Definition decl.hpp:103
Mebi prefix (2^20).
Definition decl.hpp:74
Mega prefix (10^6).
Definition decl.hpp:58
Micro prefix (10^-6).
Definition decl.hpp:44
Milli prefix (10^-3).
Definition decl.hpp:46
Nano prefix (10^-9).
Definition decl.hpp:42
Pebi prefix (2^50).
Definition decl.hpp:80
Percentage unit.
Definition decl.hpp:482
Peta prefix (10^15).
Definition decl.hpp:64
Pico prefix (10^-12).
Definition decl.hpp:40
Prefixes scope.
Definition decl.hpp:21
Pressure quantity.
Definition decl.hpp:115
Speed quantity.
Definition decl.hpp:117
Tebi prefix (2^40).
Definition decl.hpp:78
Temperature quantity.
Definition decl.hpp:119
Tera prefix (10^12).
Definition decl.hpp:62
Time quantity.
Definition decl.hpp:101
URI quantity.
Definition decl.hpp:129
Yobi prefix (2^80).
Definition decl.hpp:86
Yocto prefix (10^-24).
Definition decl.hpp:32
Yotta prefix (10^24).
Definition decl.hpp:70
Zebi prefix (2^70).
Definition decl.hpp:84
Zepto prefix (10^-21).
Definition decl.hpp:34
Zetta prefix (10^21).
Definition decl.hpp:68
Amount units.
Definition decl.hpp:228
Angle units.
Definition decl.hpp:164
CSS color unit.
Definition decl.hpp:476
HSL color unit.
Definition decl.hpp:474
RGB color unit.
Definition decl.hpp:472
Color units.
Definition decl.hpp:464
Data units.
Definition decl.hpp:361
Data rate units.
Definition decl.hpp:395
Duration units.
Definition decl.hpp:136
Electric current units.
Definition decl.hpp:213
Force units.
Definition decl.hpp:258
Frequency units.
Definition decl.hpp:424
Length units.
Definition decl.hpp:273
Luminous intensity units.
Definition decl.hpp:243
Mass units.
Definition decl.hpp:196
Pressure units.
Definition decl.hpp:304
KiloMetersPerHour unit.
Definition decl.hpp:333
KiloMetersPerSecond unit.
Definition decl.hpp:331
MetersPerSecond unit.
Definition decl.hpp:329
Speed units.
Definition decl.hpp:321
Temperature units.
Definition decl.hpp:342
Time units.
Definition decl.hpp:181
URI units.
Definition decl.hpp:445
The world.
Definition world.hpp:129