00001 00007 /* Copyright (C) 2006 - 2011, 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 "Quantities/Quantity/Variable.h" 00032 #include "Quantities/Quantity/Constant.h" 00033 #include "Quantities/Quantity/QuantityAggregates.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<Unity, Loki::NullType> Units; 00053 00054 /* Empty quantity */ 00055 00056 typedef Quantity<Class> Quantity; 00057 00058 class DerivedEmpty; 00059 00060 } // end namespace empty 00061 00063 template<> 00064 struct QuantityTraits<empty::Class> 00065 { 00066 typedef 00067 dimension::Dimension<BSUtilities::Rational<0>, 00068 BSUtilities::Rational<0>, BSUtilities::Rational<0>, 00069 BSUtilities::Rational<0>, BSUtilities::Rational<0>, 00070 BSUtilities::Rational<0>, BSUtilities::Rational<0> > Dimension; 00071 typedef empty::Unit UnitType; 00072 typedef empty::Units UnitList; 00073 typedef empty::Unity DefaultUnit; 00074 00075 typedef empty::DerivedEmpty DefaultDerivedQuantityType; 00076 00077 static const std::string NameString (); 00078 static const std::string SymbolString (); 00079 00080 }; 00081 00082 // the derived quantity traits template for derived Empty 00083 template<> 00084 struct DerivedQuantityTraits<empty::Class, empty::DerivedEmpty> 00085 { 00086 static const bool OverwriteName = false; 00087 static const bool OverwriteSymbol = false; 00088 00089 static const std::string NameString (); 00090 static const std::string SymbolString (); 00091 00092 }; 00093 00095 typedef Variable<empty::Quantity> Empty; 00096 00098 typedef Constant<empty::Quantity> EmptyConstant; 00099 00101 typedef VariableVector<QuantityVector<empty::Class> > EmptyVector; 00102 00103 } // end namespace quantity 00104 00105 #endif /* _Empty_h */