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

ACE_Date_Time Class Reference

System independent representation of date and time. More...

#include <Date_Time.h>

List of all members.

Public Methods

 ACE_Date_Time (void)
 Constructor initializes current time/date info. More...

 ACE_Date_Time (long day, long month=0, long year=0, long hour=0, long minute=0, long second=0, long microsec=0, long wday=0)
 Constructor with init values, no check for validy Set/get portions of ACE_Date_Time, no check for validity. More...

void update (void)
 Update to the current time/date. More...

void update (const ACE_Time_Value &timevalue)
 Update to the given ACE_Time_Value. More...

long day (void) const
 Get day. More...

void day (long day)
 Set day. More...

long month (void) const
 Get month. More...

void month (long month)
 Set month. More...

long year (void) const
 Get year. More...

void year (long year)
 Set year. More...

long hour (void) const
 Get hour. More...

void hour (long hour)
 Set hour. More...

long minute (void) const
 Get minute. More...

void minute (long minute)
 Set minute. More...

long second (void) const
 Get second. More...

void second (long second)
 Set second. More...

long microsec (void) const
 Get microsec. More...

void microsec (long microsec)
 Set microsec. More...

long weekday (void) const
 Get weekday. More...

void weekday (long wday)
 Set weekday. More...


Private Attributes

long day_
long month_
long year_
long hour_
long minute_
long second_
long microsec_
long wday_


Detailed Description

System independent representation of date and time.

Definition at line 31 of file Date_Time.h.


Constructor & Destructor Documentation

ASYS_INLINE ACE_Date_Time::ACE_Date_Time void   
 

Constructor initializes current time/date info.

Definition at line 31 of file Date_Time.i.

References ACE_TRACE, and update.

00032 {
00033   ACE_TRACE ("ACE_Date_Time::ACE_Date_Time");
00034   this->update ();
00035 }

ASYS_INLINE ACE_Date_Time::ACE_Date_Time long    day,
long    month = 0,
long    year = 0,
long    hour = 0,
long    minute = 0,
long    second = 0,
long    microsec = 0,
long    wday = 0
 

Constructor with init values, no check for validy Set/get portions of ACE_Date_Time, no check for validity.

Definition at line 39 of file Date_Time.i.

References ACE_TRACE.

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 }


Member Function Documentation

ASYS_INLINE void ACE_Date_Time::day long    day
 

Set day.

Definition at line 71 of file Date_Time.i.

References ACE_TRACE, day, and day_.

00072 {
00073   ACE_TRACE ("ACE_Date_Time::day");
00074   day_ = day;
00075 }

ASYS_INLINE long ACE_Date_Time::day void    const
 

Get day.

Definition at line 63 of file Date_Time.i.

References ACE_TRACE, and day_.

Referenced by day.

00064 {
00065   ACE_TRACE ("ACE_Date_Time::day");
00066   return day_;
00067 }

ASYS_INLINE void ACE_Date_Time::hour long    hour
 

Set hour.

Definition at line 119 of file Date_Time.i.

References ACE_TRACE, hour, and hour_.

00120 {
00121   ACE_TRACE ("ACE_Date_Time::hour");
00122   hour_ = hour;
00123 }

ASYS_INLINE long ACE_Date_Time::hour void    const
 

Get hour.

Definition at line 111 of file Date_Time.i.

References ACE_TRACE, and hour_.

Referenced by hour.

00112 {
00113   ACE_TRACE ("ACE_Date_Time::hour");
00114   return hour_;
00115 }

ASYS_INLINE void ACE_Date_Time::microsec long    microsec
 

Set microsec.

Definition at line 167 of file Date_Time.i.

References ACE_TRACE, microsec, and microsec_.

00168 {
00169   ACE_TRACE ("ACE_Date_Time::microsec");
00170   microsec_ = microsec;
00171 }

ASYS_INLINE long ACE_Date_Time::microsec void    const
 

Get microsec.

Definition at line 159 of file Date_Time.i.

References ACE_TRACE, and microsec_.

Referenced by microsec.

00160 {
00161   ACE_TRACE ("ACE_Date_Time::microsec");
00162   return microsec_;
00163 }

ASYS_INLINE void ACE_Date_Time::minute long    minute
 

Set minute.

Definition at line 135 of file Date_Time.i.

References ACE_TRACE, minute, and minute_.

00136 {
00137   ACE_TRACE ("ACE_Date_Time::minute");
00138   minute_ = minute;
00139 }

