00001 00005 /* Copyright (C) 2002 - 2009, Bernd Speiser */ 00006 /* This file is part of Quantity. 00007 00008 Quantity is free software; you can redistribute it and/or 00009 modify it under the terms of the GNU General Public License 00010 as published by the Free Software Foundation; either version 2 00011 of the License, or (at your option) any later version. 00012 00013 Quantity is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 GNU General Public License for more details. 00017 00018 You should have received a copy of the GNU General Public License 00019 along with this program; if not, write to the Free Software 00020 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 00021 02111-1307, USA. 00022 */ 00023 00024 #ifndef _Prefix_h 00025 #define _Prefix_h 00026 00027 // STL includes 00028 #include <string> 00029 00030 namespace unit { 00031 00033 00039 template<class P> class Prefix 00040 { 00041 public: 00042 00044 00049 static const double Factor; 00050 00052 00055 static const std::string Name; 00056 00058 00061 static const std::string Symbol; 00062 00063 }; 00064 00066 00068 class NoPrefix; 00069 00070 typedef Prefix<NoPrefix> No; 00071 00073 00075 class DeciPrefix; 00076 00077 typedef Prefix<DeciPrefix> Deci; 00078 00080 00082 class DeciPrefix; 00083 class CentiPrefix; 00084 00085 typedef Prefix<CentiPrefix> Centi; 00086 00088 00090 class MilliPrefix; 00091 00092 typedef Prefix<MilliPrefix> Milli; 00093 00095 00097 class MicroPrefix; 00098 00099 typedef Prefix<MicroPrefix> Micro; 00100 00102 00104 class NanoPrefix; 00105 00106 typedef Prefix<NanoPrefix> Nano; 00107 00109 00111 class PicoPrefix; 00112 00113 typedef Prefix<PicoPrefix> Pico; 00114 00116 00118 class FemtoPrefix; 00119 00120 typedef Prefix<FemtoPrefix> Femto; 00121 00123 00125 class AttoPrefix; 00126 00127 typedef Prefix<AttoPrefix> Atto; 00128 00130 00132 class ZeptoPrefix; 00133 00134 typedef Prefix<ZeptoPrefix> Zepto; 00135 00137 00139 class YoctoPrefix; 00140 00141 typedef Prefix<YoctoPrefix> Yocto; 00142 00144 00146 class DecaPrefix; 00147 00148 typedef Prefix<DecaPrefix> Deca; 00149 00151 00153 class HectoPrefix; 00154 00155 typedef Prefix<HectoPrefix> Hecto; 00156 00158 00160 class KiloPrefix; 00161 00162 typedef Prefix<KiloPrefix> Kilo; 00163 00165 00167 class MegaPrefix; 00168 00169 typedef Prefix<MegaPrefix> Mega; 00170 00172 00174 class GigaPrefix; 00175 00176 typedef Prefix<GigaPrefix> Giga; 00177 00179 00181 class TeraPrefix; 00182 00183 typedef Prefix<TeraPrefix> Tera; 00184 00186 00188 class PetaPrefix; 00189 00190 typedef Prefix<PetaPrefix> Peta; 00191 00193 00195 class ExaPrefix; 00196 00197 typedef Prefix<ExaPrefix> Exa; 00198 00200 00202 class ZettaPrefix; 00203 00204 typedef Prefix<ZettaPrefix> Zetta; 00205 00207 00209 class YottaPrefix; 00210 00211 typedef Prefix<YottaPrefix> Yotta; 00212 00213 } 00214 00215 #endif /* _Prefix_h */