00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef _Length_h
00028 #define _Length_h
00029
00030
00031 #include "Quantities/Quantity/Variable.h"
00032 #include "Quantities/Quantity/Constant.h"
00033 #include "Quantities/Quantity/QuantityAggregates.h"
00034
00035 namespace quantity {
00036 namespace length {
00037
00039 class Class;
00040
00042 class Unit;
00043
00044
00045 class MetreUnits;
00046 class BohrUnit;
00047 class AngstromUnit;
00048 class MicronUnit;
00049 class MilliMicronUnit;
00050 class XUnit;
00051 class FermiUnit;
00052 class InchUnit;
00053 class FootUnit;
00054 class YardUnit;
00055 class MileUnit;
00056 class NauticalMileUnit;
00057 class AstronomicalUnit;
00058 class ParsecUnit;
00059 class LightYearUnit;
00060 class LightSecondUnit;
00061
00063 typedef unit::Prefixable<Unit, MetreUnits> Metres;
00064
00066 typedef unit::Prefixed<Metres> Metre;
00067 typedef unit::Prefixed<Metres, unit::Deci> DeciMetre;
00068 typedef unit::Prefixed<Metres, unit::Centi> CentiMetre;
00069 typedef unit::Prefixed<Metres, unit::Milli> MilliMetre;
00070 typedef unit::Prefixed<Metres, unit::Micro> MicroMetre;
00071 typedef unit::Prefixed<Metres, unit::Nano> NanoMetre;
00072 typedef unit::Prefixed<Metres, unit::Pico> PicoMetre;
00073 typedef unit::Prefixed<Metres, unit::Kilo> KiloMetre;
00074
00076 typedef unit::NonPrefixable<Unit, BohrUnit> Bohr;
00077
00079 typedef unit::NonPrefixable<Unit, AngstromUnit> Angstrom;
00080
00082 typedef unit::NonPrefixable<Unit, MicronUnit> Micron;
00083
00085 typedef unit::NonPrefixable<Unit, MilliMicronUnit> MilliMicron;
00086
00088 typedef unit::NonPrefixable<Unit, XUnit> X;
00089
00091 typedef unit::NonPrefixable<Unit, FermiUnit> Fermi;
00092
00094 typedef unit::NonPrefixable<Unit, InchUnit> Inch;
00095
00097 typedef unit::NonPrefixable<Unit, FootUnit> Foot;
00098
00100 typedef unit::NonPrefixable<Unit, YardUnit> Yard;
00101
00103 typedef unit::NonPrefixable<Unit, MileUnit> Mile;
00104
00106 typedef unit::NonPrefixable<Unit, NauticalMileUnit> NauticalMile;
00107
00109 typedef unit::NonPrefixable<Unit, AstronomicalUnit> Astronomical;
00110
00112 typedef unit::NonPrefixable<Unit, ParsecUnit> Parsec;
00113
00115 typedef unit::NonPrefixable<Unit, LightYearUnit> LightYear;
00116
00118 typedef unit::NonPrefixable<Unit, LightSecondUnit> LightSecond;
00119
00121 typedef Loki::Typelist<Metres, Loki::Typelist<Bohr, Loki::Typelist<Angstrom,
00122 Loki::Typelist<Micron, Loki::Typelist<MilliMicron, Loki::Typelist<X,
00123 Loki::Typelist<Fermi, Loki::Typelist<Inch, Loki::Typelist<Foot,
00124 Loki::Typelist<Yard, Loki::Typelist<Mile, Loki::Typelist<NauticalMile,
00125 Loki::Typelist<Astronomical, Loki::Typelist<Parsec,
00126 Loki::Typelist<LightYear, Loki::Typelist<LightSecond,
00127 Loki::NullType> > > > > > > > > > > > > > > > Units;
00128
00129
00130
00131 typedef Metre m;
00132 typedef MilliMetre mm;
00133 typedef KiloMetre km;
00134 typedef CentiMetre cm;
00135
00136
00137
00138 typedef Quantity<Class> Quantity;
00139 typedef quantity::Quantity<Class, int> IntQuantity;
00140
00141 class DerivedLength;
00142
00143 }
00144
00146 template<>
00147 struct QuantityTraits<length::Class>
00148 {
00149 typedef
00150 dimension::Dimension<BSUtilities::Rational<1>,
00151 BSUtilities::Rational<0>, BSUtilities::Rational<0>,
00152 BSUtilities::Rational<0>, BSUtilities::Rational<0>,
00153 BSUtilities::Rational<0>, BSUtilities::Rational<0> > Dimension;
00154 typedef length::Unit UnitType;
00155 typedef length::Units UnitList;
00156 typedef length::Metre DefaultUnit;
00157
00158 typedef length::DerivedLength DefaultDerivedQuantityType;
00159
00160 static const std::string NameString ();
00161 static const std::string SymbolString ();
00162
00163 };
00164
00165
00166 template<>
00167 struct DerivedQuantityTraits<length::Class, length::DerivedLength>
00168 {
00169 static const bool OverwriteName = false;
00170 static const bool OverwriteSymbol = false;
00171
00172 static const std::string NameString ();
00173 static const std::string SymbolString ();
00174
00175 };
00176
00178 typedef Variable<length::Quantity> Length;
00179
00181 typedef Variable<length::IntQuantity> IntLength;
00182
00184 typedef Constant<length::Quantity> LengthConstant;
00185
00187 typedef VariableVector<QuantityVector<length::Class> > LengthVector;
00188
00189 }
00190
00191 #endif