HeterogeneousRateConstant.h

Go to the documentation of this file.
00001 
00007 /* Copyright (C) 2003 - 2009, Bernd Speiser */
00008 
00009 /* This file is part of Quantities.
00010 
00011 PhysicalQuantities is free software; you can redistribute it and/or
00012 modify it under the terms of the GNU General Public License
00013 as published by the Free Software Foundation; either version 2
00014 of the License, or (at your option) any later version.
00015 
00016 PhysicalQuantities is distributed in the hope that it will be useful,
00017 but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019 GNU General Public License for more details.
00020   
00021 You should have received a copy of the GNU General Public License
00022 along with this program; if not, write to the Free Software
00023 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00024 02111-1307, USA.
00025 */
00026 
00027 #ifndef _HeterogeneousRateConstant_h
00028 #define _HeterogeneousRateConstant_h
00029 
00030 // Quantity includes
00031 #include "Quantity/Variable.h"
00032 #include "Quantity/Constant.h"
00033 #include "Quantity/QuantityCluster.h"
00034 #include "PhysicalQuantities/Length.h"
00035 #include "PhysicalQuantities/Time.h"
00036 
00037 namespace quantity {
00038   namespace heterogeneousRateConstant {
00039 
00041 class Class;
00042 
00044 class Unit;
00045 
00046 /* the MetrePerSecond and prefixed variants */
00047 
00048 typedef LOKI_TYPELIST_3(length::Metre, length::CentiMetre,
00049                                          length::MilliMetre) LengthList;
00050 
00052 typedef 
00053   unit::ComposeElement<Unit, LengthList, 
00054                                BSUtilities::Rational<1> > LengthElement;
00055 
00056 typedef LOKI_TYPELIST_3(time::Second, time::MilliSecond,
00057                                             time::MicroSecond) TimeList;
00058 
00060 typedef unit::ComposeElement<Unit, TimeList,
00061                                 BSUtilities::Rational<-1> > TimeElement;
00062 
00063 typedef unit::ComposeBase<Unit, 
00064   LOKI_TYPELIST_2(LengthElement, TimeElement)>
00065                                   HeterogeneousRateConstantComposedUnit;
00066 
00067 typedef unit::Composed<HeterogeneousRateConstantComposedUnit, 
00068            LOKI_TYPELIST_2(length::Metre, time::Second)> MetrePerSecond;
00069 typedef unit::Composed<HeterogeneousRateConstantComposedUnit, 
00070   LOKI_TYPELIST_2(length::CentiMetre, time::Second)> 
00071                                                     CentiMetrePerSecond;
00072 
00074 typedef LOKI_TYPELIST_2(MetrePerSecond, CentiMetrePerSecond) Units;
00075 
00076 /* HeterogeneousRateConstant quantity */
00077 
00078 typedef Quantity<Class> Quantity;
00079 
00080 class DerivedHeterogeneousRateConstant;
00081 
00082   } // end namespace heterogeneousRateConstant
00083 
00085 
00087   template<typename ST>
00088     struct Standard<heterogeneousRateConstant::HeterogeneousRateConstantComposedUnit, ST>
00089     {
00090       static const ST ratio;
00091       static const bool exact;
00092     };
00093 
00095 template<typename ST> const ST 
00096   Standard<heterogeneousRateConstant::HeterogeneousRateConstantComposedUnit, ST>::ratio = 1.0;
00097 
00099 template<typename ST> const bool 
00100   Standard<heterogeneousRateConstant::HeterogeneousRateConstantComposedUnit, ST>::exact = true;
00101 
00103 template<>
00104   struct QuantityTraits<heterogeneousRateConstant::Class>
00105   {
00106     typedef
00107       dimension::Dimension<BSUtilities::Rational<1>,
00108         BSUtilities::Rational<0>, BSUtilities::Rational<-1>,
00109           BSUtilities::Rational<0>, BSUtilities::Rational<0>,
00110             BSUtilities::Rational<0>, BSUtilities::Rational<0> > Dimension;
00111     typedef heterogeneousRateConstant::Unit UnitType;
00112     typedef heterogeneousRateConstant::Units UnitList;
00113     typedef heterogeneousRateConstant::MetrePerSecond DefaultUnit;
00114 
00115     typedef heterogeneousRateConstant::DerivedHeterogeneousRateConstant DefaultDerivedQuantityType;
00116 
00117     static const std::string NameString;
00118     static const std::string SymbolString;
00119 
00120   };
00121 
00122 // the derived quantity traits template for MetrePerSecond HeterogeneousRateConstant
00123 template<>
00124   struct DerivedQuantityTraits<heterogeneousRateConstant::Class, 
00125                                          heterogeneousRateConstant::DerivedHeterogeneousRateConstant>
00126   {
00127     static const bool OverwriteName = false;
00128     static const bool OverwriteSymbol = false;
00129 
00130     static const std::string NameString;
00131     static const std::string SymbolString;
00132 
00133   };
00134 
00135 
00137 typedef Variable<heterogeneousRateConstant::Quantity> HeterogeneousRateConstant;
00138 
00140 typedef Constant<heterogeneousRateConstant::Quantity> HeterogeneousRateConstantConstant;
00141 
00143 typedef QuantityVector<Variable, heterogeneousRateConstant::Quantity> HeterogeneousRateConstantVector;
00144 
00145 }
00146 
00147 #endif /* _HeterogeneousRateConstant_h */

Generated on Mon Jul 27 15:55:45 2009 for Quantities by  doxygen 1.5.3