Main Page | Class Hierarchy | Class List | File List

Length.h

Go to the documentation of this file.
00001 
00007 /* Copyright (C) 2002 - 2006, Bernd Speiser */
00008 
00009 /* This file is part of Quantities.
00010 
00011 PhysicalQuantities is free software; you can redistribute it and/or
00012 modify it under the terms of the GNU General Public License
00013 as published by the Free Software Foundation; either version 2
00014 of the License, or (at your option) any later version.
00015 
00016 PhysicalQuantities is distributed in the hope that it will be useful,
00017 but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019 GNU General Public License for more details.
00020   
00021 You should have received a copy of the GNU General Public License
00022 along with this program; if not, write to the Free Software
00023 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00024 02111-1307, USA.
00025 */
00026 
00027 #ifndef _Length_h
00028 #define _Length_h
00029 
00030 #include "Quantity/Variable.h"
00031 #include "Quantity/Constant.h"
00032 #include "Quantity/QuantityCluster.h"
00033 
00034 namespace quantity {
00035   namespace length {
00036 
00037 /* Length dimension */
00038 typedef BSUtilities::Rational<1> LE;
00039 typedef BSUtilities::Rational<0> M;
00040 typedef BSUtilities::Rational<0> TI;
00041 typedef BSUtilities::Rational<0> E;
00042 typedef BSUtilities::Rational<0> TE;
00043 typedef BSUtilities::Rational<0> A;
00044 typedef BSUtilities::Rational<0> LU;
00045 typedef dimension::Dimension<LE, M, TI, E, TE, A, LU> Dimension;
00046 
00048 class Unit;
00049 
00050 /* declaration of Length units */
00051 class MetreUnits;
00052 class BohrUnit;
00053 class AngstromUnit;
00054 class MicronUnit;
00055 class MilliMicronUnit;
00056 class XUnit;
00057 class FermiUnit;
00058 class InchUnit;
00059 class FootUnit;
00060 class YardUnit;
00061 class MileUnit;
00062 class NauticalMileUnit;
00063 class AstronomicalUnit;
00064 class ParsecUnit;
00065 class LightYearUnit;
00066 class LightSecondUnit;
00067 
00068 /* the Metre and prefixed Metres */
00069 
00070 typedef unit::Prefixable<Unit, MetreUnits> Metres;
00071 
00072 typedef unit::Prefixed<Metres> Metre;
00073 typedef unit::Prefixed<Metres, unit::Deci> DeciMetre;
00074 typedef unit::Prefixed<Metres, unit::Centi> CentiMetre;
00075 typedef unit::Prefixed<Metres, unit::Milli> MilliMetre;
00076 typedef unit::Prefixed<Metres, unit::Micro> MicroMetre;
00077 typedef unit::Prefixed<Metres, unit::Nano> NanoMetre;
00078 typedef unit::Prefixed<Metres, unit::Pico> PicoMetre;
00079 typedef unit::Prefixed<Metres, unit::Kilo> KiloMetre;
00080 
00081 /* the Bohr */
00082 
00083 typedef unit::NonPrefixable<Unit, BohrUnit> Bohr;
00084 
00085 /* the Angstrom */
00086 
00087 typedef unit::NonPrefixable<Unit, AngstromUnit> Angstrom;
00088 
00089 /* the micron */
00090 
00091 typedef unit::NonPrefixable<Unit, MicronUnit> Micron;
00092 
00093 /* the millimicron */
00094 
00095 typedef unit::NonPrefixable<Unit, MilliMicronUnit> MilliMicron;
00096 
00097 /* the X */
00098 
00099 typedef unit::NonPrefixable<Unit, XUnit> X;
00100 
00101 /* the Fermi */
00102 
00103 typedef unit::NonPrefixable<Unit, FermiUnit> Fermi;
00104 
00105 /* the Inch */
00106 
00107 typedef unit::NonPrefixable<Unit, InchUnit> Inch;
00108 
00109 /* the foot */
00110 
00111 typedef unit::NonPrefixable<Unit, FootUnit> Foot;
00112 
00113 /* the Yard */
00114 
00115 typedef unit::NonPrefixable<Unit, YardUnit> Yard;
00116 
00117 /* the Mile */
00118 
00119 typedef unit::NonPrefixable<Unit, MileUnit> Mile;
00120 
00121 /* the nautical Mile */
00122 
00123 typedef unit::NonPrefixable<Unit, NauticalMileUnit> NauticalMile;
00124 
00125 /* the astronomical unit */
00126 
00127 typedef unit::NonPrefixable<Unit, AstronomicalUnit> Astronomical;
00128 
00129 /* the Parsec */
00130 
00131 typedef unit::NonPrefixable<Unit, ParsecUnit> Parsec;
00132 
00133 /* the Lightyear */
00134 
00135 typedef unit::NonPrefixable<Unit, LightYearUnit> LightYear;
00136 
00137 /* the Lightsecond */
00138 
00139 typedef unit::NonPrefixable<Unit, LightSecondUnit> LightSecond;
00140 
00142 typedef Loki::TL::Append<Metres::Units,
00143   LOKI_TYPELIST_15(Bohr, Angstrom, Micron, MilliMicron, X, Fermi, Inch,
00144              Foot, Yard, Mile, NauticalMile, Astronomical, Parsec,
00145                                  LightYear, LightSecond)>::Result Units;
00146 
00147 /* declare some abbreviated length units */
00148 
00149 typedef Metre m;
00150 typedef MilliMetre mm;
00151 typedef KiloMetre km;
00152 typedef CentiMetre cm;
00153 
00154 /* Length quantity */
00155 
00156 typedef Quantity<Dimension, Unit, Units, Metre> Quantity;
00157 
00158   }
00159 
00160 typedef Variable<length::Quantity> Length;
00161 typedef Constant<length::Quantity> LengthConstant;
00162 
00163 typedef QuantityVector<Variable, length::Quantity> LengthVector;
00164 
00165 }
00166 
00167 #endif /* _Length_h */

Generated on Mon Feb 12 18:48:49 2007 for PhysicalQuantities by doxygen 1.3.6