Main Page | Class Hierarchy | Class List | File List

Time.h

Go to the documentation of this file.
00001 
00007 /* Copyright (C) 2002 - 2006, Bernd Speiser */
00008 
00009 /* This file is part of Quantities.
00010 
00011 PhysicalQuantities 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 PhysicalQuantities 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 _Time_h
00028 #define _Time_h
00029 
00030 #include "Quantity/Variable.h"
00031 #include "Quantity/Constant.h"
00032 #include "Quantity/QuantityCluster.h"
00033 
00034 namespace quantity {
00035   namespace time {
00036 
00037 /* Time dimension */
00038 typedef BSUtilities::Rational<0> LE;
00039 typedef BSUtilities::Rational<0> M; 
00040 typedef BSUtilities::Rational<1> TI;
00041 typedef BSUtilities::Rational<0> E; 
00042 typedef BSUtilities::Rational<0> TE;
00043 typedef BSUtilities::Rational<0> A; 
00044 typedef BSUtilities::Rational<0> LU;
00045 
00046 typedef dimension::Dimension<LE, M, TI, E, TE, A, LU> Dimension;
00047 
00049 class Unit;
00050 
00051 /* declaration of Time units */
00052 class SecondUnits;
00053 class MinuteUnit;
00054 class HourUnit;
00055 class DayUnit;
00056 class YearUnit;
00057 class SvedbergUnit;
00058 class AtomicUnit;
00059 
00060 /* the second and prefixed seconds */
00061 
00062 typedef unit::Prefixable<Unit, SecondUnits> Seconds;
00063 
00064 typedef unit::Prefixed<Seconds> Second; 
00065 typedef unit::Prefixed<Seconds, unit::Deci> DeciSecond;
00066 typedef unit::Prefixed<Seconds, unit::Milli> MilliSecond;
00067 typedef unit::Prefixed<Seconds, unit::Micro> MicroSecond;
00068 typedef unit::Prefixed<Seconds, unit::Nano> NanoSecond;
00069 typedef unit::Prefixed<Seconds, unit::Pico> PicoSecond;
00070 
00071 /* the minute */
00072 
00073 typedef unit::NonPrefixable<Unit, MinuteUnit> Minute; 
00074 
00075 /* the hour */
00076 
00077 typedef unit::NonPrefixable<Unit, HourUnit> Hour; 
00078 
00079 /* the day */
00080 
00081 typedef unit::NonPrefixable<Unit, DayUnit> Day; 
00082 
00083 /* the year */
00084 
00085 typedef unit::NonPrefixable<Unit, YearUnit> Year; 
00086 
00087 /* the Svedberg */
00088 
00089 typedef unit::NonPrefixable<Unit, SvedbergUnit> Svedberg; 
00090 
00091 /* the atomic unit of time */
00092 
00093 typedef unit::NonPrefixable<Unit, AtomicUnit> Atomic; 
00094 
00096 typedef Loki::TL::Append<Seconds::Units, 
00097   LOKI_TYPELIST_6(Minute, Hour, Day, Year, Svedberg, Atomic)>::Result 
00098                                                                   Units;
00099 
00100 /* declare some abbreviated time units */
00101 
00102 typedef Second s;
00103 typedef MilliSecond ms;
00104 typedef MicroSecond us;
00105 typedef Minute min;
00106 
00107 
00108 /* Time Quantity */
00109 
00110 typedef Quantity<Dimension, Unit, Units, Second> Quantity;
00111 typedef quantity::Quantity<Dimension, Unit, Units, Second, int> 
00112                                                            IntQuantity;
00113 typedef quantity::Quantity<Dimension, Unit, Units, Second, long> 
00114                                                            LongQuantity;
00115   }
00116 
00117 typedef Variable<time::Quantity> Time;
00118 typedef Variable<time::IntQuantity> IntTime;
00119 typedef Variable<time::LongQuantity> LongTime;
00120 typedef Variable<time::Quantity, time::Minute> MinuteTime;
00121 
00122 typedef Constant<time::Quantity> TimeConstant;
00123 
00124 typedef VariableVector<time::Quantity> TimeVector;
00125 }
00126 
00127 #endif /* _Time_h */

Generated on Sun Jan 15 14:05:26 2006 for PhysicalQuantities by doxygen 1.3.6