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.
inductance.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_current.h"
19 #include "magnetic_flux.h"
20 
21 namespace SI {
22 template <typename _type, class _ratio = std::ratio<1>>
24 
26 template <typename _type> using atto_henry_t = inductance_t<_type, std::atto>;
27 template <typename _type> using femto_henry_t = inductance_t<_type, std::femto>;
28 template <typename _type> using pico_henry_t = inductance_t<_type, std::pico>;
29 template <typename _type> using nano_henry_t = inductance_t<_type, std::nano>;
30 template <typename _type> using micro_henry_t = inductance_t<_type, std::micro>;
31 template <typename _type> using milli_henry_t = inductance_t<_type, std::milli>;
32 template <typename _type> using henry_t = inductance_t<_type, std::ratio<1>>;
33 template <typename _type> using kilo_henry_t = inductance_t<_type, std::kilo>;
34 template <typename _type> using mega_henry_t = inductance_t<_type, std::mega>;
35 template <typename _type> using giga_henry_t = inductance_t<_type, std::giga>;
36 template <typename _type> using tera_henry_t = inductance_t<_type, std::tera>;
37 template <typename _type> using peta_henry_t = inductance_t<_type, std::peta>;
38 template <typename _type> using exa_henry_t = inductance_t<_type, std::exa>;
39 
40 // specialize unit_symbol for usage with stream operators
41 template <>
42 struct unit_symbol<'l', std::ratio<1>> : SI::detail::unit_symbol_impl<'H'> {};
43 
44 template <typename _ratio>
45 struct unit_symbol<'l', _ratio>
46  : SI::detail::unit_symbol_impl<SI::detail::ratio_prefix<_ratio>::value,
47  'H'> {};
48 
49 namespace detail {
51 } // namespace detail
52 
53 inline namespace literals {
54 template <char... _digits> constexpr atto_henry_t<int64_t> operator""_aH() {
55  return atto_henry_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
56 }
57 
58 template <char... _digits> constexpr femto_henry_t<int64_t> operator""_fH() {
59  return femto_henry_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
60 }
61 
62 template <char... _digits> constexpr pico_henry_t<int64_t> operator""_pH() {
63  return pico_henry_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
64 }
65 
66 template <char... _digits> constexpr nano_henry_t<int64_t> operator""_nH() {
67  return nano_henry_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
68 }
69 
70 template <char... _digits> constexpr micro_henry_t<int64_t> operator""_uH() {
71  return micro_henry_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
72 }
73 
74 template <char... _digits> constexpr milli_henry_t<int64_t> operator""_mH() {
75  return milli_henry_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
76 }
77 
78 template <char... _digits> constexpr henry_t<int64_t> operator""_H() {
79  return henry_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
80 }
81 
82 template <char... _digits> constexpr kilo_henry_t<int64_t> operator""_kH() {
83  return kilo_henry_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
84 }
85 
86 template <char... _digits> constexpr mega_henry_t<int64_t> operator""_MH() {
87  return mega_henry_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
88 }
89 
90 template <char... _digits> constexpr giga_henry_t<int64_t> operator""_GH() {
91  return giga_henry_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
92 }
93 
94 template <char... _digits> constexpr tera_henry_t<int64_t> operator""_TH() {
95  return tera_henry_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
96 }
97 
98 template <char... _digits> constexpr peta_henry_t<int64_t> operator""_PH() {
99  return peta_henry_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
100 }
101 
102 template <char... _digits> constexpr exa_henry_t<int64_t> operator""_EH() {
103  return exa_henry_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
104 }
105 
106 constexpr atto_henry_t<long double> operator""_aH(long double value) {
107  return atto_henry_t<long double>{value};
108 }
109 
110 constexpr femto_henry_t<long double> operator""_fH(long double value) {
111  return femto_henry_t<long double>{value};
112 }
113 
114 constexpr pico_henry_t<long double> operator""_pH(long double value) {
115  return pico_henry_t<long double>{value};
116 }
117 
118 constexpr nano_henry_t<long double> operator""_nH(long double value) {
119  return nano_henry_t<long double>{value};
120 }
121 
122 constexpr micro_henry_t<long double> operator""_uH(long double value) {
123  return micro_henry_t<long double>{value};
124 }
125 
126 constexpr milli_henry_t<long double> operator""_mH(long double value) {
127  return milli_henry_t<long double>{value};
128 }
129 
130 constexpr henry_t<long double> operator""_H(long double value) {
131  return henry_t<long double>{value};
132 }
133 
134 constexpr kilo_henry_t<long double> operator""_kH(long double value) {
135  return kilo_henry_t<long double>{value};
136 }
137 
138 constexpr mega_henry_t<long double> operator""_MH(long double value) {
139  return mega_henry_t<long double>{value};
140 }
141 
142 constexpr giga_henry_t<long double> operator""_GH(long double value) {
143  return giga_henry_t<long double>{value};
144 }
145 
146 constexpr tera_henry_t<long double> operator""_TH(long double value) {
147  return tera_henry_t<long double>{value};
148 }
149 
150 constexpr peta_henry_t<long double> operator""_PH(long double value) {
151  return peta_henry_t<long double>{value};
152 }
153 
154 constexpr exa_henry_t<long double> operator""_EH(long double value) {
155  return exa_henry_t<long double>{value};
156 }
157 
158 } // namespace literals
159 } // 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