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.
luminous_flux.h
Go to the documentation of this file.
1 
12 #pragma once
13 
14 #include "detail/number_parser.h"
16 #include "detail/unit.h"
17 #include "luminosity.h"
18 #include "solid_angle.h"
19 
20 namespace SI {
21 
22 template <typename _type, class _ratio = std::ratio<1>>
24 
26 template <typename _type>
28 template <typename _type>
30 template <typename _type>
32 template <typename _type>
34 template <typename _type>
36 template <typename _type>
38 template <typename _type> using lumen_t = luminous_flux_t<_type, std::ratio<1>>;
39 template <typename _type>
41 template <typename _type>
43 template <typename _type>
45 template <typename _type>
47 template <typename _type>
49 template <typename _type> using exa_lumen_t = luminous_flux_t<_type, std::exa>;
50 
51 // specialize unit_symbol for usage with stream operators
52 template <>
53 struct unit_symbol<'m', std::ratio<1>>
54  : SI::detail::unit_symbol_impl<'l', 'm'> {};
55 
56 template <typename _ratio>
57 struct unit_symbol<'m', _ratio>
58  : SI::detail::unit_symbol_impl<SI::detail::ratio_prefix<_ratio>::value, 'l',
59  'm'> {};
60 
61 namespace detail {
63 }
64 
65 inline namespace literals {
66 template <char... _digits> constexpr atto_lumen_t<int64_t> operator""_alm() {
67  return atto_lumen_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
68 }
69 
70 template <char... _digits> constexpr femto_lumen_t<int64_t> operator""_flm() {
71  return femto_lumen_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
72 }
73 
74 template <char... _digits> constexpr pico_lumen_t<int64_t> operator""_plm() {
75  return pico_lumen_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
76 }
77 
78 template <char... _digits> constexpr nano_lumen_t<int64_t> operator""_nlm() {
79  return nano_lumen_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
80 }
81 
82 template <char... _digits> constexpr micro_lumen_t<int64_t> operator""_ulm() {
83  return micro_lumen_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
84 }
85 
86 template <char... _digits> constexpr milli_lumen_t<int64_t> operator""_mlm() {
87  return milli_lumen_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
88 }
89 
90 template <char... _digits> constexpr lumen_t<int64_t> operator""_lm() {
91  return lumen_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
92 }
93 
94 template <char... _digits> constexpr kilo_lumen_t<int64_t> operator""_klm() {
95  return kilo_lumen_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
96 }
97 
98 template <char... _digits> constexpr mega_lumen_t<int64_t> operator""_Mlm() {
99  return mega_lumen_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
100 }
101 
102 template <char... _digits> constexpr giga_lumen_t<int64_t> operator""_Glm() {
103  return giga_lumen_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
104 }
105 
106 template <char... _digits> constexpr tera_lumen_t<int64_t> operator""_Tlm() {
107  return tera_lumen_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
108 }
109 
110 template <char... _digits> constexpr peta_lumen_t<int64_t> operator""_Plm() {
111  return peta_lumen_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
112 }
113 
114 template <char... _digits> constexpr exa_lumen_t<int64_t> operator""_Elm() {
115  return exa_lumen_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
116 }
117 
118 constexpr atto_lumen_t<long double> operator""_alm(long double value) {
119  return atto_lumen_t<long double>{value};
120 }
121 
122 constexpr femto_lumen_t<long double> operator""_flm(long double value) {
123  return femto_lumen_t<long double>{value};
124 }
125 
126 constexpr pico_lumen_t<long double> operator""_plm(long double value) {
127  return pico_lumen_t<long double>{value};
128 }
129 
130 constexpr nano_lumen_t<long double> operator""_nlm(long double value) {
131  return nano_lumen_t<long double>{value};
132 }
133 
134 constexpr micro_lumen_t<long double> operator""_ulm(long double value) {
135  return micro_lumen_t<long double>{value};
136 }
137 
138 constexpr milli_lumen_t<long double> operator""_mlm(long double value) {
139  return milli_lumen_t<long double>{value};
140 }
141 
142 constexpr lumen_t<long double> operator""_lm(long double value) {
143  return lumen_t<long double>{value};
144 }
145 
146 constexpr kilo_lumen_t<long double> operator""_klm(long double value) {
147  return kilo_lumen_t<long double>{value};
148 }
149 
150 constexpr mega_lumen_t<long double> operator""_Mlm(long double value) {
151  return mega_lumen_t<long double>{value};
152 }
153 
154 constexpr giga_lumen_t<long double> operator""_Glm(long double value) {
155  return giga_lumen_t<long double>{value};
156 }
157 
158 constexpr tera_lumen_t<long double> operator""_Tlm(long double value) {
159  return tera_lumen_t<long double>{value};
160 }
161 
162 constexpr peta_lumen_t<long double> operator""_Plm(long double value) {
163  return peta_lumen_t<long double>{value};
164 }
165 
166 constexpr exa_lumen_t<long double> operator""_Elm(long double value) {
167  return exa_lumen_t<long double>{value};
168 }
169 
170 } // namespace literals
171 } // namespace SI
Definition: absorbed_dose.h:18
#define BUILD_UNIT_FROM_MULTIPLICATION(RESULTING_UNIT, UNIT_LHS, UNIT_RHS)
Definition: operator_helpers.h:54
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