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

Mass.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 _Mass_h
00028 #define _Mass_h
00029 
00030 #include "Quantity/Variable.h"
00031 #include "Quantity/Constant.h"
00032 #include "Quantity/QuantityCluster.h"
00033 
00034 namespace Quantities {
00035 
00036 /* Mass dimension */
00037 typedef BSUtilities::Rational<0> Mass_LE;
00038 typedef BSUtilities::Rational<1> Mass_M;
00039 typedef BSUtilities::Rational<0> Mass_TI;
00040 typedef BSUtilities::Rational<0> Mass_E;
00041 typedef BSUtilities::Rational<0> Mass_TE;
00042 typedef BSUtilities::Rational<0> Mass_A;
00043 typedef BSUtilities::Rational<0> Mass_LU;
00044 
00045 class MassGroup
00046   {
00047     public:
00048       typedef TYPELIST_7(Mass_LE, Mass_M, Mass_TI, Mass_E,
00049                                         Mass_TE, Mass_A, Mass_LU) DimTL;
00050   };
00051 
00052 
00053   namespace MassUnits {
00054 
00055 /* declaration of Mass unit base class */
00056 typedef Units::Unit<MassGroup> MassUnit;
00057 
00058 /* declaration of Mass units */
00059 class GramUnits;
00060 class ElectronMassUnit;
00061 class DaltonUnit;
00062 class UUnit;
00063 class GammaUnit;
00064 class TonneUnits;
00065 class PoundUnit;
00066 class OunceUnit;
00067 class TroyOunceUnit;
00068 class GrainUnit;
00069 
00070 /* the gram and prefixed grams */
00071 
00072 typedef Units::Prefixable<MassGroup, GramUnits> Grams;
00073 
00074 typedef Units::Prefixed<Grams> Gram;
00075 typedef Units::Prefixed<Grams, Units::Milli> MilliGram;
00076 typedef Units::Prefixed<Grams, Units::Micro> MicroGram;
00077 typedef Units::Prefixed<Grams, Units::Nano> NanoGram;
00078 typedef Units::Prefixed<Grams, Units::Pico> PicoGram;
00079 typedef Units::Prefixed<Grams, Units::Kilo> KiloGram;
00080 
00081 /* the electron mass */
00082 
00083 typedef Units::NonPrefixable<MassGroup, ElectronMassUnit> ElectronMass;
00084 
00085 /* the Dalton */
00086 
00087 typedef Units::NonPrefixable<MassGroup, DaltonUnit> Dalton;
00088 
00089 /* the u mass unit */
00090 
00091 typedef Units::NonPrefixable<MassGroup, UUnit> U;
00092 
00093 /* the gamma */
00094 
00095 typedef Units::NonPrefixable<MassGroup, GammaUnit> Gamma;
00096 
00097 /* the tonne */
00098 typedef Units::Prefixable<MassGroup, TonneUnits> Tonnes;
00099 
00100 typedef Units::Prefixed<Tonnes> Tonne;
00101 typedef Units::Prefixed<Tonnes, Units::Kilo> KiloTonne;
00102 typedef Units::Prefixed<Tonnes, Units::Mega> MegaTonne;
00103 
00104 /* the pound */
00105 
00106 typedef Units::NonPrefixable<MassGroup, PoundUnit> Pound;
00107 
00108 /* the ounce */
00109 
00110 typedef Units::NonPrefixable<MassGroup, OunceUnit> Ounce;
00111 
00112 /* the troy ounce */
00113 
00114 typedef Units::NonPrefixable<MassGroup, TroyOunceUnit> TroyOunce;
00115 
00116 /* the grain */
00117 
00118 typedef Units::NonPrefixable<MassGroup, GrainUnit> Grain;
00119 
00120 typedef Loki::TL::Append<Grams::Units, Tonne::Units>::Result 
00121                                                   MassUnitsIntermediate;
00122 typedef Loki::TL::Append<MassUnitsIntermediate, 
00123   TYPELIST_8(ElectronMass, Dalton, U, Gamma, Pound, Ounce, TroyOunce, 
00124                                               Grain)>::Result MassUnits;
00125 
00126 /* declare some abbreviated time units */
00127 
00128 typedef Gram g;
00129 typedef KiloGram kg;
00130 
00131   }
00132 
00133 /* declaration of Mass dimension */
00134 
00135 typedef Dimensions::Dimension<MassGroup> MassDimension;
00136 
00137 /* Mass quantity */
00138 
00139 typedef Quantity<MassGroup, MassUnits::MassUnits,
00140                                     MassUnits::KiloGram> MassQuantities;
00141 
00142 typedef Variable<MassQuantities> Mass;
00143 typedef Constant<MassQuantities> MassConstant;
00144 
00145 typedef VariableVector<MassQuantities> MassVector;
00146 
00147 }
00148 
00149 #endif /* _Mass_h */

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