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.
magnetic_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 "detail/unit_symbol.h"
18 #include "electric_potential.h"
19 #include "time.h"
20 
21 namespace SI {
22 
24 template <typename _type, class _ratio = std::ratio<1>>
26 
28 template <typename _type>
30 template <typename _type>
32 template <typename _type>
34 template <typename _type>
36 template <typename _type>
38 template <typename _type>
40 template <typename _type> using weber_t = magnetic_flux_t<_type, std::ratio<1>>;
41 template <typename _type>
43 template <typename _type>
45 template <typename _type>
47 template <typename _type>
49 template <typename _type>
51 template <typename _type> using exa_weber_t = magnetic_flux_t<_type, std::exa>;
52 
53 // specialize unit_symbol for usage with stream operators
54 template <>
55 struct unit_symbol<'f', std::ratio<1>>
56  : SI::detail::unit_symbol_impl<'W', 'b'> {};
57 
58 template <typename _ratio>
59 struct unit_symbol<'f', _ratio>
60  : SI::detail::unit_symbol_impl<SI::detail::ratio_prefix<_ratio>::value, 'W',
61  'b'> {};
62 
63 namespace detail {
65 }
66 
67 inline namespace literals {
68 template <char... _digits> constexpr atto_weber_t<int64_t> operator""_aWb() {
69  return atto_weber_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
70 }
71 
72 template <char... _digits> constexpr femto_weber_t<int64_t> operator""_fWb() {
73  return femto_weber_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
74 }
75 
76 template <char... _digits> constexpr pico_weber_t<int64_t> operator""_pWb() {
77  return pico_weber_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
78 }
79 
80 template <char... _digits> constexpr nano_weber_t<int64_t> operator""_nWb() {
81  return nano_weber_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
82 }
83 
84 template <char... _digits> constexpr micro_weber_t<int64_t> operator""_uWb() {
85  return micro_weber_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
86 }
87 
88 template <char... _digits> constexpr milli_weber_t<int64_t> operator""_mWb() {
89  return milli_weber_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
90 }
91 
92 template <char... _digits> constexpr weber_t<int64_t> operator""_Wb() {
93  return weber_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
94 }
95 
96 template <char... _digits> constexpr kilo_weber_t<int64_t> operator""_kWb() {
97  return kilo_weber_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
98 }
99 
100 template <char... _digits> constexpr mega_weber_t<int64_t> operator""_MWb() {
101  return mega_weber_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
102 }
103 
104 template <char... _digits> constexpr giga_weber_t<int64_t> operator""_GWb() {
105  return giga_weber_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
106 }
107 
108 template <char... _digits> constexpr tera_weber_t<int64_t> operator""_TWb() {
109  return tera_weber_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
110 }
111 
112 template <char... _digits> constexpr peta_weber_t<int64_t> operator""_PWb() {
113  return peta_weber_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
114 }
115 
116 template <char... _digits> constexpr exa_weber_t<int64_t> operator""_EWb() {
117  return exa_weber_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
118 }
119 
120 constexpr atto_weber_t<long double> operator""_aWb(long double value) {
121  return atto_weber_t<long double>{value};
122 }
123 
124 constexpr femto_weber_t<long double> operator""_fWb(long double value) {
125  return femto_weber_t<long double>{value};
126 }
127 
128 constexpr pico_weber_t<long double> operator""_pWb(long double value) {
129  return pico_weber_t<long double>{value};
130 }
131 
132 constexpr nano_weber_t<long double> operator""_nWb(long double value) {
133  return nano_weber_t<long double>{value};
134 }
135 
136 constexpr micro_weber_t<long double> operator""_uWb(long double value) {
137  return micro_weber_t<long double>{value};
138 }
139 
140 constexpr milli_weber_t<long double> operator""_mWb(long double value) {
141  return milli_weber_t<long double>{value};
142 }
143 
144 constexpr weber_t<long double> operator""_Wb(long double value) {
145  return weber_t<long double>{value};
146 }
147 
148 constexpr kilo_weber_t<long double> operator""_kWb(long double value) {
149  return kilo_weber_t<long double>{value};
150 }
151 
152 constexpr mega_weber_t<long double> operator""_MWb(long double value) {
153  return mega_weber_t<long double>{value};
154 }
155 
156 constexpr giga_weber_t<long double> operator""_GWb(long double value) {
157  return giga_weber_t<long double>{value};
158 }
159 
160 constexpr tera_weber_t<long double> operator""_TWb(long double value) {
161  return tera_weber_t<long double>{value};
162 }
163 
164 constexpr peta_weber_t<long double> operator""_PWb(long double value) {
165  return peta_weber_t<long double>{value};
166 }
167 
168 constexpr exa_weber_t<long double> operator""_EWb(long double value) {
169  return exa_weber_t<long double>{value};
170 }
171 
172 } // namespace literals
173 } // 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