00001 00002 #ifndef d_Timestamp_h 00003 #define d_Timestamp_h 1 00004 00005 #include <ostream> 00006 00007 #include "cODMGLiteral.h" 00008 #include "oTime.h" 00009 00010 class _ODLL d_Date; 00011 class _ODLL d_Time; 00012 class _ODLL d_Interval; 00013 00014 /** 00015 * SEE ALSO: d_Date, d_Time, d_Interval 00016 */ 00017 00018 class _ODLL d_Timestamp : public oTime 00019 { 00020 public: 00021 d_Timestamp(); 00022 d_Timestamp( unsigned short year, unsigned short month = 1, 00023 unsigned short day = 1, unsigned short hour = 0, 00024 unsigned short minute = 0, float sec = 0.0 ); 00025 d_Timestamp(const d_Date&); 00026 d_Timestamp(const d_Date&, const d_Time&); 00027 d_Timestamp(const d_Timestamp&); 00028 d_Timestamp& operator=(const d_Timestamp&); 00029 d_Timestamp& operator=(const d_Date&); 00030 const d_Date& date() const; 00031 const d_Time& time() const; 00032 unsigned short year() const; 00033 unsigned short month() const; 00034 unsigned short day() const; 00035 unsigned short hour() const; 00036 unsigned short minute() const; 00037 float second() const; 00038 short tz_hour() const; 00039 short tz_minute() const; 00040 static d_Timestamp current(); 00041 d_Timestamp& operator+=(const d_Interval&); 00042 d_Timestamp& operator-=(const d_Interval&); 00043 00044 /* 00045 friend d_Timestamp operator+(const d_Timestamp&, const d_Interval&); 00046 friend d_Timestamp operator+(const d_Interval&, const d_Timestamp&); 00047 friend d_Timestamp operator-(const d_Timestamp&, const d_Interval&); 00048 friend d_Interval operator-(const d_Timestamp&, const d_Timestamp&); 00049 friend int operator==(const d_Timestamp&, const d_Timestamp&); 00050 friend int operator!= (const d_Timestamp&, const d_Timestamp&); 00051 friend int operator<(const d_Timestamp&, const d_Timestamp&); 00052 friend int operator<=(const d_Timestamp&, const d_Timestamp&); 00053 friend int operator>(const d_Timestamp&, const d_Timestamp&); 00054 friend int operator>=(const d_Timestamp&, const d_Timestamp&); 00055 friend int overlaps(const d_Timestamp&, const d_Timestamp&, 00056 const d_Timestamp&, const d_Timestamp&); 00057 friend int overlaps(const d_Timestamp&, const d_Timestamp&, 00058 const d_Date&, const d_Date&); 00059 friend int overlaps(const d_Date&, const d_Date&, 00060 const d_Timestamp&, const d_Timestamp&); 00061 friend int overlaps(const d_Timestamp&, const d_Timestamp&, 00062 const d_Time&, const d_Time&); 00063 friend int overlaps(const d_Time&, const d_Time&, 00064 const d_Timestamp&, const d_Timestamp&); 00065 friend std::ostream& operator<<(std::ostream&, const d_Timestamp&); 00066 */ 00067 }; 00068 //------------------------------------------------------------------------------ 00069 //------------------------------------------------------------------------------ 00070 00071 #endif
1.3-rc1