00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef _Frequency_h
00028 #define _Frequency_h
00029
00030
00031 #include "Quantity/Variable.h"
00032 #include "Quantity/Constant.h"
00033 #include "Quantity/QuantityCluster.h"
00034
00035 namespace quantity {
00036 namespace frequency {
00037
00039 class Class;
00040
00042 class Unit;
00043
00044
00045 class HertzUnits;
00046
00048 typedef unit::Prefixable<Unit, HertzUnits> Hertzs;
00049
00051 typedef unit::Prefixed<Hertzs> Hertz;
00052
00054 typedef unit::Prefixed<Hertzs, unit::Milli> MilliHertz;
00055
00057 typedef unit::Prefixed<Hertzs, unit::Kilo> KiloHertz;
00058
00060 typedef unit::Prefixed<Hertzs, unit::Mega> MegaHertz;
00061
00063 typedef unit::Prefixed<Hertzs, unit::Giga> GigaHertz;
00064
00066 typedef Hertzs::Units Units;
00067
00068
00069 typedef Hertz Hz;
00070 typedef MilliHertz mHz;
00071 typedef MegaHertz MHz;
00072 typedef GigaHertz GHz;
00073
00074
00075
00076 typedef Quantity<Class> Quantity;
00077
00078 class DerivedFrequency;
00079
00080 }
00081
00083
00085 template<typename ST>
00086 struct Standard<frequency::Hertzs, ST>
00087 {
00088 static const ST ratio;
00089 static const bool exact;
00090 };
00091
00093 template<typename ST> const ST Standard<frequency::Hertzs, ST>::ratio = 1.0;
00094
00096 template<typename ST> const bool Standard<frequency::Hertzs, ST>::exact = true;
00097
00099 template<>
00100 struct QuantityTraits<frequency::Class>
00101 {
00102 typedef
00103 dimension::Dimension<BSUtilities::Rational<0>,
00104 BSUtilities::Rational<0>, BSUtilities::Rational<-1>,
00105 BSUtilities::Rational<0>, BSUtilities::Rational<0>,
00106 BSUtilities::Rational<0>, BSUtilities::Rational<0> > Dimension;
00107 typedef frequency::Unit UnitType;
00108 typedef frequency::Units UnitList;
00109 typedef frequency::Hertz DefaultUnit;
00110
00111 typedef frequency::DerivedFrequency DefaultDerivedQuantityType;
00112
00113 static const std::string NameString;
00114 static const std::string SymbolString;
00115
00116
00117 };
00118
00119
00120 template<>
00121 struct DerivedQuantityTraits<frequency::Class, frequency::DerivedFrequency>
00122 {
00123 static const bool OverwriteName = false;
00124 static const bool OverwriteSymbol = false;
00125
00126 static const std::string NameString;
00127 static const std::string SymbolString;
00128
00129 };
00130
00132 typedef Variable<frequency::Quantity> Frequency;
00133
00135 typedef Constant<frequency::Quantity> FrequencyConstant;
00136
00138 typedef QuantityVector<Variable, frequency::Quantity> FrequencyVector;
00139
00140 }
00141
00142 #endif