CrossFramework Library

XBase/TimeSpan.hpp

説明を見る。
00001 
00006 #if defined(XBASE_INCLUDED_TIMESPAN_HPP)
00007 #else
00008 #define XBASE_INCLUDED_TIMESPAN_HPP
00009 
00010 //------------------------------------------------------------
00011 #include <XBase/BuiltInTypes.hpp>
00012 #include <XBase/PODInheritClass.hpp>
00013 
00014 //------------------------------------------------------------
00015 namespace XBase {
00017 
00018 
00024     struct TimeSpanPOD
00025     {
00031         static const TimeSpanPOD FromTicks( s64 aTicks );
00032 
00038         static const TimeSpanPOD FromMicroseconds( s64 aUsecs );
00039 
00045         static const TimeSpanPOD FromMilliseconds( s64 aMsecs );
00046 
00052         static const TimeSpanPOD FromSeconds( s64 aSecs );
00053         
00059         static const TimeSpanPOD FromMinnutes( s64 aMinutes );
00060 
00066         static const TimeSpanPOD FromHours( s64 aHours );
00067 
00073         static const TimeSpanPOD FromDays( s64 aDays );
00074          
00079         s64 ticks()const;
00080         
00085         s64 microseconds()const;
00086         
00091         s64 milliseconds()const;
00092         
00097         s64 seconds()const;
00098         
00103         s64 minutes()const;
00104         
00109         s64 hours()const;
00110         
00115         s64 days()const;
00116          
00122         const TimeSpanPOD add( const TimeSpanPOD& aTimeSpan )const;
00123         const TimeSpanPOD operator+( const TimeSpanPOD& aTimeSpan )const; 
00124 
00130         TimeSpanPOD& addAssign( const TimeSpanPOD& aTimeSpan );
00131         TimeSpanPOD& operator+=( const TimeSpanPOD& aTimeSpan ); 
00132 
00138         const TimeSpanPOD sub( const TimeSpanPOD& aTimeSpan )const;
00139         const TimeSpanPOD operator-( const TimeSpanPOD& aTimeSpan )const; 
00140 
00146         TimeSpanPOD& subAssign( const TimeSpanPOD& aTimeSpan );
00147         TimeSpanPOD& operator-=( const TimeSpanPOD& aTimeSpan ); 
00148          
00149         // 値。直接アクセスすることは想定していない。
00150         s64 ticks_;
00151     };
00152 
00154     typedef PODInheritClass< TimeSpanPOD > TimeSpan;
00156 }
00157 //------------------------------------------------------------
00158 #endif
00159 // EOF
 全て クラス ネームスペース ファイル 関数 変数 型定義 列挙型 列挙型の値 マクロ定義