00001 00008 /* Copyright (C) 2002 - 2011, Bernd Speiser */ 00009 00010 /* This file is part of Quantities. 00011 00012 PhysicalQuantities is free software; you can redistribute it and/or 00013 modify it under the terms of the GNU General Public License 00014 as published by the Free Software Foundation; either version 2 00015 of the License, or (at your option) any later version. 00016 00017 PhysicalQuantities is distributed in the hope that it will be useful, 00018 but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 GNU General Public License for more details. 00021 00022 You should have received a copy of the GNU General Public License 00023 along with this program; if not, write to the Free Software 00024 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 00025 02111-1307, USA. 00026 */ 00027 00028 #ifndef _PureNumber_h 00029 #define _PureNumber_h 00030 00031 // Quantity includes 00032 #include "Quantities/Quantity/Variable.h" 00033 #include "Quantities/Quantity/Constant.h" 00034 #include "Quantities/Quantity/QuantityAggregates.h" 00035 00036 namespace quantity { 00037 namespace pureNumber { 00038 00040 class Class; 00041 00043 class Unit; 00044 00045 /* declaration of PureNumber units */ 00046 class UnityUnit; 00047 00049 typedef unit::NonPrefixable<Unit, UnityUnit> Unity; 00050 00051 typedef Loki::Typelist<Unity, Loki::NullType> Units; 00052 00053 /* PureNumber quantity */ 00054 00055 typedef Quantity<Class> Quantity; 00056 00057 class DerivedPureNumber; 00058 00059 } // end namespace pureNumber 00060 00062 template<> 00063 struct QuantityTraits<pureNumber::Class> 00064 { 00065 typedef 00066 dimension::Dimension<BSUtilities::Rational<0>, 00067 BSUtilities::Rational<0>, BSUtilities::Rational<0>, 00068 BSUtilities::Rational<0>, BSUtilities::Rational<0>, 00069 BSUtilities::Rational<0>, BSUtilities::Rational<0> > Dimension; 00070 typedef pureNumber::Unit UnitType; 00071 typedef pureNumber::Units UnitList; 00072 typedef pureNumber::Unity DefaultUnit; 00073 00074 typedef pureNumber::DerivedPureNumber DefaultDerivedQuantityType; 00075 00076 static const std::string NameString (); 00077 static const std::string SymbolString (); 00078 00079 }; 00080 00081 // the derived quantity traits template for unity pure number 00082 template<> 00083 struct DerivedQuantityTraits<pureNumber::Class, pureNumber::DerivedPureNumber> 00084 { 00085 static const bool OverwriteName = false; 00086 static const bool OverwriteSymbol = false; 00087 00088 static const std::string NameString (); 00089 static const std::string SymbolString (); 00090 00091 }; 00092 00094 typedef Variable<pureNumber::Quantity> PureNumber; 00095 00097 typedef Constant<pureNumber::Quantity> PureNumberConstant; 00098 00100 typedef VariableVector<QuantityVector<pureNumber::Class> > PureNumberVector; 00101 00102 } 00103 00104 #endif /* _PureNumber_h */