Empty.h

Go to the documentation of this file.
00001 
00007 /* Copyright (C) 2006 - 2009, Bernd Speiser */
00008 
00009 /* This file is part of GeneralQuantities.
00010 
00011 GeneralQuantities 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 GeneralQuantities 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 _Empty_h
00028 #define _Empty_h
00029 
00030 // Quantity includes
00031 #include "Quantity/Variable.h"
00032 #include "Quantity/Constant.h"
00033 #include "Quantity/QuantityCluster.h"
00034 
00035 namespace quantity {
00037   namespace empty {
00038 
00040 class Class;
00041 
00043 class Unit;
00044 
00045 /* declaration of Empty units */
00046 class EmptyUnit;
00047 
00049 typedef unit::NonPrefixable<Unit, EmptyUnit> Unity;
00050 
00052 typedef LOKI_TYPELIST_1(Unity) Units;
00053 
00054 /* Empty quantity */
00055 
00056 typedef Quantity<Class> Quantity;
00057 
00058 class DerivedEmpty;
00059 
00060 } // end namespace empty
00061 
00062 
00064 
00066   template<typename ST>
00067     struct Standard<empty::Unity, ST>
00068     {
00069       static const ST ratio;
00070       static const bool exact;
00071     };
00072 
00074 template<typename ST> const ST Standard<empty::Unity, ST>::ratio = 1.0;
00075 
00077 template<typename ST> const bool Standard<empty::Unity, ST>::exact = true;
00078 
00080 template<>
00081   struct QuantityTraits<empty::Class>
00082   {
00083     typedef
00084       dimension::Dimension<BSUtilities::Rational<0>,
00085         BSUtilities::Rational<0>, BSUtilities::Rational<0>,
00086           BSUtilities::Rational<0>, BSUtilities::Rational<0>,
00087             BSUtilities::Rational<0>, BSUtilities::Rational<0> > Dimension;
00088     typedef empty::Unit UnitType;
00089     typedef empty::Units UnitList;
00090     typedef empty::Unity DefaultUnit;
00091 
00092     typedef empty::DerivedEmpty DefaultDerivedQuantityType;
00093 
00094     static const std::string NameString;
00095     static const std::string SymbolString;
00096 
00097   };
00098 
00099 // the derived quantity traits template for derived Empty
00100 template<>
00101   struct DerivedQuantityTraits<empty::Class, empty::DerivedEmpty>
00102   {
00103     static const bool OverwriteName = false;
00104     static const bool OverwriteSymbol = false;
00105 
00106     static const std::string NameString;
00107     static const std::string SymbolString;
00108 
00109   };
00110 
00112 typedef Variable<empty::Quantity> Empty;
00113 
00115 typedef Constant<empty::Quantity> EmptyConstant;
00116 
00118 typedef QuantityVector<Variable, empty::Quantity> EmptyVector;
00119 
00120   } // end namespace quantity
00121 
00122 #endif /* _Empty_h */

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