00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef volume_h
00027 #define volume_h
00028
00029
00030 #include "Quantities/Quantity/Variable.h"
00031 #include "Quantities/Quantity/Constant.h"
00032 #include "Quantities/PhysicalQuantities/Length.h"
00033
00034 namespace quantity {
00035 namespace volume {
00036
00038 class Class;
00039
00041 class Unit;
00042
00043
00044 class LitreUnit;
00045 class LambdaUnit;
00046 class BarrelUnit;
00047 class USGallonUnit;
00048 class UKGallonUnit;
00049
00051
00054 typedef LOKI_TYPELIST_3(length::Metre, length::CentiMetre,
00055 length::MilliMetre) LengthList;
00056
00058 typedef
00059 unit::Component<length::Units, BSUtilities::Rational<3> > LengthComponent;
00060
00061 typedef
00062 unit::ComposeBase<Unit, Loki::Typelist<LengthComponent, Loki::NullType> >
00063 VolumeComposedUnit;
00064
00065 typedef
00066 unit::Composed<VolumeComposedUnit,
00067 Loki::Typelist<length::Metre, Loki::NullType> > CubicMetre;
00068
00069 typedef unit::Composed<VolumeComposedUnit,
00070 Loki::Typelist<length::MilliMetre, Loki::NullType> > CubicMilliMetre;
00071
00072 typedef unit::Composed<VolumeComposedUnit,
00073 Loki::Typelist<length::CentiMetre, Loki::NullType> > CubicCentiMetre;
00074
00076 typedef unit::Prefixable<Unit, LitreUnit> Litres;
00077
00079 typedef unit::Prefixed<Litres> Litre;
00080
00082 typedef unit::NonPrefixable<Unit, LambdaUnit> Lambda;
00083
00085 typedef unit::NonPrefixable<Unit, BarrelUnit> Barrel;
00086
00088 typedef unit::NonPrefixable<Unit, USGallonUnit> USGallon;
00089
00090
00092 typedef unit::NonPrefixable<Unit, UKGallonUnit> UKGallon;
00093
00095 typedef Loki::Typelist<VolumeComposedUnit,
00096 Loki::Typelist <Litres, Loki::Typelist<Lambda, Loki::Typelist<Barrel,
00097 Loki::Typelist<USGallon, Loki::Typelist<UKGallon, Loki::NullType> > >
00098 > > > Units;
00099
00100
00101
00102 typedef Quantity<Class> Quantity;
00103
00104 class DerivedVolume;
00105
00106 }
00107
00109 template<>
00110 struct QuantityTraits<volume::Class>
00111 {
00112 typedef
00113 dimension::Dimension<BSUtilities::Rational<3>,
00114 BSUtilities::Rational<0>, BSUtilities::Rational<0>,
00115 BSUtilities::Rational<0>, BSUtilities::Rational<0>,
00116 BSUtilities::Rational<0>, BSUtilities::Rational<0> > Dimension;
00117 typedef volume::Unit UnitType;
00118 typedef volume::Units UnitList;
00119 typedef volume::CubicMetre DefaultUnit;
00120
00121 typedef volume::DerivedVolume DefaultDerivedQuantityType;
00122
00123 static const std::string NameString ();
00124 static const std::string SymbolString ();
00125 };
00126
00127
00128 template<>
00129 struct DerivedQuantityTraits<volume::Class, volume::DerivedVolume>
00130 {
00131 static const bool OverwriteName = false;
00132 static const bool OverwriteSymbol = false;
00133
00134 static const std::string NameString ();
00135 static const std::string SymbolString ();
00136
00137 };
00138
00140 typedef Variable<volume::Quantity> Volume;
00141
00143 typedef Constant<volume::Quantity> VolumeConstant;
00144
00146 typedef VariableVector<QuantityVector<volume::Class> > VolumeVector;
00147
00148 }
00149
00150 #endif