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.
Loading...
Searching...
No Matches
luminous_flux.h
Go to the documentation of this file.
1
12#pragma once
13
16#include "detail/unit.h"
17#include "luminosity.h"
18#include "solid_angle.h"
19
20namespace SI {
21
22template <typename _type, class _ratio = std::ratio<1>>
23using luminous_flux_t = detail::unit_t<'m', std::ratio<1>, _type, _ratio>;
24
26template <typename _type>
28template <typename _type>
30template <typename _type>
32template <typename _type>
34template <typename _type>
36template <typename _type>
38template <typename _type> using lumen_t = luminous_flux_t<_type, std::ratio<1>>;
39template <typename _type>
41template <typename _type>
43template <typename _type>
45template <typename _type>
47template <typename _type>
49template <typename _type> using exa_lumen_t = luminous_flux_t<_type, std::exa>;
50
51// specialize unit_symbol for usage with stream operators
52template <>
53struct unit_symbol<'m', std::ratio<1>>
54 : SI::detail::unit_symbol_impl<'l', 'm'> {};
55
56template <typename _ratio>
57struct unit_symbol<'m', _ratio>
58 : SI::detail::unit_symbol_impl<SI::detail::ratio_prefix<_ratio>::value, 'l',
59 'm'> {};
60
61namespace detail {
63}
64
65inline namespace literals {
66template <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
70template <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
74template <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
78template <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
82template <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
86template <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
90template <char... _digits> constexpr lumen_t<int64_t> operator""_lm() {
91 return lumen_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
92}
93
94template <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
98template <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
102template <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
106template <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
110template <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
114template <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
118constexpr atto_lumen_t<long double> operator""_alm(long double value) {
119 return atto_lumen_t<long double>{value};
120}
121
122constexpr femto_lumen_t<long double> operator""_flm(long double value) {
123 return femto_lumen_t<long double>{value};
124}
125
126constexpr pico_lumen_t<long double> operator""_plm(long double value) {
127 return pico_lumen_t<long double>{value};
128}
129
130constexpr nano_lumen_t<long double> operator""_nlm(long double value) {
131 return nano_lumen_t<long double>{value};
132}
133
134constexpr micro_lumen_t<long double> operator""_ulm(long double value) {
135 return micro_lumen_t<long double>{value};
136}
137
138constexpr milli_lumen_t<long double> operator""_mlm(long double value) {
139 return milli_lumen_t<long double>{value};
140}
141
142constexpr lumen_t<long double> operator""_lm(long double value) {
143 return lumen_t<long double>{value};
144}
145
146constexpr kilo_lumen_t<long double> operator""_klm(long double value) {
147 return kilo_lumen_t<long double>{value};
148}
149
150constexpr mega_lumen_t<long double> operator""_Mlm(long double value) {
151 return mega_lumen_t<long double>{value};
152}
153
154constexpr giga_lumen_t<long double> operator""_Glm(long double value) {
155 return giga_lumen_t<long double>{value};
156}
157
158constexpr tera_lumen_t<long double> operator""_Tlm(long double value) {
159 return tera_lumen_t<long double>{value};
160}
161
162constexpr peta_lumen_t<long double> operator""_Plm(long double value) {
163 return peta_lumen_t<long double>{value};
164}
165
166constexpr 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