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

Date_Time.i

Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 // $Id: Date_Time.i,v 1.1.1.4.2.1 2003/04/09 12:04:07 chad Exp $
00003 
00004 // Date_Time.i
00005 
00006 ASYS_INLINE void
00007 ACE_Date_Time::update (const ACE_Time_Value& timevalue)
00008 {
00009   time_t time = timevalue.sec ();
00010   struct tm tm_time;
00011   ACE_OS::localtime_r (&time, &tm_time);
00012   this->day_ = tm_time.tm_mday;
00013   this->month_ = tm_time.tm_mon + 1;    // localtime's months are 0-11
00014   this->year_ = tm_time.tm_year + 1900; // localtime reports years since 1900
00015   this->hour_ = tm_time.tm_hour;
00016   this->minute_ = tm_time.tm_min;
00017   this->second_ = tm_time.tm_sec;
00018   this->microsec_ = timevalue.usec ();
00019   this->wday_ = tm_time.tm_wday;
00020 }
00021 
00022 ASYS_INLINE void
00023 ACE_Date_Time::update (void)
00024 {
00025   ACE_TRACE ("ACE_Date_Time::update");
00026 
00027   update(ACE_OS::gettimeofday ());
00028 }
00029 
00030 ASYS_INLINE
00031 ACE_Date_Time::ACE_Date_Time (void)
00032 {
00033   ACE_TRACE ("ACE_Date_Time::ACE_Date_Time");
00034   this->update ();
00035 }
00036 
00037 // Constructor with init values, no check for validy
00038 ASYS_INLINE
00039 ACE_Date_Time::ACE_Date_Time (long day,
00040                               long month,
00041                               long year,
00042                               long hour,
00043                               long minute,
00044                               long second,
00045                               long microsec,
00046                               long wday)
00047   : day_ (day),
00048     month_ (month),
00049     year_ (year),
00050     hour_ (hour),
00051     minute_ (minute),
00052     second_ (second),
00053     microsec_ (microsec),
00054     wday_ (wday)
00055 {
00056   ACE_TRACE ("ACE_Date_Time::ACE_Date_Time");
00057 }
00058 
00059 // set/get portions of ACE_Date_Time, no check for validy
00060 
00061 // get day
00062 ASYS_INLINE long
00063 ACE_Date_Time::day (void) const
00064 {
00065   ACE_TRACE ("ACE_Date_Time::day");
00066   return day_;
00067 }
00068 
00069 // set day
00070 ASYS_INLINE void
00071 ACE_Date_Time::day (long day)
00072 {
00073   ACE_TRACE ("ACE_Date_Time::day");
00074   day_ = day;
00075 }
00076 
00077 // get month
00078 ASYS_INLINE long
00079 ACE_Date_Time::month (void) const
00080 {
00081   ACE_TRACE ("ACE_Date_Time::month");
00082   return month_;
00083 }
00084 
00085 // set month
00086 ASYS_INLINE void
00087 ACE_Date_Time::month (long month)
00088 {
00089   ACE_TRACE ("ACE_Date_Time::month");
00090   month_ = month;
00091 }
00092 
00093 // get year
00094 ASYS_INLINE long
00095 ACE_Date_Time::year (void) const
00096 {
00097   ACE_TRACE ("ACE_Date_Time::year");
00098   return year_;
00099 }
00100 
00101 // set year
00102 ASYS_INLINE void
00103 ACE_Date_Time::year (long year)
00104 {
00105   ACE_TRACE ("ACE_Date_Time::year");
00106   year_ = year;
00107 }
00108 
00109 // get hour
00110 ASYS_INLINE long
00111 ACE_Date_Time::hour (void) const
00112 {
00113   ACE_TRACE ("ACE_Date_Time::hour");
00114   return hour_;
00115 }
00116 
00117 // set hour
00118 ASYS_INLINE void
00119 ACE_Date_Time::hour (long hour)
00120 {
00121   ACE_TRACE ("ACE_Date_Time::hour");
00122   hour_ = hour;
00123 }
00124 
00125 // get minute
00126 ASYS_INLINE long
00127 ACE_Date_Time::minute (void) const
00128 {
00129   ACE_TRACE ("ACE_Date_Time::minute");
00130   return minute_;
00131 }
00132 
00133 // set minute
00134 ASYS_INLINE void
00135 ACE_Date_Time::minute (long minute)
00136 {
00137   ACE_TRACE ("ACE_Date_Time::minute");
00138   minute_ = minute;
00139 }
00140 
00141 // get second
00142 ASYS_INLINE long
00143 ACE_Date_Time::second (void) const
00144 {
00145   ACE_TRACE ("ACE_Date_Time::second");
00146   return second_;
00147 }
00148 
00149 // set second
00150 ASYS_INLINE void
00151 ACE_Date_Time::second (long second)
00152 {
00153   ACE_TRACE ("ACE_Date_Time::second");
00154   second_ = second;
00155 }
00156 
00157 // get microsec
00158 ASYS_INLINE long
00159 ACE_Date_Time::microsec (void) const
00160 {
00161   ACE_TRACE ("ACE_Date_Time::microsec");
00162   return microsec_;
00163 }
00164 
00165 // set microsec
00166 ASYS_INLINE void
00167 ACE_Date_Time::microsec (long microsec)
00168 {
00169   ACE_TRACE ("ACE_Date_Time::microsec");
00170   microsec_ = microsec;
00171 }
00172 
00173 // get wday
00174 ASYS_INLINE long
00175 ACE_Date_Time::weekday (void) const
00176 {
00177   ACE_TRACE ("ACE_Date_Time::weekday");
00178   return wday_;
00179 }
00180 
00181 // set wday
00182 ASYS_INLINE void
00183 ACE_Date_Time::weekday (long wday)
00184 {
00185   ACE_TRACE ("ACE_Date_Time::weekday");
00186   wday_ = wday;
00187 }

Generated on Mon Jun 16 11:19:33 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002