Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members

Time.h

Go to the documentation of this file.
00001 
00007 /* Copyright (C) 2002-2004, 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 Quantities {
00035 
00036 /* Time dimension */
00037 typedef BSUtilities::Rational<0> Time_LE;
00038 typedef BSUtilities::Rational<0> Time_M; 
00039 typedef BSUtilities::Rational<1> Time_TI;
00040 typedef BSUtilities::Rational<0> Time_E; 
00041 typedef BSUtilities::Rational<0> Time_TE;
00042 typedef BSUtilities::Rational<0> Time_A; 
00043 typedef BSUtilities::Rational<0> Time_LU;
00044 class TimeGroup
00045   {
00046     public:
00047       typedef TYPELIST_7(Time_LE, Time_M, Time_TI, Time_E, 
00048                                         Time_TE, Time_A, Time_LU) DimTL;
00049   };
00050 
00052   namespace TimeUnits {
00053 
00055 typedef Units::Unit<TimeGroup> TimeUnit;
00056 
00057 /* declaration of Time units */
00058 class SecondUnits;
00059 class MinuteUnit;
00060 class HourUnit;
00061 class DayUnit;
00062 class YearUnit;
00063 class SvedbergUnit;
00064 class AtomicUnit;
00065 
00066 /* the second and prefixed seconds */
00067 
00068 typedef Units::Prefixable<TimeGroup, SecondUnits> Seconds;
00069 
00070 typedef Units::Prefixed<Seconds> Second; 
00071 typedef Units::Prefixed<Seconds, Units::Deci> DeciSecond;
00072 typedef Units::Prefixed<Seconds, Units::Milli> MilliSecond;
00073 typedef Units::Prefixed<Seconds, Units::Micro> MicroSecond;
00074 typedef Units::Prefixed<Seconds, Units::Nano> NanoSecond;
00075 typedef Units::Prefixed<Seconds, Units::Pico> PicoSecond;
00076 
00077 /* the minute */
00078 
00079 typedef Units::NonPrefixable<TimeGroup, MinuteUnit> Minute; 
00080 
00081 /* the hour */
00082 
00083 typedef Units::NonPrefixable<TimeGroup, HourUnit> Hour; 
00084 
00085 /* the day */
00086 
00087 typedef Units::NonPrefixable<TimeGroup, DayUnit> Day; 
00088 
00089 /* the year */
00090 
00091 typedef Units::NonPrefixable<TimeGroup, YearUnit> Year; 
00092 
00093 /* the Svedberg */
00094 
00095 typedef Units::NonPrefixable<TimeGroup, SvedbergUnit> Svedberg; 
00096 
00097 /* the atomic unit of time */
00098 
00099 typedef Units::NonPrefixable<TimeGroup, AtomicUnit> Atomic; 
00100 
00102 typedef Loki::TL::Append<Seconds::Units, 
00103   TYPELIST_6(Minute, Hour, Day, Year, Svedberg, Atomic)>::Result 
00104                                                               TimeUnits;
00105 
00106 /* declare some abbreviated time units */
00107 
00108 typedef Second s;
00109 typedef MilliSecond ms;
00110 typedef MicroSecond mus;
00111 typedef Minute min;
00112 
00113   }
00114 
00115 /* declaration of Time dimension */
00116 
00117 typedef Dimensions::Dimension<TimeGroup> TimeDimension;
00118 
00119 /* Time Quantity */
00120 
00121 typedef Quantity<TimeGroup, TimeUnits::TimeUnits, 
00122                                       TimeUnits::Second> TimeQuantities;
00123 
00124 typedef Variable<TimeQuantities> Time;
00125 typedef Variable<TimeQuantities, TimeUnits::Minute> MinuteTime;
00126 
00127 typedef Constant<TimeQuantities> TimeConstant;
00128 
00129 typedef VariableVector<TimeQuantities> TimeVector;
00130 }
00131 
00132 #endif /* _Time_h */

Generated on Sun Jan 15 13:58:03 2006 for PhysicalQuantities by doxygen 1.3.6