00001
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _Time_h
00029 #define _Time_h
00030
00031
00032 #include "Quantities/Quantity/Variable.h"
00033 #include "Quantities/Quantity/Constant.h"
00034 #include "Quantities/Quantity/QuantityAggregates.h"
00035
00036 namespace quantity {
00037 namespace time {
00038
00040 class Class;
00041
00043 class Unit;
00044
00045
00046 class SecondUnits;
00047 class MinuteUnit;
00048 class HourUnit;
00049 class DayUnit;
00050 class YearUnit;
00051 class SvedbergUnit;
00052 class AtomicUnit;
00053
00055 typedef unit::Prefixable<Unit, SecondUnits> Seconds;
00056
00058 typedef unit::Prefixed<Seconds> Second;
00059 typedef unit::Prefixed<Seconds, unit::Deci> DeciSecond;
00060 typedef unit::Prefixed<Seconds, unit::Milli> MilliSecond;
00061 typedef unit::Prefixed<Seconds, unit::Micro> MicroSecond;
00062 typedef unit::Prefixed<Seconds, unit::Nano> NanoSecond;
00063 typedef unit::Prefixed<Seconds, unit::Pico> PicoSecond;
00064
00066 typedef unit::NonPrefixable<Unit, MinuteUnit> Minute;
00067
00069 typedef unit::NonPrefixable<Unit, HourUnit> Hour;
00070
00072 typedef unit::NonPrefixable<Unit, DayUnit> Day;
00073
00075 typedef unit::NonPrefixable<Unit, YearUnit> Year;
00076
00078 typedef unit::NonPrefixable<Unit, SvedbergUnit> Svedberg;
00079
00081 typedef unit::NonPrefixable<Unit, AtomicUnit> Atomic;
00082
00084 typedef Loki::Typelist<Seconds, Loki::Typelist<Minute, Loki::Typelist<Hour,
00085 Loki::Typelist<Day, Loki::Typelist<Year, Loki::Typelist<Svedberg,
00086 Loki::Typelist<Atomic, Loki::NullType> > > > > > > Units;
00087
00088
00089 typedef Second s;
00090 typedef MilliSecond ms;
00091 typedef MicroSecond us;
00092 typedef Minute min;
00093
00094
00095
00096 typedef Quantity<Class> Quantity;
00097 typedef quantity::Quantity<Class, int> IntQuantity;
00098 typedef quantity::Quantity<Class, long> LongQuantity;
00099
00100 class DerivedTime;
00101
00102 }
00103
00105 template<>
00106 struct QuantityTraits<time::Class>
00107 {
00108 typedef
00109 dimension::Dimension<BSUtilities::Rational<0>,
00110 BSUtilities::Rational<0>, BSUtilities::Rational<1>,
00111 BSUtilities::Rational<0>, BSUtilities::Rational<0>,
00112 BSUtilities::Rational<0>, BSUtilities::Rational<0> > Dimension;
00113 typedef time::Unit UnitType;
00114 typedef time::Units UnitList;
00115 typedef time::Second DefaultUnit;
00116
00117 typedef time::DerivedTime DefaultDerivedQuantityType;
00118
00119 static const std::string NameString ();
00120 static const std::string SymbolString ();
00121
00122 };
00123
00124
00125 template<>
00126 struct DerivedQuantityTraits<time::Class, time::DerivedTime>
00127 {
00128 static const bool OverwriteName = false;
00129 static const bool OverwriteSymbol = false;
00130
00131 static const std::string NameString ();
00132 static const std::string SymbolString ();
00133
00134 };
00135
00137 typedef Variable<time::Quantity> Time;
00138
00140 typedef Variable<time::IntQuantity> IntTime;
00141
00143 typedef Variable<time::LongQuantity> LongTime;
00144
00146 typedef Variable<time::Quantity,
00147 DerivedQuantity<time::Class, time::Minute> > MinuteTime;
00148
00150 typedef Constant<time::Quantity> TimeConstant;
00151
00153 typedef VariableVector<QuantityVector<time::Class> > TimeVector;
00154
00155 }
00156
00157 #endif