00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef _ElectricCharge_h
00027 #define _ElectricCharge_h
00028
00029
00030 #include "Quantity/Variable.h"
00031 #include "Quantity/Constant.h"
00032 #include "Quantity/QuantityCluster.h"
00033
00034 namespace quantity {
00035 namespace electricCharge {
00036
00038 class Class;
00039
00041 class Unit;
00042
00043
00044 class CoulombUnits;
00045 class FranklinUnit;
00046 class EmuUnit;
00047 class ProtonChargeUnit;
00048
00050 typedef unit::Prefixable<Unit, CoulombUnits> Coulombs;
00051
00053 typedef unit::Prefixed<Coulombs> Coulomb;
00054
00056 typedef unit::Prefixed<Coulombs, unit::Milli> MilliCoulomb;
00057
00059 typedef unit::NonPrefixable<Unit, FranklinUnit> Franklin;
00060
00062 typedef unit::NonPrefixable<Unit, EmuUnit> Emu;
00063
00065 typedef unit::NonPrefixable<Unit, ProtonChargeUnit> ProtonCharge;
00066
00068 typedef Loki::TL::Append<Coulombs::Units,
00069 LOKI_TYPELIST_3(Franklin, Emu, ProtonCharge)>::Result Units;
00070
00071
00072 typedef Coulomb C;
00073
00074
00075
00076 typedef Quantity<Class> Quantity;
00077
00078 class DerivedElectricCharge;
00079
00080 }
00081
00083
00085 template<typename ST>
00086 struct Standard<electricCharge::Coulombs, ST>
00087 {
00088 static const ST ratio;
00089 static const bool exact;
00090 };
00091
00093 template<typename ST> const ST Standard<electricCharge::Coulombs, ST>::ratio = 1.0;
00094
00096 template<typename ST> const bool Standard<electricCharge::Coulombs, ST>::exact = true;
00097
00099
00101 template<typename ST>
00102 struct Standard<electricCharge::Franklin, ST>
00103 {
00104 static const ST ratio;
00105 static const bool exact;
00106 };
00107
00109 template<typename ST> const ST Standard<electricCharge::Franklin, ST>::ratio = 3.33564e-10;
00110
00112 template<typename ST> const bool Standard<electricCharge::Franklin, ST>::exact = false;
00113
00115
00117 template<typename ST>
00118 struct Standard<electricCharge::Emu, ST>
00119 {
00120 static const ST ratio;
00121 static const bool exact;
00122 };
00123
00125 template<typename ST> const ST Standard<electricCharge::Emu, ST>::ratio = 10.0;
00126
00128 template<typename ST> const bool Standard<electricCharge::Emu, ST>::exact = true;
00129
00131
00133 template<typename ST>
00134 struct Standard<electricCharge::ProtonCharge, ST>
00135 {
00136 static const ST ratio;
00137 static const bool exact;
00138 };
00139
00141 template<typename ST> const ST Standard<electricCharge::ProtonCharge, ST>::ratio = 1.60218e-19;
00142
00144 template<typename ST> const bool Standard<electricCharge::ProtonCharge, ST>::exact = false;
00145
00147 template<>
00148 struct QuantityTraits<electricCharge::Class>
00149 {
00150 typedef
00151 dimension::Dimension<BSUtilities::Rational<0>,
00152 BSUtilities::Rational<0>, BSUtilities::Rational<1>,
00153 BSUtilities::Rational<1>, BSUtilities::Rational<0>,
00154 BSUtilities::Rational<0>, BSUtilities::Rational<0> > Dimension;
00155 typedef electricCharge::Unit UnitType;
00156 typedef electricCharge::Units UnitList;
00157 typedef electricCharge::Coulomb DefaultUnit;
00158
00159 typedef electricCharge::DerivedElectricCharge DefaultDerivedQuantityType;
00160
00161 static const std::string NameString;
00162 static const std::string SymbolString;
00163
00164 };
00165
00166
00167 template<>
00168 struct DerivedQuantityTraits<electricCharge::Class, electricCharge::DerivedElectricCharge>
00169 {
00170 static const bool OverwriteName = false;
00171 static const bool OverwriteSymbol = false;
00172
00173 static const std::string NameString;
00174 static const std::string SymbolString;
00175
00176 };
00177
00178
00180 typedef Variable<electricCharge::Quantity> ElectricCharge;
00181
00183 typedef Constant<electricCharge::Quantity> ElectricChargeConstant;
00184
00186 typedef QuantityVector<Variable, electricCharge::Quantity>
00187 ElectricChargeVector;
00188
00189 }
00190
00191 #endif