00001
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _AvogadroConstant_h
00029 #define _AvogadroConstant_h
00030
00031
00032 #include "Quantity/UniqueConstant.h"
00033 #include "PhysicalQuantities/AmountOfSubstance.h"
00034
00035 namespace quantity {
00036 namespace avogadroConstant {
00037
00039 class Class;
00040
00042 class Unit;
00043
00044
00045
00046 typedef LOKI_TYPELIST_2(amountOfSubstance::Mole,
00047 amountOfSubstance::MilliMole) AmountOfSubstanceList;
00048
00050 typedef unit::ComposeElement<Unit,
00051 AmountOfSubstanceList, BSUtilities::Rational<-1> >
00052 AmountOfSubstanceElement;
00053
00054 typedef
00055 unit::ComposeBase<Unit, LOKI_TYPELIST_1(AmountOfSubstanceElement)>
00056 AvogadroConstantComposedUnit;
00057
00058 typedef unit::Composed<AvogadroConstantComposedUnit,
00059 LOKI_TYPELIST_1(amountOfSubstance::Mole)> OnePerMole;
00060 typedef unit::Composed<AvogadroConstantComposedUnit,
00061 LOKI_TYPELIST_1(amountOfSubstance::MilliMole)> OnePerMilliMole;
00062
00063
00065 typedef LOKI_TYPELIST_2(OnePerMole, OnePerMilliMole) Units;
00066
00067
00068
00069 typedef Quantity<Class> Quantity;
00070
00071 class DerivedAvogadroConstant;
00072
00073 }
00074
00076
00078 template<typename ST>
00079 struct Standard<avogadroConstant::AvogadroConstantComposedUnit, ST>
00080 {
00081 static const ST ratio;
00082 static const bool exact;
00083 };
00084
00086 template<typename ST> const ST Standard<avogadroConstant::AvogadroConstantComposedUnit, ST>::ratio
00087 = 1.0;
00088
00090 template<typename ST> const bool Standard<avogadroConstant::AvogadroConstantComposedUnit, ST>::exact
00091 = true;
00092
00094 template<>
00095 struct QuantityTraits<avogadroConstant::Class>
00096 {
00097 typedef
00098 dimension::Dimension<BSUtilities::Rational<0>,
00099 BSUtilities::Rational<0>, BSUtilities::Rational<0>,
00100 BSUtilities::Rational<0>, BSUtilities::Rational<0>,
00101 BSUtilities::Rational<-1>, BSUtilities::Rational<0> > Dimension;
00102 typedef avogadroConstant::Unit UnitType;
00103 typedef avogadroConstant::Units UnitList;
00104 typedef avogadroConstant::OnePerMole DefaultUnit;
00105
00106 typedef avogadroConstant::DerivedAvogadroConstant DefaultDerivedQuantityType;
00107
00108 static const std::string NameString;
00109 static const std::string SymbolString;
00110
00111 };
00112
00113
00114 template<>
00115 struct DerivedQuantityTraits<avogadroConstant::Class, avogadroConstant::DerivedAvogadroConstant>
00116 {
00117 static const bool OverwriteName = false;
00118 static const bool OverwriteSymbol = false;
00119
00120 static const std::string NameString;
00121 static const std::string SymbolString;
00122
00123 };
00124
00126 typedef Loki::SingletonHolder<UniqueConstant
00127 <avogadroConstant::Quantity> > AvogadroConstant;
00128
00130 #define AVOGADROCONSTANT AvogadroConstant::Instance()
00131
00132 }
00133
00134 #endif