Main Page | Class Hierarchy | Class List | File List

Area.h

Go to the documentation of this file.
00001 
00005 /* Copyright (C) 2002 - 2006, 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 _Area_h
00026 #define _Area_h
00027 
00028 #include "Quantity/Variable.h"
00029 #include "Quantity/Constant.h"
00030 #include "Quantity/QuantityCluster.h"
00031 
00032 #include "PhysicalQuantities/Length.h"
00033 
00034 namespace quantity {
00035   namespace area {
00036 
00037 /* Area dimension */
00038 typedef BSUtilities::Rational<2> LE;
00039 typedef BSUtilities::Rational<0> M;
00040 typedef BSUtilities::Rational<0> TI;
00041 typedef BSUtilities::Rational<0> E;
00042 typedef BSUtilities::Rational<0> TE;
00043 typedef BSUtilities::Rational<0> A;
00044 typedef BSUtilities::Rational<0> LU;
00045 
00046 typedef dimension::Dimension<LE, M, TI, E, TE, A, LU> Dimension;
00047 
00049 class Unit;
00050 
00051 /* declaration of Area units */
00052 class BarnUnit;
00053 class AcreUnit;
00054 class AreUnit;
00055 class HectareUnit;
00056 
00057 /* the SquareMetre and prefixed SquareMetres */
00058 
00059 typedef LOKI_TYPELIST_3(length::Metre, length::CentiMetre, 
00060                                         length::MilliMetre) LengthList;
00061 
00062 typedef unit::ComposeElement<Unit, LengthList, 
00063                                BSUtilities::Rational<2> > LengthElement;
00064 typedef LOKI_TYPELIST_1(LengthElement) AreaCompositeList;
00065 
00066 typedef unit::ComposeBase<Unit, AreaCompositeList> SquareMetreUnits;
00067 
00068 typedef 
00069   unit::Composed<SquareMetreUnits, LOKI_TYPELIST_1(length::Metre)> 
00070                                                             SquareMetre;
00071 
00072 typedef
00073   unit::Composed<SquareMetreUnits, LOKI_TYPELIST_1(length::CentiMetre)>
00074                                                        SquareCentiMetre;
00075 
00076 typedef unit::Composed<SquareMetreUnits, 
00077                   LOKI_TYPELIST_1(length::MilliMetre)> SquareMilliMetre;
00078 
00079 /* the Barn */
00080 
00081 typedef unit::NonPrefixable<Unit, BarnUnit> Barn;
00082 
00083 /* the Acre */
00084 
00085 typedef unit::NonPrefixable<Unit, AcreUnit> Acre;
00086 
00087 /* the Are */
00088 
00089 typedef unit::NonPrefixable<Unit, AreUnit> Are;
00090 
00091 /* the Hectare */
00092 
00093 typedef unit::NonPrefixable<Unit, HectareUnit> Hectare;
00094 
00096 typedef
00097   LOKI_TYPELIST_7(SquareMetre, SquareCentiMetre, SquareMilliMetre, Barn,
00098                                               Acre, Are, Hectare) Units;
00099 
00100 /* Area quantity */
00101 
00102 typedef Quantity<Dimension, Unit, Units, SquareMetre> Quantity;
00103 
00104   }
00105 
00106 typedef Variable<area::Quantity> Area;
00107 typedef Constant<area::Quantity> AreaConstant;
00108 
00109 typedef QuantityVector<Variable, area::Quantity> AreaVector;
00110 
00111 }
00112 
00113 #endif /* _Area_h */

Generated on Mon Feb 12 18:48:49 2007 for PhysicalQuantities by doxygen 1.3.6