FirstOrderRateConstant.h

Go to the documentation of this file.
00001 
00007 /* Copyright (C) 2004 - 2009, Bernd Speiser, Kai Ludwig */
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 _FirstOrderRateConstant_h
00028 #define _FirstOrderRateConstant_h
00029 
00030 // Quantity includes
00031 #include "Quantity/Variable.h"
00032 #include "Quantity/Constant.h"
00033 #include "Quantity/QuantityCluster.h"
00034 #include "PhysicalQuantities/Time.h"
00035 
00036 namespace quantity {
00037   namespace firstOrderRateConstant {
00038 
00040 class Class;
00041 
00043 class Unit;
00044 
00046 typedef LOKI_TYPELIST_3(time::Minute, time::Second, 
00047                                             time::MilliSecond) TimeList;
00048 
00049 typedef unit::ComposeElement<Unit, TimeList, 
00050                                 BSUtilities::Rational<-1> > TimeElement;
00051 
00052 typedef unit::ComposeBase<Unit, 
00053        LOKI_TYPELIST_1(TimeElement)> FirstOrderRateConstantComposedUnit;
00054 
00055 typedef unit::Composed<FirstOrderRateConstantComposedUnit, 
00056                             LOKI_TYPELIST_1(time::Minute)> OnePerMinute;
00057 
00058 typedef unit::Composed<FirstOrderRateConstantComposedUnit, 
00059                             LOKI_TYPELIST_1(time::Second)> OnePerSecond;
00060 
00061 typedef unit::Composed<FirstOrderRateConstantComposedUnit, 
00062                   LOKI_TYPELIST_1(time::MilliSecond)> OnePerMilliSecond;
00063 
00064 
00066 typedef 
00067   LOKI_TYPELIST_3(OnePerMinute, OnePerSecond, OnePerMilliSecond) Units;
00068 
00069 /* FirstOrderRateConstant Quantity */
00070 
00071 typedef Quantity<Class> Quantity;
00072 
00073 class DerivedFirstOrderRateConstant;
00074 
00075   } // end namespace firstOrderRateConstant
00076 
00078 
00080   template<typename ST>
00081     struct Standard<firstOrderRateConstant::FirstOrderRateConstantComposedUnit, ST>
00082     {
00083       static const ST ratio;
00084       static const bool exact;
00085     };
00086 
00088 template<typename ST> const ST 
00089   Standard<firstOrderRateConstant::FirstOrderRateConstantComposedUnit, ST>::ratio = 1.0;
00090 
00092 template<typename ST> const bool 
00093   Standard<firstOrderRateConstant::FirstOrderRateConstantComposedUnit, ST>::exact = true;
00094 
00096 template<>
00097   struct QuantityTraits<firstOrderRateConstant::Class>
00098   {
00099     typedef
00100       dimension::Dimension<BSUtilities::Rational<0>,
00101         BSUtilities::Rational<0>, BSUtilities::Rational<-1>,
00102           BSUtilities::Rational<0>, BSUtilities::Rational<0>,
00103             BSUtilities::Rational<0>, BSUtilities::Rational<0> > Dimension;
00104     typedef firstOrderRateConstant::Unit UnitType;
00105     typedef firstOrderRateConstant::Units UnitList;
00106     typedef firstOrderRateConstant::OnePerSecond DefaultUnit;
00107 
00108     typedef firstOrderRateConstant::DerivedFirstOrderRateConstant DefaultDerivedQuantityType;
00109 
00110     static const std::string NameString;
00111     static const std::string SymbolString;
00112   };
00113 
00114 // the derived quantity traits template for one per second first-order rate constant
00115 template<>
00116   struct DerivedQuantityTraits<firstOrderRateConstant::Class, 
00117                                 firstOrderRateConstant::DerivedFirstOrderRateConstant>
00118   {
00119     static const bool OverwriteName = false;
00120     static const bool OverwriteSymbol = false;
00121 
00122     static const std::string NameString;
00123     static const std::string SymbolString;
00124 
00125   };
00126 
00128 typedef Variable<firstOrderRateConstant::Quantity> FirstOrderRateConstant;
00129 
00131 typedef Constant<firstOrderRateConstant::Quantity> FirstOrderRateConstantConstant;
00132 
00134 typedef QuantityVector<Variable, firstOrderRateConstant::Quantity> FirstOrderRateConstantVector;
00135 
00136 } // end namespace quantity
00137 
00138 #endif /* _FirstOrderRateConstant_h */

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