SI  2.5.4
A header only c++ library that provides type safety and user defined literals for handling physical values defined in the International System of Units.
illuminance.h
Go to the documentation of this file.
1 
12 #pragma once
13 
14 #include "area.h"
15 #include "detail/number_parser.h"
17 #include "detail/unit.h"
18 #include "detail/unit_symbol.h"
19 #include "luminous_flux.h"
20 
21 namespace SI {
22 template <typename _type, class _ratio = std::ratio<1>>
24 
26 template <typename _type> using atto_lux_t = illuminance_t<_type, std::atto>;
27 template <typename _type> using femto_lux_t = illuminance_t<_type, std::femto>;
28 template <typename _type> using pico_lux_t = illuminance_t<_type, std::pico>;
29 template <typename _type> using nano_lux_t = illuminance_t<_type, std::nano>;
30 template <typename _type> using micro_lux_t = illuminance_t<_type, std::micro>;
31 template <typename _type> using milli_lux_t = illuminance_t<_type, std::milli>;
32 template <typename _type> using lux_t = illuminance_t<_type, std::ratio<1>>;
33 template <typename _type> using kilo_lux_t = illuminance_t<_type, std::kilo>;
34 template <typename _type> using mega_lux_t = illuminance_t<_type, std::mega>;
35 template <typename _type> using giga_lux_t = illuminance_t<_type, std::giga>;
36 template <typename _type> using tera_lux_t = illuminance_t<_type, std::tera>;
37 template <typename _type> using peta_lux_t = illuminance_t<_type, std::peta>;
38 template <typename _type> using exa_lux_t = illuminance_t<_type, std::exa>;
39 
40 // specialize unit_symbol for usage with stream operators
41 template <>
42 struct unit_symbol<'i', std::ratio<1>>
43  : SI::detail::unit_symbol_impl<'l', 'x'> {};
44 
45 template <typename _ratio>
46 struct unit_symbol<'i', _ratio>
47  : SI::detail::unit_symbol_impl<SI::detail::ratio_prefix<_ratio>::value, 'l',
48  'x'> {};
49 
50 namespace detail {
52 } // namespace detail
53 
54 inline namespace literals {
55 template <char... _digits> constexpr atto_lux_t<int64_t> operator""_alx() {
56  return atto_lux_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
57 }
58 
59 template <char... _digits> constexpr femto_lux_t<int64_t> operator""_flx() {
60  return femto_lux_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
61 }
62 
63 template <char... _digits> constexpr pico_lux_t<int64_t> operator""_plx() {
64  return pico_lux_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
65 }
66 
67 template <char... _digits> constexpr nano_lux_t<int64_t> operator""_nlx() {
68  return nano_lux_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
69 }
70 
71 template <char... _digits> constexpr micro_lux_t<int64_t> operator""_ulx() {
72  return micro_lux_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
73 }
74 
75 template <char... _digits> constexpr milli_lux_t<int64_t> operator""_mlx() {
76  return milli_lux_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
77 }
78 
79 template <char... _digits> constexpr lux_t<int64_t> operator""_lx() {
80  return lux_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
81 }
82 
83 template <char... _digits> constexpr kilo_lux_t<int64_t> operator""_klx() {
84  return kilo_lux_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
85 }
86 
87 template <char... _digits> constexpr mega_lux_t<int64_t> operator""_Mlx() {
88  return mega_lux_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
89 }
90 
91 template <char... _digits> constexpr giga_lux_t<int64_t> operator""_Glx() {
92  return giga_lux_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
93 }
94 
95 template <char... _digits> constexpr tera_lux_t<int64_t> operator""_Tlx() {
96  return tera_lux_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
97 }
98 
99 template <char... _digits> constexpr peta_lux_t<int64_t> operator""_Plx() {
100  return peta_lux_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
101 }
102 
103 template <char... _digits> constexpr exa_lux_t<int64_t> operator""_Elx() {
104  return exa_lux_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
105 }
106 
107 constexpr atto_lux_t<long double> operator""_alx(long double value) {
108  return atto_lux_t<long double>{value};
109 }
110 
111 constexpr femto_lux_t<long double> operator""_flx(long double value) {
112  return femto_lux_t<long double>{value};
113 }
114 
115 constexpr pico_lux_t<long double> operator""_plx(long double value) {
116  return pico_lux_t<long double>{value};
117 }
118 
119 constexpr nano_lux_t<long double> operator""_nlx(long double value) {
120  return nano_lux_t<long double>{value};
121 }
122 
123 constexpr micro_lux_t<long double> operator""_ulx(long double value) {
124  return micro_lux_t<long double>{value};
125 }
126 
127 constexpr milli_lux_t<long double> operator""_mlx(long double value) {
128  return milli_lux_t<long double>{value};
129 }
130 
131 constexpr lux_t<long double> operator""_lx(long double value) {
132  return lux_t<long double>{value};
133 }
134 
135 constexpr kilo_lux_t<long double> operator""_klx(long double value) {
136  return kilo_lux_t<long double>{value};
137 }
138 
139 constexpr mega_lux_t<long double> operator""_Mlx(long double value) {
140  return mega_lux_t<long double>{value};
141 }
142 
143 constexpr giga_lux_t<long double> operator""_Glx(long double value) {
144  return giga_lux_t<long double>{value};
145 }
146 
147 constexpr tera_lux_t<long double> operator""_Tlx(long double value) {
148  return tera_lux_t<long double>{value};
149 }
150 
151 constexpr peta_lux_t<long double> operator""_Plx(long double value) {
152  return peta_lux_t<long double>{value};
153 }
154 
155 constexpr exa_lux_t<long double> operator""_Elx(long double value) {
156  return exa_lux_t<long double>{value};
157 }
158 
159 } // namespace literals
160 } // namespace SI
BUILD_UNIT_FROM_DIVISION(electric_conductance_t, electric_current_t, electric_potential_t) template< typename _type
Definition: absorbed_dose.h:18
interface class for number
Definition: number_parser.h:111
Compile time string provider for conversion of unit types to strings.
Definition: unit_symbol.h:21
base template class for holding values of type _type to be multiplied with a ratio _ratio
Definition: unit.h:51
Base struct. Unusable needs template overloading.
Definition: unit_symbol.h:64