Main Page | Class Hierarchy | Class List | File List

Volume.h

Go to the documentation of this file.
00001 
00005 /* Copyright (C) 2002 - 2006, Bernd Speiser */
00006 /* This file is part of Quantities.
00007 
00008 PhysicalQuantities is free software; you can redistribute it and/or
00009 modify it under the terms of the GNU General Public License
00010 as published by the Free Software Foundation; either version 2
00011 of the License, or (at your option) any later version.
00012 
00013 PhysicalQuantities is distributed in the hope that it will be useful,
00014 but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 GNU General Public License for more details.
00017   
00018 You should have received a copy of the GNU General Public License
00019 along with this program; if not, write to the Free Software
00020 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00021 02111-1307, USA.
00022 */
00023 
00024 #ifndef volume_h
00025 #define volume_h
00026 
00027 #include "Quantity/Variable.h"
00028 #include "Quantity/Constant.h"
00029 
00030 #include "PhysicalQuantities/Length.h"
00031 
00032 namespace quantity {
00033   namespace volume {
00034 
00035 /* Volume dimension */
00036 typedef BSUtilities::Rational<3> LE;
00037 typedef BSUtilities::Rational<0> M;
00038 typedef BSUtilities::Rational<0> TI;
00039 typedef BSUtilities::Rational<0> E;
00040 typedef BSUtilities::Rational<0> TE;
00041 typedef BSUtilities::Rational<0> A;
00042 typedef BSUtilities::Rational<0> LU;
00043 
00044 typedef dimension::Dimension<LE, M, TI, E, TE, A, LU> Dimension;
00045 
00047 class Unit;
00048 
00049 /* declaration of Volume units */
00050 class LitreUnit;
00051 class LambdaUnit;
00052 class BarrelUnit;
00053 class USGallonUnit;
00054 class UKGallonUnit;
00055 
00057 
00060 typedef LOKI_TYPELIST_3(length::Metre, length::CentiMetre,
00061                                         length::MilliMetre) LengthList;
00062 
00063 typedef 
00064   unit::ComposeElement<Unit, LengthList, 
00065                                BSUtilities::Rational<3> > LengthElement;
00066 
00067 typedef 
00068    unit::ComposeBase<Unit, LOKI_TYPELIST_1(LengthElement)> 
00069                                                      VolumeComposedUnit;
00070 
00071 typedef 
00072   unit::Composed<VolumeComposedUnit, LOKI_TYPELIST_1(length::Metre)> 
00073                                                              CubicMetre;
00074 
00075 typedef unit::Composed<VolumeComposedUnit, 
00076                    LOKI_TYPELIST_1(length::MilliMetre)> CubicMilliMetre;
00077 
00078 typedef unit::Composed<VolumeComposedUnit, 
00079                    LOKI_TYPELIST_1(length::CentiMetre)> CubicCentiMetre;
00080 
00082 typedef unit::NonPrefixable<Unit, LitreUnit> Litre;
00083 
00085 typedef unit::NonPrefixable<Unit, LambdaUnit> Lambda;
00086 
00088 typedef unit::NonPrefixable<Unit, BarrelUnit> Barrel;
00089 
00091 typedef unit::NonPrefixable<Unit, USGallonUnit> USGallon;
00092 
00093 
00095 typedef unit::NonPrefixable<Unit, UKGallonUnit> UKGallon;
00096 
00098 typedef LOKI_TYPELIST_8(CubicMetre, CubicCentiMetre, CubicMilliMetre,
00099                        Litre, Lambda, Barrel, USGallon, UKGallon) Units;
00100 
00101 /* Volume quantity */
00102 
00103 typedef Quantity<Dimension, Unit, Units, CubicMetre> Quantity;
00104 
00105   }
00106 
00107 typedef Variable<volume::Quantity> Volume;
00108 typedef Constant<volume::Quantity> VolumeConstant;
00109 
00110 typedef QuantityVector<Variable, volume::Quantity> VolumeVector;
00111 
00112 }
00113 
00114 #endif /* volume_h */

Generated on Mon Feb 12 18:44:06 2007 for PhysicalQuantities by doxygen 1.3.6