00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef TIMEC_H
00027 #define TIMEC_H
00028
00029 #ifdef _WIN32
00030 #include <sys/timeb.h>
00031 #define timezone timeb
00032 #else
00033 #include <sys/time.h>
00034 #endif
00035
00036 #include "../oawconfig.h"
00037
00038 OAW_BEGIN_NAMESPACE
00039
00040 class OAW_DLLMAPPING TimeC
00041 {
00042 public:
00043 TimeC();
00044 TimeC(double t);
00045 TimeC(long,long);
00046 TimeC& operator = (const TimeC& t);
00047 TimeC operator + (const TimeC& t);
00048 TimeC operator - (const TimeC& t);
00049 int operator < (const TimeC& t);
00050 int operator > (const TimeC& t);
00051 int operator <= (const TimeC& t);
00052 int operator >= (const TimeC& t);
00053 int operator == (const TimeC& t);
00054 int operator != (const TimeC& t);
00055 TimeC SetPresentTime();
00056 TimeC Set(long,long);
00057 long GetSec(){return m_sgn*m_sec;}
00058 long GetMsec(){return m_usec/1000;}
00059 long GetUsec(){return m_usec;}
00060 void SetUsec(long l){m_usec=l;}
00061 void Writeln();
00062 void Write();
00063 operator double() const;
00064 protected:
00065 struct timezone m_timezone;
00066 long m_sec;
00067 long m_usec;
00068 short m_sgn;
00069 };
00070
00071 OAW_END_NAMESPACE
00072
00073
00074 #endif
00075
00076
00077
00078
00079
00080
00081
00082