FahrenheitTemperature.h

Go to the documentation of this file.
00001 
00007 /* Copyright (C) 2004 - 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 _FahrenheitTemperature_h
00028 #define _FahrenheitTemperature_h
00029 
00030 // Quantity includes
00031 #include "Quantity/Variable.h"
00032 #include "Quantity/Constant.h"
00033 #include "Quantity/QuantityCluster.h"
00034 
00035 namespace quantity {
00036   namespace fahrenheitTemperature {
00037 
00039 class Class;
00040 
00042 class Unit;
00043 
00044 /* declaration of FahrenheitTemperature units */
00045 class DegreeFahrenheitUnit;
00046 
00048 typedef unit::NonPrefixable<Unit, DegreeFahrenheitUnit> DegreeFahrenheit;
00049 
00051 typedef LOKI_TYPELIST_1(DegreeFahrenheit) Units;
00052 
00053 /* FahrenheitTemperature quantity */
00054 
00055 typedef Quantity<Class> Quantity;
00056 
00057 class DerivedFahrenheitTemperature;
00058 
00059   } // end namespace fahrenheitTemperature
00060 
00062 
00064   template<typename ST>
00065     struct Standard<fahrenheitTemperature::DegreeFahrenheit, ST>
00066     {
00067       static const ST ratio;
00068       static const bool exact;
00069     };
00070 
00072 template<typename ST> const ST Standard<fahrenheitTemperature::DegreeFahrenheit, ST>::ratio = 1.0;
00073 
00075 template<typename ST> const bool Standard<fahrenheitTemperature::DegreeFahrenheit, ST>::exact = true;
00076 
00078 template<>
00079   struct QuantityTraits<fahrenheitTemperature::Class>
00080   {
00081     typedef
00082       dimension::Dimension<BSUtilities::Rational<0>,
00083         BSUtilities::Rational<0>, BSUtilities::Rational<0>,
00084           BSUtilities::Rational<0>, BSUtilities::Rational<1>,
00085             BSUtilities::Rational<0>, BSUtilities::Rational<0> > Dimension;
00086     typedef fahrenheitTemperature::Unit UnitType;
00087     typedef fahrenheitTemperature::Units UnitList;
00088     typedef fahrenheitTemperature::DegreeFahrenheit DefaultUnit;
00089 
00090     typedef fahrenheitTemperature::DerivedFahrenheitTemperature DefaultDerivedQuantityType;
00091 
00092     static const std::string NameString;
00093     static const std::string SymbolString;
00094 
00095   };
00096 
00097 // the derived quantity traits template for DegreeFahrenheit Fahrenheit temperature
00098 template<>
00099   struct DerivedQuantityTraits<fahrenheitTemperature::Class, 
00100                                        fahrenheitTemperature::DerivedFahrenheitTemperature>
00101   {
00102     static const bool OverwriteName = false;
00103     static const bool OverwriteSymbol = false;
00104 
00105     static const std::string NameString;
00106     static const std::string SymbolString;
00107 
00108   };
00109 
00111 typedef Variable<fahrenheitTemperature::Quantity> FahrenheitTemperature;
00112 
00114 typedef Constant<fahrenheitTemperature::Quantity> FahrenheitTemperatureConstant;
00115 
00117 typedef QuantityVector<Variable, fahrenheitTemperature::Quantity> 
00118                                             FahrenheitTemperatureVector;
00119 
00120 }
00121 
00122 #endif /* _FahrenheitTemperature_h */

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