TBTK
Need a break? Support the development by playing Polarity Puzzles
Base.h
Go to the documentation of this file.
1 /* Copyright 2019 Kristofer Björnson
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
23 #ifndef COM_DAFER45_TBTK_QUANTITY_BASE
24 #define COM_DAFER45_TBTK_QUANTITY_BASE
25 
26 #include "TBTK/Quantity/Quantity.h"
27 
28 namespace TBTK{
29 namespace Quantity{
30 
33 
42 template<typename Units, typename Exponents>
43 class Base : public Quantity<Units, Exponents>{
44 public:
45  using IsBaseQuantity = std::true_type;
47 private:
48  friend void initializeBaseQuantities();
49 };
50 
51 //Angle
52 enum class AngleUnit{rad, degree};
53 enum class AngleExponent{
54  Angle = 1,
55  Charge = 0,
56  Count = 0,
57  Energy = 0,
58  Length = 0,
59  Temperature = 0,
60  Time = 0
61 };
68 
69 //Charge
70 enum class ChargeUnit{kC, C, mC, uC, nC, pC, fC, aC, Te, Ge, Me, ke, e};
71 enum class ChargeExponent{
72  Angle = 0,
73  Charge = 1,
74  Count = 0,
75  Energy = 0,
76  Length = 0,
77  Temperature = 0,
78  Time = 0
79 };
97 
98 //Count
99 enum class CountUnit{pcs, mol};
100 enum class CountExponent{
101  Angle = 0,
102  Charge = 0,
103  Count = 1,
104  Energy = 0,
105  Length = 0,
106  Temperature = 0,
107  Time = 0
108 };
115 
116 //Energy
117 enum class EnergyUnit{GeV, MeV, keV, eV, meV, ueV, J};
118 enum class EnergyExponent{
119  Angle = 0,
120  Charge = 0,
121  Count = 0,
122  Energy = 1,
123  Length = 0,
124  Temperature = 0,
125  Time = 0
126 };
138 
139 //Length
140 enum class LengthUnit{m, mm, um, nm, pm, fm, am, Ao};
141 enum class LengthExponent{
142  Angle = 0,
143  Charge = 0,
144  Count = 0,
145  Energy = 0,
146  Length = 1,
147  Temperature = 0,
148  Time = 0
149 };
162 
163 //Temperature
164 enum class TemperatureUnit{kK, K, mK, uK, nK};
165 enum class TemperatureExponent{
166  Angle = 0,
167  Charge = 0,
168  Count = 0,
169  Energy = 0,
170  Length = 0,
171  Temperature = 1,
172  Time = 0
173 };
183 
184 //Time
185 enum class TimeUnit{s, ms, us, ns, ps, fs, as};
186 enum class TimeExponent{
187  Angle = 0,
188  Charge = 0,
189  Count = 0,
190  Energy = 0,
191  Length = 0,
192  Temperature = 0,
193  Time = 1
194 };
206 
207 }; //End of namesapce Quantity
208 }; //End of namesapce TBTK
209 
210 #endif
211 
TBTK::Quantity::Base::Charge
Base< ChargeUnit, ChargeExponent > Charge
Definition: Base.h:96
TBTK::Quantity::Base::Angle
Base< AngleUnit, AngleExponent > Angle
Definition: Base.h:67
TBTK::Quantity::Base::initializeBaseQuantities
friend void initializeBaseQuantities()
TBTK::Quantity::Base::Energy
Base< EnergyUnit, EnergyExponent > Energy
Definition: Base.h:137
TBTK::Quantity::Base
Base Quantity.
Definition: Base.h:43
TBTK::Quantity::Base::Time
Base< TimeUnit, TimeExponent > Time
Definition: Base.h:205
TBTK::Quantity::initializeBaseQuantities
void initializeBaseQuantities()
Quantity.h
Base class for Quantities.
TBTK::Quantity::Base::Length
Base< LengthUnit, LengthExponent > Length
Definition: Base.h:161
TBTK::Quantity::Base::Temperature
Base< TemperatureUnit, TemperatureExponent > Temperature
Definition: Base.h:182
TBTK::Quantity::Quantity
Base class for Quantitis.
Definition: Quantity.h:168
TBTK::Quantity::Base::Count
Base< CountUnit, CountExponent > Count
Definition: Base.h:114