DUDS
Distributed Update of Data from Something
Units.hpp
Go to the documentation of this file.
1 /*
2  * This file is part of the DUDS project. It is subject to the BSD-style
3  * license terms in the LICENSE file found in the top-level directory of this
4  * distribution and at https://github.com/jjackowski/duds/blob/master/LICENSE.
5  * No part of DUDS, including this file, may be copied, modified, propagated,
6  * or distributed except according to the terms contained in the LICENSE file.
7  *
8  * Copyright (C) 2017 Jeff Jackowski
9  */
10 #ifndef UNITS_HPP
11 #define UNITS_HPP
12 
17 #include <duds/data/Unit.hpp>
18 
19 namespace duds { namespace data {
20 
27 namespace units {
28 
29 // base units
30 constexpr Unit Ampere (DUDS_UNIT_VALUE(1, 0, 0, 0, 0, 0, 0, 0, 0));
31 constexpr Unit Candela (DUDS_UNIT_VALUE(0, 1, 0, 0, 0, 0, 0, 0, 0));
32 constexpr Unit Kelvin (DUDS_UNIT_VALUE(0, 0, 1, 0, 0, 0, 0, 0, 0));
33 constexpr Unit Kilogram (DUDS_UNIT_VALUE(0, 0, 0, 1, 0, 0, 0, 0, 0));
34 constexpr Unit Meter (DUDS_UNIT_VALUE(0, 0, 0, 0, 1, 0, 0, 0, 0));
35 constexpr Unit Mole (DUDS_UNIT_VALUE(0, 0, 0, 0, 0, 1, 0, 0, 0));
36 constexpr Unit Second (DUDS_UNIT_VALUE(0, 0, 0, 0, 0, 0, 1, 0, 0));
37 constexpr Unit Radian (DUDS_UNIT_VALUE(0, 0, 0, 0, 0, 0, 0, 1, 0));
38 constexpr Unit Steradian(DUDS_UNIT_VALUE(0, 0, 0, 0, 0, 0, 0, 0, 1));
39 
40 // derived units A cd K kg m mol s rad sr
41 constexpr Unit Hertz (DUDS_UNIT_VALUE( 0, 0, 0, 0, 0, 0, -1, 0, 0));
42 constexpr Unit Newton (DUDS_UNIT_VALUE( 0, 0, 0, 1, 1, 0, -2, 0, 0));
43 constexpr Unit Pascal (DUDS_UNIT_VALUE( 0, 0, 0, 1, -1, 0, -2, 0, 0));
44 constexpr Unit Joule (DUDS_UNIT_VALUE( 0, 0, 0, 1, 2, 0, -2, 0, 0));
45 constexpr Unit Watt (DUDS_UNIT_VALUE( 0, 0, 0, 1, 2, 0, -3, 0, 0));
46 constexpr Unit Coulomb (DUDS_UNIT_VALUE( 1, 0, 0, 0, 0, 0, 1, 0, 0));
47 constexpr Unit Volt (DUDS_UNIT_VALUE(-1, 0, 0, 1, 2, 0, -3, 0, 0));
48 constexpr Unit Farad (DUDS_UNIT_VALUE( 2, 0, 0, -1, -2, 0, 4, 0, 0));
49 constexpr Unit Ohm (DUDS_UNIT_VALUE(-2, 0, 0, 1, 2, 0, -3, 0, 0));
50 constexpr Unit Siemens (DUDS_UNIT_VALUE( 2, 0, 0, -1, -2, 0, 3, 0, 0));
51 constexpr Unit Weber (DUDS_UNIT_VALUE(-1, 0, 0, 0, 2, 0, -2, 0, 0));
52 constexpr Unit Tesla (DUDS_UNIT_VALUE(-1, 0, 0, 1, 0, 0, -2, 0, 0));
53 constexpr Unit Henry (DUDS_UNIT_VALUE(-2, 0, 0, 1, 2, 0, -2, 0, 0));
54 constexpr Unit Lumen (DUDS_UNIT_VALUE( 0, 1, 0, 0, 0, 0, 0, 0, 1));
55 constexpr Unit Lux (DUDS_UNIT_VALUE( 0, 1, 0, 0, -2, 0, 0, 0, 1));
56 constexpr Unit Becquerel(DUDS_UNIT_VALUE( 0, 0, 0, 0, 0, 0, -1, 0, 0));
57 constexpr Unit Gray (DUDS_UNIT_VALUE( 0, 0, 0, 0, 2, 0, -2, 0, 0));
58 constexpr Unit Sievert (DUDS_UNIT_VALUE( 0, 0, 0, 0, 2, 0, -2, 0, 0));
59 constexpr Unit Katal (DUDS_UNIT_VALUE( 0, 0, 0, 0, 0, 1, -1, 0, 0));
60 
61 } } }
62 
63 #endif // #ifndef UNITS_HPP
constexpr Unit Meter(DUDS_UNIT_VALUE(0, 0, 0, 0, 1, 0, 0, 0, 0))
constexpr Unit Lumen(DUDS_UNIT_VALUE(0, 1, 0, 0, 0, 0, 0, 0, 1))
constexpr Unit Candela(DUDS_UNIT_VALUE(0, 1, 0, 0, 0, 0, 0, 0, 0))
constexpr Unit Weber(DUDS_UNIT_VALUE(-1, 0, 0, 0, 2, 0, -2, 0, 0))
constexpr Unit Volt(DUDS_UNIT_VALUE(-1, 0, 0, 1, 2, 0, -3, 0, 0))
constexpr Unit Coulomb(DUDS_UNIT_VALUE(1, 0, 0, 0, 0, 0, 1, 0, 0))
constexpr Unit Katal(DUDS_UNIT_VALUE(0, 0, 0, 0, 0, 1, -1, 0, 0))
constexpr Unit Newton(DUDS_UNIT_VALUE(0, 0, 0, 1, 1, 0, -2, 0, 0))
constexpr Unit Ohm(DUDS_UNIT_VALUE(-2, 0, 0, 1, 2, 0, -3, 0, 0))
constexpr Unit Tesla(DUDS_UNIT_VALUE(-1, 0, 0, 1, 0, 0, -2, 0, 0))
constexpr Unit Lux(DUDS_UNIT_VALUE(0, 1, 0, 0, -2, 0, 0, 0, 1))
constexpr Unit Becquerel(DUDS_UNIT_VALUE(0, 0, 0, 0, 0, 0, -1, 0, 0))
Represents an SI unit, either base or derived.
Definition: Unit.hpp:178
constexpr Unit Radian(DUDS_UNIT_VALUE(0, 0, 0, 0, 0, 0, 0, 1, 0))
constexpr Unit Steradian(DUDS_UNIT_VALUE(0, 0, 0, 0, 0, 0, 0, 0, 1))
constexpr Unit Watt(DUDS_UNIT_VALUE(0, 0, 0, 1, 2, 0, -3, 0, 0))
constexpr Unit Ampere(DUDS_UNIT_VALUE(1, 0, 0, 0, 0, 0, 0, 0, 0))
constexpr Unit Pascal(DUDS_UNIT_VALUE(0, 0, 0, 1, -1, 0, -2, 0, 0))
constexpr Unit Hertz(DUDS_UNIT_VALUE(0, 0, 0, 0, 0, 0, -1, 0, 0))
constexpr Unit Kilogram(DUDS_UNIT_VALUE(0, 0, 0, 1, 0, 0, 0, 0, 0))
constexpr Unit Joule(DUDS_UNIT_VALUE(0, 0, 0, 1, 2, 0, -2, 0, 0))
constexpr Unit Siemens(DUDS_UNIT_VALUE(2, 0, 0, -1, -2, 0, 3, 0, 0))
constexpr Unit Sievert(DUDS_UNIT_VALUE(0, 0, 0, 0, 2, 0, -2, 0, 0))
constexpr Unit Gray(DUDS_UNIT_VALUE(0, 0, 0, 0, 2, 0, -2, 0, 0))
constexpr Unit Farad(DUDS_UNIT_VALUE(2, 0, 0, -1, -2, 0, 4, 0, 0))
#define DUDS_UNIT_VALUE(A, cd, K, kg, m, mol, s, rad, sr)
Creates the internal value used by duds::Unit in a way that allows the compiler to generate a constan...
Definition: Unit.hpp:678
constexpr Unit Mole(DUDS_UNIT_VALUE(0, 0, 0, 0, 0, 1, 0, 0, 0))
constexpr Unit Henry(DUDS_UNIT_VALUE(-2, 0, 0, 1, 2, 0, -2, 0, 0))
constexpr Unit Second(DUDS_UNIT_VALUE(0, 0, 0, 0, 0, 0, 1, 0, 0))
constexpr Unit Kelvin(DUDS_UNIT_VALUE(0, 0, 1, 0, 0, 0, 0, 0, 0))