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