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

Generated on Mon Feb 12 18:48:50 2007 for PhysicalQuantities by doxygen 1.3.6