00001 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 #ifndef _Area_h
00028 #define _Area_h
00029 
00030 
00031 #include "Quantities/Quantity/Variable.h"
00032 #include "Quantities/Quantity/Constant.h"
00033 #include "Quantities/Quantity/QuantityAggregates.h"
00034 #include "Quantities/PhysicalQuantities/Length.h"
00035 
00036 namespace quantity {
00037   namespace area {
00038 
00040 class Class;
00041 
00043 class Unit;
00044 
00045 
00046 class BarnUnit;
00047 class AcreUnit;
00048 class AreUnit;
00049 class HectareUnit;
00050 
00052 typedef unit::Component<length::Units, 
00053                                BSUtilities::Rational<2> > LengthComponent;
00054 
00055 typedef unit::ComposeBase<Unit, Loki::Typelist<LengthComponent, 
00056                                        Loki::NullType> > SquareMetreUnit;
00057 
00058 typedef 
00059   unit::Composed<SquareMetreUnit, Loki::Typelist<length::Metre, 
00060                                            Loki::NullType> > SquareMetre;
00061 
00062 typedef
00063   unit::Composed<SquareMetreUnit, Loki::Typelist<length::CentiMetre, 
00064                                       Loki::NullType> > SquareCentiMetre;
00065 
00066 typedef unit::Composed<SquareMetreUnit, Loki::Typelist<length::MilliMetre, 
00067                                       Loki::NullType> > SquareMilliMetre;
00068 
00070 typedef unit::NonPrefixable<Unit, BarnUnit> Barn;
00071 
00073 typedef unit::NonPrefixable<Unit, AcreUnit> Acre;
00074 
00076 typedef unit::NonPrefixable<Unit, AreUnit> Are;
00077 
00079 typedef unit::NonPrefixable<Unit, HectareUnit> Hectare;
00080 
00082 typedef Loki::Typelist<SquareMetreUnit, Loki::Typelist<Barn, 
00083   Loki::Typelist<Acre, Loki::Typelist<Are, Loki::Typelist<Hectare, 
00084                                            Loki::NullType> > > > > Units;
00085 
00086 
00087 
00088 typedef Quantity<Class> Quantity;
00089 
00090 class DerivedArea;
00091 
00092   } 
00093 
00095 template<>
00096   struct QuantityTraits<area::Class>
00097   {
00098     typedef
00099       dimension::Dimension<BSUtilities::Rational<2>,
00100         BSUtilities::Rational<0>, BSUtilities::Rational<0>,
00101           BSUtilities::Rational<0>, BSUtilities::Rational<0>,
00102             BSUtilities::Rational<0>, BSUtilities::Rational<0> > Dimension;
00103     typedef area::Unit UnitType;
00104     typedef area::Units UnitList;
00105     typedef area::SquareMetre DefaultUnit;
00106 
00107     typedef area::DerivedArea DefaultDerivedQuantityType;
00108 
00109     static const std::string NameString ();
00110     static const std::string SymbolString ();
00111   };
00112 
00113 
00114 template<>
00115   struct DerivedQuantityTraits<area::Class, area::DerivedArea>
00116   {
00117     static const bool OverwriteName = false;
00118     static const bool OverwriteSymbol = false;
00119 
00120     static const std::string NameString ();
00121     static const std::string SymbolString ();
00122 
00123   };
00124 
00125 
00127 typedef Variable<area::Quantity> Area;
00128 
00130 typedef Constant<area::Quantity> AreaConstant;
00131 
00133 typedef VariableVector<QuantityVector<area::Class> > AreaVector;
00134 
00135 } 
00136 
00137 #endif