00001
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _PureNumber_h
00029 #define _PureNumber_h
00030
00031
00032 #include "Quantity/Variable.h"
00033 #include "Quantity/Constant.h"
00034 #include "Quantity/QuantityCluster.h"
00035
00036 namespace quantity {
00037 namespace pureNumber {
00038
00040 class Class;
00041
00043 class Unit;
00044
00045
00046 class UnityUnit;
00047
00049 typedef unit::NonPrefixable<Unit, UnityUnit> Unity;
00050
00051 typedef LOKI_TYPELIST_1(Unity) Units;
00052
00053
00054
00055 typedef Quantity<Class> Quantity;
00056
00057 class DerivedPureNumber;
00058
00059 }
00060
00062
00064 template<typename ST>
00065 struct Standard<pureNumber::Unity, ST>
00066 {
00067 static const ST ratio;
00068 static const bool exact;
00069 };
00070
00072 template<typename ST> const ST Standard<pureNumber::Unity, ST>::ratio = 1.0;
00073
00075 template<typename ST> const bool Standard<pureNumber::Unity, ST>::exact = true;
00076
00078 template<>
00079 struct QuantityTraits<pureNumber::Class>
00080 {
00081 typedef
00082 dimension::Dimension<BSUtilities::Rational<0>,
00083 BSUtilities::Rational<0>, BSUtilities::Rational<0>,
00084 BSUtilities::Rational<0>, BSUtilities::Rational<0>,
00085 BSUtilities::Rational<0>, BSUtilities::Rational<0> > Dimension;
00086 typedef pureNumber::Unit UnitType;
00087 typedef pureNumber::Units UnitList;
00088 typedef pureNumber::Unity DefaultUnit;
00089
00090 typedef pureNumber::DerivedPureNumber DefaultDerivedQuantityType;
00091
00092 static const std::string NameString;
00093 static const std::string SymbolString;
00094
00095 };
00096
00097
00098 template<>
00099 struct DerivedQuantityTraits<pureNumber::Class, pureNumber::DerivedPureNumber>
00100 {
00101 static const bool OverwriteName = false;
00102 static const bool OverwriteSymbol = false;
00103
00104 static const std::string NameString;
00105 static const std::string SymbolString;
00106
00107 };
00108
00110 typedef Variable<pureNumber::Quantity> PureNumber;
00111
00113 typedef Constant<pureNumber::Quantity> PureNumberConstant;
00114
00116 typedef QuantityVector<Variable, pureNumber::Quantity> PureNumberVector;
00117
00118 }
00119
00120 #endif