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

Volume.h

Go to the documentation of this file.
00001 
00005 /* Copyright (C) 2002-2004, 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 Quantities {
00033 
00034 /* Volume dimension */
00035 typedef BSUtilities::Rational<3> Volume_LE;
00036 typedef BSUtilities::Rational<0> Volume_M;
00037 typedef BSUtilities::Rational<0> Volume_TI;
00038 typedef BSUtilities::Rational<0> Volume_E;
00039 typedef BSUtilities::Rational<0> Volume_TE;
00040 typedef BSUtilities::Rational<0> Volume_A;
00041 typedef BSUtilities::Rational<0> Volume_LU;
00042 class VolumeGroup
00043   {
00044     public:
00045       typedef TYPELIST_7(Volume_LE, Volume_M, Volume_TI, Volume_E,
00046                                   Volume_TE, Volume_A, Volume_LU) DimTL;
00047   };
00048 
00050   namespace VolumeUnits {
00051 
00052 /* declaration of Volume unit base class */
00053 typedef Units::Unit<VolumeGroup> VolumeUnit;
00054 
00055 /* declaration of Volume units */
00056 class LitreUnit;
00057 class LambdaUnit;
00058 class BarrelUnit;
00059 class USGallonUnit;
00060 class UKGallonUnit;
00061 
00063 
00066 typedef TYPELIST_3(LengthUnits::Metre, LengthUnits::CentiMetre,
00067                                     LengthUnits::MilliMetre) LengthList;
00068 
00069 typedef 
00070   Units::CompoundElement<VolumeGroup, LengthList, 
00071                                BSUtilities::Rational<3> > LengthElement;
00072 typedef TYPELIST_1(LengthElement) VolumeCompoundList;
00073 typedef 
00074    Units::Compound<VolumeGroup, VolumeCompoundList> VolumeCompoundUnits;
00075 
00076 typedef 
00077   Units::Composed<VolumeCompoundUnits, TYPELIST_1(LengthUnits::Metre)> 
00078                                                              CubicMetre;
00079 
00080 typedef Units::Composed<VolumeCompoundUnits, 
00081                    TYPELIST_1(LengthUnits::MilliMetre)> CubicMilliMetre;
00082 
00083 typedef Units::Composed<VolumeCompoundUnits, 
00084                    TYPELIST_1(LengthUnits::CentiMetre)> CubicCentiMetre;
00085 
00087 typedef Units::NonPrefixable<VolumeGroup, LitreUnit> Litre;
00088 
00090 typedef Units::NonPrefixable<VolumeGroup, LambdaUnit> Lambda;
00091 
00093 typedef Units::NonPrefixable<VolumeGroup, BarrelUnit> Barrel;
00094 
00096 typedef Units::NonPrefixable<VolumeGroup, USGallonUnit> USGallon;
00097 
00098 
00100 typedef Units::NonPrefixable<VolumeGroup, UKGallonUnit> UKGallon;
00101 
00103 typedef TYPELIST_8(CubicMetre, CubicCentiMetre, CubicMilliMetre,
00104                  Litre, Lambda, Barrel, USGallon, UKGallon) VolumeUnits;
00105 
00106   }
00107 
00108 /* declaration of Volume dimension */
00109 
00110 typedef Dimensions::Dimension<VolumeGroup> VolumeDimension;
00111 
00112 /* Volume quantity */
00113 
00114 typedef Quantity<VolumeGroup, VolumeUnits::VolumeUnits,
00115                              VolumeUnits::CubicMetre> VolumeQuantities;
00116 
00117 typedef Variable<VolumeQuantities> Volume;
00118 typedef Constant<VolumeQuantities> VolumeConstant;
00119 
00120 typedef VariableVector<VolumeQuantities> VolumeVector;
00121 
00122 }
00123 
00124 #endif /* _Volume_h */

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