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

Fraction.h

Go to the documentation of this file.
00001 
00005 /* Copyright (C) 2002-2004, Bernd Speiser */
00006 
00007 /* This file is part of Quantities.
00008 
00009 PhysicalQuantities is free software; you can redistribute it and/or
00010 modify it under the terms of the GNU General Public License
00011 as published by the Free Software Foundation; either version 2
00012 of the License, or (at your option) any later version.
00013 
00014 PhysicalQuantities is distributed in the hope that it will be useful,
00015 but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 GNU General Public License for more details.
00018   
00019 You should have received a copy of the GNU General Public License
00020 along with this program; if not, write to the Free Software
00021 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00022 02111-1307, USA.
00023 */
00024 
00025 #ifndef _Fraction_h
00026 #define _Fraction_h
00027 
00028 #include "Quantity/Variable.h"
00029 #include "Quantity/Constant.h"
00030 #include "Quantity/QuantityCluster.h"
00031 
00032 namespace Quantities {
00033 
00034 /* Fraction dimension */
00035 typedef BSUtilities::Rational<0> Fraction_LE;
00036 typedef BSUtilities::Rational<0> Fraction_M; 
00037 typedef BSUtilities::Rational<0> Fraction_TI;
00038 typedef BSUtilities::Rational<0> Fraction_E; 
00039 typedef BSUtilities::Rational<0> Fraction_TE;
00040 typedef BSUtilities::Rational<0> Fraction_A; 
00041 typedef BSUtilities::Rational<0> Fraction_LU;
00042 class FractionGroup
00043   {
00044     public:
00045       typedef TYPELIST_7(Fraction_LE, Fraction_M, Fraction_TI, 
00046                          Fraction_E, Fraction_TE, Fraction_A, 
00047                                                      Fraction_LU) DimTL;
00048   };
00049 
00050   namespace FractionUnits {
00051 
00052 /* declaration of Fraction unit base class */
00053 typedef Units::Unit<FractionGroup> FractionUnit;
00054 
00055 /* declaration of Fraction units */
00056 class UnityUnit;
00057 class PercentUnit;
00058 class PpmUnit;
00059 
00060 /* the unity unit */
00061 
00062 typedef Units::NonPrefixable<FractionGroup, UnityUnit> Unity;
00063 
00064 /* the percent */
00065 
00066 typedef Units::NonPrefixable<FractionGroup, PercentUnit> Percent;
00067 
00068 /* the parts per millions unit, ppm */
00069 
00070 typedef Units::NonPrefixable<FractionGroup, PpmUnit> Ppm;
00071 
00072 typedef TYPELIST_3(Unity, Percent, Ppm) FractionUnits;
00073 
00074   }
00075 
00076 /* declaration of Fraction dimension */
00077 
00078 typedef Dimensions::Dimension<FractionGroup> FractionDimension;
00079 
00080 /* Fraction quantity */
00081 
00082 typedef Quantity<FractionGroup, FractionUnits::FractionUnits,  
00083                                FractionUnits::Unity> FractionQuantities;
00084 
00085 typedef Variable<FractionQuantities> Fraction;
00086 typedef Constant<FractionQuantities> FractionConstant;
00087 
00088 typedef VariableVector<FractionQuantities> FractionVector;
00089 
00090 }
00091 
00092 #endif /* _Fraction_h */

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