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

Area.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 _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 Quantities {
00035 
00036 /* Area dimension */
00037 typedef BSUtilities::Rational<2> Area_LE;
00038 typedef BSUtilities::Rational<0> Area_M;
00039 typedef BSUtilities::Rational<0> Area_TI;
00040 typedef BSUtilities::Rational<0> Area_E;
00041 typedef BSUtilities::Rational<0> Area_TE;
00042 typedef BSUtilities::Rational<0> Area_A;
00043 typedef BSUtilities::Rational<0> Area_LU;
00044 class AreaGroup
00045   {
00046     public:
00047       typedef TYPELIST_7(Area_LE, Area_M, Area_TI, Area_E,
00048                        Area_TE, Area_A, Area_LU) DimTL;
00049   };
00050 
00052   namespace AreaUnits {
00053 
00054 /* declaration of Area unit base class */
00055 typedef Units::Unit<AreaGroup> AreaUnit;
00056 
00057 /* declaration of Area units */
00058 class SquareMetreUnits;
00059 class BarnUnit;
00060 class AcreUnit;
00061 class AreUnit;
00062 class HectareUnit;
00063 
00064 /* the SquareMetre and prefixed SquareMetres */
00065 
00066 typedef TYPELIST_3(LengthUnits::Metre, LengthUnits::CentiMetre, 
00067                                     LengthUnits::MilliMetre) LengthList;
00068 
00069 typedef Units::CompoundElement<AreaGroup, LengthList, 
00070                                BSUtilities::Rational<2> > LengthElement;
00071 typedef TYPELIST_1(LengthElement) AreaCompositeList;
00072 typedef 
00073        Units::Compound<AreaGroup, AreaCompositeList> AreaCompositeUnits;
00074 
00075 typedef 
00076   Units::Composed<AreaCompositeUnits, TYPELIST_1(LengthUnits::Metre)> 
00077                                                             SquareMetre;
00078 
00079 typedef Units::Composed<AreaCompositeUnits, 
00080                   TYPELIST_1(LengthUnits::MilliMetre)> SquareMilliMetre;
00081 
00082 /* the Barn */
00083 
00084 typedef Units::NonPrefixable<AreaGroup, BarnUnit> Barn;
00085 
00086 /* the Acre */
00087 
00088 typedef Units::NonPrefixable<AreaGroup, AcreUnit> Acre;
00089 
00090 /* the Are */
00091 
00092 typedef Units::NonPrefixable<AreaGroup, AreUnit> Are;
00093 
00094 /* the Hectare */
00095 
00096 typedef Units::NonPrefixable<AreaGroup, HectareUnit> Hectare;
00097 
00099 typedef TYPELIST_6(SquareMetre, SquareMilliMetre,
00100                            Barn, Acre, Are, Hectare) AreaUnits;
00101 
00102   }
00103 
00104 /* declaration of Area dimension */
00105 
00106 typedef Dimensions::Dimension<AreaGroup> AreaDimension;
00107 
00108 /* Area quantity */
00109 
00110 typedef Quantity<AreaGroup, AreaUnits::AreaUnits,
00111                                  AreaUnits::SquareMetre> AreaQuantities;
00112 
00113 typedef Variable<AreaQuantities> Area;
00114 typedef Constant<AreaQuantities> AreaConstant;
00115 
00116 typedef VariableVector<AreaQuantities> AreaVector;
00117 
00118 }
00119 
00120 #endif /* _Area_h */

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