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.
equivalent_dose.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 
19 namespace SI {
20 
21 template <typename _type, class _ratio = std::ratio<1>>
23 
25 template <typename _type>
27 template <typename _type>
29 template <typename _type>
31 template <typename _type>
33 template <typename _type>
35 template <typename _type>
37 template <typename _type>
39 template <typename _type>
41 template <typename _type>
43 template <typename _type>
45 template <typename _type>
47 template <typename _type>
49 template <typename _type>
51 
52 // specialize unit_symbol for usage with stream operators
53 template <>
54 struct unit_symbol<'H', std::ratio<1>>
55  : SI::detail::unit_symbol_impl<'S', 'v'> {};
56 
57 template <typename _ratio>
58 struct unit_symbol<'H', _ratio>
59  : SI::detail::unit_symbol_impl<SI::detail::ratio_prefix<_ratio>::value, 'S',
60  'v'> {};
61 
62 inline namespace literals {
63 template <char... _digits> constexpr atto_sievert_t<int64_t> operator""_aSv() {
65  SI::detail::parsing::Number<_digits...>::value};
66 }
67 
68 template <char... _digits> constexpr femto_sievert_t<int64_t> operator""_fSv() {
70  SI::detail::parsing::Number<_digits...>::value};
71 }
72 
73 template <char... _digits> constexpr pico_sievert_t<int64_t> operator""_pSv() {
75  SI::detail::parsing::Number<_digits...>::value};
76 }
77 
78 template <char... _digits> constexpr nano_sievert_t<int64_t> operator""_nSv() {
80  SI::detail::parsing::Number<_digits...>::value};
81 }
82 
83 template <char... _digits> constexpr micro_sievert_t<int64_t> operator""_uSv() {
85  SI::detail::parsing::Number<_digits...>::value};
86 }
87 
88 template <char... _digits> constexpr milli_sievert_t<int64_t> operator""_mSv() {
90  SI::detail::parsing::Number<_digits...>::value};
91 }
92 
93 template <char... _digits> constexpr sievert_t<int64_t> operator""_Sv() {
94  return sievert_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
95 }
96 
97 template <char... _digits> constexpr kilo_sievert_t<int64_t> operator""_kSv() {
99  SI::detail::parsing::Number<_digits...>::value};
100 }
101 
102 template <char... _digits> constexpr mega_sievert_t<int64_t> operator""_MSv() {
104  SI::detail::parsing::Number<_digits...>::value};
105 }
106 
107 template <char... _digits> constexpr giga_sievert_t<int64_t> operator""_GSv() {
109  SI::detail::parsing::Number<_digits...>::value};
110 }
111 
112 template <char... _digits> constexpr tera_sievert_t<int64_t> operator""_TSv() {
114  SI::detail::parsing::Number<_digits...>::value};
115 }
116 
117 template <char... _digits> constexpr peta_sievert_t<int64_t> operator""_PSv() {
119  SI::detail::parsing::Number<_digits...>::value};
120 }
121 
122 template <char... _digits> constexpr exa_sievert_t<int64_t> operator""_ESv() {
123  return exa_sievert_t<int64_t>{SI::detail::parsing::Number<_digits...>::value};
124 }
125 
126 constexpr atto_sievert_t<long double> operator""_aSv(long double value) {
127  return atto_sievert_t<long double>{value};
128 }
129 
130 constexpr femto_sievert_t<long double> operator""_fSv(long double value) {
131  return femto_sievert_t<long double>{value};
132 }
133 
134 constexpr pico_sievert_t<long double> operator""_pSv(long double value) {
135  return pico_sievert_t<long double>{value};
136 }
137 
138 constexpr nano_sievert_t<long double> operator""_nSv(long double value) {
139  return nano_sievert_t<long double>{value};
140 }
141 
142 constexpr micro_sievert_t<long double> operator""_uSv(long double value) {
143  return micro_sievert_t<long double>{value};
144 }
145 
146 constexpr milli_sievert_t<long double> operator""_mSv(long double value) {
147  return milli_sievert_t<long double>{value};
148 }
149 
150 constexpr sievert_t<long double> operator""_Sv(long double value) {
151  return sievert_t<long double>{value};
152 }
153 
154 constexpr kilo_sievert_t<long double> operator""_kSv(long double value) {
155  return kilo_sievert_t<long double>{value};
156 }
157 
158 constexpr mega_sievert_t<long double> operator""_MSv(long double value) {
159  return mega_sievert_t<long double>{value};
160 }
161 
162 constexpr giga_sievert_t<long double> operator""_GSv(long double value) {
163  return giga_sievert_t<long double>{value};
164 }
165 
166 constexpr tera_sievert_t<long double> operator""_TSv(long double value) {
167  return tera_sievert_t<long double>{value};
168 }
169 
170 constexpr peta_sievert_t<long double> operator""_PSv(long double value) {
171  return peta_sievert_t<long double>{value};
172 }
173 
174 constexpr exa_sievert_t<long double> operator""_ESv(long double value) {
175  return exa_sievert_t<long double>{value};
176 }
177 
178 } // namespace literals
179 } // namespace SI
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