Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

d_Interval.h

Go to the documentation of this file.
00001 
00002 #ifndef d_Interval_h
00003 #define d_Interval_h 1
00004 
00005 #include <ostream>
00006 
00007 #include "cODMGLiteral.h"
00008 #include "d_Object.h"
00009 
00010 class _ODLL d_Date;
00011 class _ODLL d_Time;
00012 class _ODLL d_Timestamp;
00013 
00014 /**
00015  * SEE ALSO: d_Date, d_Time, d_Timestamp
00016  */
00017 
00018 class d_Interval 
00019 {
00020   public:
00021     d_Interval(int day=0, int hour=0, int min=0, float sec=0.0);
00022     d_Interval(const d_Interval&);
00023     d_Interval& operator=(const d_Interval&);
00024     
00025         int day() const;
00026     int hour() const;
00027     int minute() const;
00028     float second() const;
00029     int is_zero() const;
00030     
00031         d_Interval& operator+=(const d_Interval&);
00032     d_Interval& operator-=(const d_Interval&);
00033     d_Interval& operator*=(int);
00034     d_Interval& operator/=(int);
00035     d_Interval operator-() const;
00036     friend d_Interval operator+(const d_Interval& L, const d_Interval& R);
00037     friend d_Interval operator-(const d_Interval& L, const d_Interval& R);
00038     friend d_Interval operator*(const d_Interval& L, int R);
00039     friend d_Interval operator*(int L, const d_Interval& R);
00040     friend d_Interval operator/(const d_Interval& L, int R);
00041     friend int operator==(const d_Interval& L, const d_Interval& R);
00042     friend int operator!=(const d_Interval& L, const d_Interval& R);
00043     friend int operator<(const d_Interval& L, const d_Interval& R);
00044     friend int operator<=(const d_Interval& L, const d_Interval& R);
00045     friend int operator>(const d_Interval& L, const d_Interval& R);
00046     friend int operator>=(const d_Interval& L, const d_Interval& R);
00047     friend std::ostream& operator<<(std::ostream&, const d_Interval&);
00048 
00049         // ATTRIBUTES
00050         d_Long   _day;
00051 
00052         d_Long   _hour;
00053         d_Long   _minute;
00054         d_Float  _second;
00055 };
00056 //------------------------------------------------------------------------------
00057 //------------------------------------------------------------------------------
00058 inline int d_Interval::day() const
00059 {
00060         return _day;
00061 }
00062 inline int d_Interval::hour() const
00063 {
00064         return _hour;
00065 }
00066 inline int d_Interval::minute() const
00067 {
00068         return _minute;
00069 }
00070 inline float d_Interval::second() const
00071 {
00072         return _second;
00073 }
00074 
00075 #endif

Generated on Fri Nov 29 17:12:13 2002 for Orient ODBMS Just Edition v. 2.0e by doxygen1.3-rc1