ASYS_INLINE long ACE_Date_Time::minute void    const
 

Get minute.

Definition at line 127 of file Date_Time.i.

References ACE_TRACE, and minute_.

Referenced by minute.

00128 {
00129   ACE_TRACE ("ACE_Date_Time::minute");
00130   return minute_;
00131 }

ASYS_INLINE void ACE_Date_Time::month long    month
 

Set month.

Definition at line 87 of file Date_Time.i.

References ACE_TRACE, month, and month_.

00088 {
00089   ACE_TRACE ("ACE_Date_Time::month");
00090   month_ = month;
00091 }

ASYS_INLINE long ACE_Date_Time::month void    const
 

Get month.

Definition at line 79 of file Date_Time.i.

References ACE_TRACE, and month_.

Referenced by month.

00080 {
00081   ACE_TRACE ("ACE_Date_Time::month");
00082   return month_;
00083 }

ASYS_INLINE void ACE_Date_Time::second long    second
 

Set second.

Definition at line 151 of file Date_Time.i.

References ACE_TRACE, second, and second_.

00152 {
00153   ACE_TRACE ("ACE_Date_Time::second");
00154   second_ = second;
00155 }

ASYS_INLINE long ACE_Date_Time::second void    const
 

Get second.

Definition at line 143 of file Date_Time.i.

References ACE_TRACE, and second_.

Referenced by second.

00144 {
00145   ACE_TRACE ("ACE_Date_Time::second");
00146   return second_;
00147 }

ASYS_INLINE void ACE_Date_Time::update const ACE_Time_Value   timevalue
 

Update to the given ACE_Time_Value.

Definition at line 7 of file Date_Time.i.

References day_, hour_, ACE_OS::localtime_r, microsec_, minute_, month_, ACE_Time_Value::sec, second_, ACE_Time_Value::usec, wday_, and year_.

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 }

ASYS_INLINE void ACE_Date_Time::update void   
 

Update to the current time/date.

Definition at line 23 of file Date_Time.i.

References ACE_TRACE, and ACE_OS::gettimeofday.

Referenced by ACE_Date_Time.

00024 {
00025   ACE_TRACE ("ACE_Date_Time::update");
00026 
00027   update(ACE_OS::gettimeofday ());
00028 }

ASYS_INLINE void ACE_Date_Time::weekday long    wday
 

Set weekday.

Definition at line 183 of file Date_Time.i.

References ACE_TRACE, and wday_.

00184 {
00185   ACE_TRACE ("ACE_Date_Time::weekday");
00186   wday_ = wday;
00187 }

ASYS_INLINE long ACE_Date_Time::weekday void    const
 

Get weekday.

Definition at line 175 of file Date_Time.i.

References ACE_TRACE, and wday_.

00176 {
00177   ACE_TRACE ("ACE_Date_Time::weekday");
00178   return wday_;
00179 }

ASYS_INLINE void ACE_Date_Time::year long    year
 

Set year.

Definition at line 103 of file Date_Time.i.

References ACE_TRACE, year, and year_.

00104 {
00105   ACE_TRACE ("ACE_Date_Time::year");
00106   year_ = year;
00107 }

ASYS_INLINE long ACE_Date_Time::year void    const
 

Get year.

Definition at line 95 of file Date_Time.i.

References ACE_TRACE, and year_.

Referenced by year.

00096 {
00097   ACE_TRACE ("ACE_Date_Time::year");
00098   return year_;
00099 }


Member Data Documentation

long ACE_Date_Time::day_ [private]
 

Definition at line 103 of file Date_Time.h.

Referenced by day, and update.

long ACE_Date_Time::hour_ [private]
 

Definition at line 106 of file Date_Time.h.

Referenced by hour, and update.

long ACE_Date_Time::microsec_ [private]
 

Definition at line 109 of file Date_Time.h.

Referenced by microsec, and update.

long ACE_Date_Time::minute_ [private]
 

Definition at line 107 of file Date_Time.h.

Referenced by minute, and update.

long ACE_Date_Time::month_ [private]
 

Definition at line 104 of file Date_Time.h.

Referenced by month, and update.

long ACE_Date_Time::second_ [private]
 

Definition at line 108 of file Date_Time.h.

Referenced by second, and update.

long ACE_Date_Time::wday_ [private]
 

Definition at line 110 of file Date_Time.h.

Referenced by update, and weekday.

long ACE_Date_Time::year_ [private]
 

Definition at line 105 of file Date_Time.h.

Referenced by update, and year.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 12:47:01 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002