Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members

Length.h

Go to the documentation of this file.
00001 
00007 /* Copyright (C) 2002-2004, 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 Quantities {
00035 
00036 /* Length dimension */
00037 typedef BSUtilities::Rational<1> Length_LE;
00038 typedef BSUtilities::Rational<0> Length_M;
00039 typedef BSUtilities::Rational<0> Length_TI;
00040 typedef BSUtilities::Rational<0> Length_E;
00041 typedef BSUtilities::Rational<0> Length_TE;
00042 typedef BSUtilities::Rational<0> Length_A;
00043 typedef BSUtilities::Rational<0> Length_LU;
00044 class LengthGroup
00045   {
00046     public:
00047       typedef TYPELIST_7(Length_LE, Length_M, Length_TI, Length_E,
00048                                   Length_TE, Length_A, Length_LU) DimTL;
00049   };
00050 
00051 
00052   namespace LengthUnits {
00053 
00054 /* declaration of Length unit base class */
00055 typedef Units::Unit<LengthGroup> LengthUnit;
00056 
00057 /* declaration of Length units */
00058 class MetreUnits;
00059 class BohrUnit;
00060 class AngstromUnit;
00061 class MicronUnit;
00062 class MilliMicronUnit;
00063 class XUnit;
00064 class FermiUnit;
00065 class InchUnit;
00066 class FootUnit;
00067 class YardUnit;
00068 class MileUnit;
00069 class NauticalMileUnit;
00070 class AstronomicalUnit;
00071 class ParsecUnit;
00072 class LightYearUnit;
00073 class LightSecondUnit;
00074 
00075 /* the Metre and prefixed Metres */
00076 
00077 typedef Units::Prefixable<LengthGroup, MetreUnits> Metres;
00078 
00079 typedef Units::Prefixed<Metres> Metre;
00080 typedef Units::Prefixed<Metres, Units::Deci> DeciMetre;
00081 typedef Units::Prefixed<Metres, Units::Centi> CentiMetre;
00082 typedef Units::Prefixed<Metres, Units::Milli> MilliMetre;
00083 typedef Units::Prefixed<Metres, Units::Micro> MicroMetre;
00084 typedef Units::Prefixed<Metres, Units::Nano> NanoMetre;
00085 typedef Units::Prefixed<Metres, Units::Pico> PicoMetre;
00086 typedef Units::Prefixed<Metres, Units::Kilo> KiloMetre;
00087 
00088 /* the Bohr */
00089 
00090 typedef Units::NonPrefixable<LengthGroup, BohrUnit> Bohr;
00091 
00092 /* the Angstrom */
00093 
00094 typedef Units::NonPrefixable<LengthGroup, AngstromUnit> Angstrom;
00095 
00096 /* the micron */
00097 
00098 typedef Units::NonPrefixable<LengthGroup, MicronUnit> Micron;
00099 
00100 /* the millimicron */
00101 
00102 typedef Units::NonPrefixable<LengthGroup, MilliMicronUnit> MilliMicron;
00103 
00104 /* the X */
00105 
00106 typedef Units::NonPrefixable<LengthGroup, XUnit> X;
00107 
00108 /* the Fermi */
00109 
00110 typedef Units::NonPrefixable<LengthGroup, FermiUnit> Fermi;
00111 
00112 /* the Inch */
00113 
00114 typedef Units::NonPrefixable<LengthGroup, InchUnit> Inch;
00115 
00116 /* the foot */
00117 
00118 typedef Units::NonPrefixable<LengthGroup, FootUnit> Foot;
00119 
00120 /* the Yard */
00121 
00122 typedef Units::NonPrefixable<LengthGroup, YardUnit> Yard;
00123 
00124 /* the Mile */
00125 
00126 typedef Units::NonPrefixable<LengthGroup, MileUnit> Mile;
00127 
00128 /* the nautical Mile */
00129 
00130 typedef Units::NonPrefixable<LengthGroup, NauticalMileUnit> NauticalMile;
00131 
00132 /* the astronomical unit */
00133 
00134 typedef Units::NonPrefixable<LengthGroup, AstronomicalUnit> Astronomical;
00135 
00136 /* the Parsec */
00137 
00138 typedef Units::NonPrefixable<LengthGroup, ParsecUnit> Parsec;
00139 
00140 /* the Lightyear */
00141 
00142 typedef Units::NonPrefixable<LengthGroup, LightYearUnit> LightYear;
00143 
00144 /* the Lightsecond */
00145 
00146 typedef Units::NonPrefixable<LengthGroup, LightSecondUnit> LightSecond;
00147 
00149 typedef Loki::TL::Append<Metres::Units,
00150   TYPELIST_15(Bohr, Angstrom, Micron, MilliMicron, X, Fermi, Inch,
00151              Foot, Yard, Mile, NauticalMile, Astronomical, Parsec,
00152                            LightYear, LightSecond)>::Result LengthUnits;
00153 
00154 /* declare some abbreviated length units */
00155 
00156 typedef Metre m;
00157 typedef MilliMetre mm;
00158 typedef KiloMetre km;
00159 typedef CentiMetre cm;
00160 
00161   }
00162 
00163 /* declaration of Length dimension */
00164 
00165 typedef Dimensions::Dimension<LengthGroup> LengthDimension;
00166 
00167 /* Length quantity */
00168 
00169 typedef Quantity<LengthGroup, LengthUnits::LengthUnits,
00170                                    LengthUnits::Metre> LengthQuantities;
00171 
00172 typedef Variable<LengthQuantities> Length;
00173 typedef Constant<LengthQuantities> LengthConstant;
00174 
00175 typedef VariableVector<LengthQuantities> LengthVector;
00176 
00177 }
00178 
00179 #endif /* _Length_h */

Generated on Sun Jan 15 13:58:03 2006 for PhysicalQuantities by doxygen 1.3.6