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

ACE_Time_Value Class Reference

Operations on "timeval" structures, which express time in seconds (secs) and microseconds (usecs). More...

#include <Time_Value.h>

Collaboration diagram for ACE_Time_Value:

Collaboration graph
[legend]
List of all members.

Public Methods

 ACE_Time_Value (void)
 Default Constructor. More...

 ACE_Time_Value (long sec, long usec=0)
 Constructor. More...

 ACE_Time_Value (const struct timeval &t)
 Construct the ACE_Time_Value from a timeval. More...

 ACE_Time_Value (const timespec_t &t)
 Construct the ACE_Time_Value object from a timespec_t. More...

 ACE_Time_Value (const FILETIME &ft)
 Construct the ACE_Time_Value object from a Win32 FILETIME. More...

void set (long sec, long usec)
 Initializes the ACE_Time_Value from two longs. More...

void set (double d)
 Initializes the ACE_Time_Value from a double, which is assumed to be in second format, with any remainder treated as microseconds. More...

void set (const timeval &t)
 Initializes the ACE_Time_Value from a timeval. More...

void set (const timespec_t &t)
 Initializes the ACE_Time_Value object from a timespec_t. More...

void set (const FILETIME &ft)
 Initializes the ACE_Time_Value object from a Win32 FILETIME. More...

long msec (void) const
 Converts from ACE_Time_Value format into milli-seconds format. More...

void msec (long)
 Converts from milli-seconds format into ACE_Time_Value format. More...

 operator timespec_t () const
 Returns the value of the object as a timespec_t. More...

 operator timeval () const
 Returns the value of the object as a timeval. More...

 operator const timeval * () const
 Returns a pointer to the object as a timeval. More...

 operator FILETIME () const
 Returns the value of the object as a Win32 FILETIME. More...

long sec (void) const
 Get seconds. More...

void sec (long sec)
 Set seconds. More...

long usec (void) const
 Get microseconds. More...

void usec (long usec)
 Set microseconds. More...

ACE_Time_Value & operator+= (const ACE_Time_Value &tv)
 Add tv to this. More...

ACE_Time_Value & operator-= (const ACE_Time_Value &tv)
 Subtract tv to this. More...

ACE_Time_Value & operator *= (double d)
 Multiply the time value by the d factor, which must be >= 0. More...

ACE_Time_Value operator++ (int)
 Increment microseconds as postfix. More...

ACE_Time_Value & operator++ (void)
 Increment microseconds as prefix. More...

ACE_Time_Value operator-- (int)
 Decrement microseconds as postfix. More...

ACE_Time_Value & operator-- (void)
 Decrement microseconds as prefix. More...

void dump (void) const
 Dump is a no-op. More...


Static Public Attributes

const ACE_Time_Value zero
 Constant "0". More...

const ACE_Time_Value max_time
const DWORDLONG FILETIME_to_timval_skew
 Const time difference between FILETIME and POSIX time. More...


Private Methods

void normalize (void)
 Put the timevalue into a canonical form. More...


Private Attributes

timeval tv_
 Store the values as a timeval. More...


Friends

ACE_OS_Export ACE_Time_Value operator+ (const ACE_Time_Value &tv1, const ACE_Time_Value &tv2)
 Adds two ACE_Time_Value objects together, returns the sum. More...

ACE_OS_Export ACE_Time_Value operator- (const ACE_Time_Value &tv1, const ACE_Time_Value &tv2)
 Subtracts two ACE_Time_Value objects, returns the difference. More...

ACE_OS_Export int operator< (const ACE_Time_Value &tv1, const ACE_Time_Value &tv2)
 True if tv1 < tv2. More...

ACE_OS_Export int operator> (const ACE_Time_Value &tv1, const ACE_Time_Value &tv2)
 True if tv1 > tv2. More...

ACE_OS_Export int operator<= (const ACE_Time_Value &tv1, const ACE_Time_Value &tv2)
 True if tv1 <= tv2. More...

ACE_OS_Export int operator>= (const ACE_Time_Value &tv1, const ACE_Time_Value &tv2)
 True if tv1 >= tv2. More...

ACE_OS_Export int operator== (const ACE_Time_Value &tv1, const ACE_Time_Value &tv2)
 True if tv1 == tv2. More...

ACE_OS_Export int operator!= (const ACE_Time_Value &tv1, const ACE_Time_Value &tv2)
 True if tv1 != tv2. More...

ACE_OS_Export ACE_Time_Value operator * (double d, const ACE_Time_Value &tv)
 Multiplies the time value by d. More...

ACE_OS_Export ACE_Time_Value operator * (const ACE_Time_Value &tv, double d)
 Multiplies the time value by d. More...


Detailed Description

Operations on "timeval" structures, which express time in seconds (secs) and microseconds (usecs).

This class centralizes all the time related processing in ACE. These time values are typically used in conjunction with OS mechanisms like <select>, <poll>, or <cond_timedwait>.

Definition at line 103 of file Time_Value.h.


Constructor & Destructor Documentation

ACE_INLINE ACE_Time_Value::ACE_Time_Value void   
 

Default Constructor.

Definition at line 83 of file Time_Value.inl.

00084      : tv_ ()
00085 {
00086   // ACE_OS_TRACE ("ACE_Time_Value::ACE_Time_Value");
00087   this->set (0, 0);
00088 }

ACE_INLINE ACE_Time_Value::ACE_Time_Value long    sec,
long    usec = 0
 

Constructor.

Definition at line 91 of file Time_Value.inl.

References sec, set, and usec.

00092 {
00093   // ACE_OS_TRACE ("ACE_Time_Value::ACE_Time_Value");
00094   this->set (sec, usec);
00095 }

ACE_INLINE ACE_Time_Value::ACE_Time_Value const struct timeval &    t
 

Construct the ACE_Time_Value from a timeval.

Definition at line 75 of file Time_Value.inl.

00076      : tv_ ()
00077 {
00078   // ACE_OS_TRACE ("ACE_Time_Value::ACE_Time_Value");
00079   this->set (tv);
00080 }

ACE_INLINE ACE_Time_Value::ACE_Time_Value const timespec_t   t
 

Construct the ACE_Time_Value object from a timespec_t.

Definition at line 232 of file Time_Value.inl.

00233      : tv_ ()
00234 {
00235   // ACE_OS_TRACE ("ACE_Time_Value::ACE_Time_Value");
00236   this->set (tv);
00237 }

ACE_Time_Value::ACE_Time_Value const FILETIME &    ft
 

Construct the ACE_Time_Value object from a Win32 FILETIME.

Definition at line 91 of file Time_Value.cpp.

References set.

00092 {
00093   // // ACE_OS_TRACE ("ACE_Time_Value::ACE_Time_Value");
00094   this->set (file_time);
00095 }


Member Function Documentation

void ACE_Time_Value::dump void    const
 

Dump is a no-op.

The dump() method is a no-op. It's here for backwards compatibility only, but does not dump anything. Invoking logging methods here violates layering restrictions in ACE because this class is part of the OS layer and ACE_Log_Msg is at a higher level.

Definition at line 154 of file Time_Value.cpp.

References ACE_BEGIN_DUMP, ACE_DEBUG, ACE_END_DUMP, ACE_LIB_TEXT, and LM_DEBUG.

Referenced by ACE_Timer_Queue_T::dump, and ACE_Timer_Node_T::dump.

00155 {
00156   // ACE_OS_TRACE ("ACE_Time_Value::dump");
00157 #if 0
00158   ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00159   ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\ntv_sec_ = %d"), this->tv_.tv_sec));
00160   ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\ntv_usec_ = %d\n"), this->tv_.tv_usec));
00161   ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00162 #endif /* 0 */
00163 }

ACE_INLINE void ACE_Time_Value::msec long   
 

Converts from milli-seconds format into ACE_Time_Value format.

Note:
The semantics of this method differs from the sec() and usec() methods. There is no analogous "millisecond" component in an ACE_Time_Value.

Definition at line 127 of file Time_Value.inl.

References tv_.

00128 {
00129   // ACE_OS_TRACE ("ACE_Time_Value::msec");
00130   // Convert millisecond units to seconds;
00131   this->tv_.tv_sec = milliseconds / 1000;
00132   // Convert remainder to microseconds;
00133   this->tv_.tv_usec = (milliseconds - (this->tv_.tv_sec * 1000)) * 1000;
00134 }

ACE_INLINE long ACE_Time_Value::msec void    const
 

Converts from ACE_Time_Value format into milli-seconds format.

Returns:
Sum of second field (in milliseconds) and microsecond field (in milliseconds).
Note:
The semantics of this method differs from the sec() and usec() methods. There is no analogous "millisecond" component in an ACE_Time_Value.

Definition at line 118 of file Time_Value.inl.

References tv_.

Referenced by ACE_WFMO_Reactor::calculate_timeout, ACE_High_Res_Timer::calibrate, ACE_TLI_Connector::complete, ACE_SPIPE_Connector::connect, ACE_OS::event_timedwait, ACE_WIN32_Proactor::handle_events, ACE_POSIX_AIOCB_Proactor::handle_events, ACE_POSIX_CB_Proactor::handle_events, ACE_OS::mutex_lock, ACE_WFMO_Reactor::ok_to_wait, ACE_OS::poll, ACE_XtReactor::reset_timeout, ACE_TkReactor::reset_timeout, ACE_QtReactor::reset_timeout, ACE_OS::sched_params, ACE_OS::sema_wait, ACE_OS::sleep, ACE_NT_Service::state, ACE_Process_Manager::wait, ACE_Process::wait, and ACE_Dev_Poll_Reactor::work_pending_i.

00119 {
00120   // ACE_OS_TRACE ("ACE_Time_Value::msec");
00121   return this->tv_.tv_sec * 1000 + this->tv_.tv_usec / 1000;
00122 }

void ACE_Time_Value::normalize void    [private]
 

Put the timevalue into a canonical form.

Definition at line 166 of file Time_Value.cpp.

References ACE_ONE_SECOND_IN_USECS, and tv_.

Referenced by operator *=, operator+, operator++, operator+=, operator-, operator--, operator-=, and set.

00167 {
00168   // // ACE_OS_TRACE ("ACE_Time_Value::normalize");
00169   // From Hans Rohnert...
00170 
00171   if (this->tv_.tv_usec >= ACE_ONE_SECOND_IN_USECS)
00172     {
00173       do
00174         {
00175           this->tv_.tv_sec++;
00176           this->tv_.tv_usec -= ACE_ONE_SECOND_IN_USECS;
00177         }
00178       while (this->tv_.tv_usec >= ACE_ONE_SECOND_IN_USECS);
00179     }
00180   else if (this->tv_.tv_usec <= -ACE_ONE_SECOND_IN_USECS)
00181     {
00182       do
00183         {
00184           this->tv_.tv_sec--;
00185           this->tv_.tv_usec += ACE_ONE_SECOND_IN_USECS;
00186         }
00187       while (this->tv_.tv_usec <= -ACE_ONE_SECOND_IN_USECS);
00188     }
00189 
00190   if (this->tv_.tv_sec >= 1 && this->tv_.tv_usec < 0)
00191     {
00192       this->tv_.tv_sec--;
00193       this->tv_.tv_usec += ACE_ONE_SECOND_IN_USECS;
00194     }
00195   else if (this->tv_.tv_sec < 0 && this->tv_.tv_usec > 0)
00196     {
00197       this->tv_.tv_sec++;
00198       this->tv_.tv_usec -= ACE_ONE_SECOND_IN_USECS;
00199     }
00200 }

ACE_INLINE ACE_Time_Value & ACE_Time_Value::operator *= double    d
 

Multiply the time value by the d factor, which must be >= 0.

Definition at line 155 of file Time_Value.inl.

References ACE_ONE_SECOND_IN_USECS, normalize, sec, and usec.

00156 {
00157   double time =
00158     ((double) this->sec ()) * ACE_ONE_SECOND_IN_USECS + this->usec ();
00159   time *= d;
00160   this->sec ((long)(time / ACE_ONE_SECOND_IN_USECS));
00161   this->usec (((long)time) % ACE_ONE_SECOND_IN_USECS);
00162   this->normalize ();
00163   return *this;
00164 }

ACE_INLINE ACE_Time_Value::operator const timeval *   const
 

Returns a pointer to the object as a timeval.

Definition at line 18 of file Time_Value.inl.

References tv_.

00019 {
00020   // ACE_OS_TRACE ("ACE_Time_Value::operator const timeval *");
00021   return (const timeval *) &this->tv_;
00022 }

ACE_Time_Value::operator FILETIME   const
 

Returns the value of the object as a Win32 FILETIME.

Definition at line 125 of file Time_Value.cpp.

References FILETIME_to_timval_skew, and tv_.

00126 {
00127   FILETIME file_time;
00128   // ACE_OS_TRACE ("ACE_Time_Value::operator FILETIME");
00129 
00130 #if defined (ACE_LACKS_LONGLONG_T)
00131   ACE_U_LongLong LL_sec(this->tv_.tv_sec);
00132   ACE_U_LongLong LL_usec(this->tv_.tv_usec);
00133   ACE_U_LongLong LL_100ns = LL_sec * (ACE_UINT32)(10000 * 1000) +
00134                             LL_usec * (ACE_UINT32)10 +
00135                             ACE_Time_Value::FILETIME_to_timval_skew;
00136   file_time.dwLowDateTime = LL_100ns.lo();
00137   file_time.dwHighDateTime = LL_100ns.hi();
00138 #else
00139   ULARGE_INTEGER _100ns;
00140   _100ns.QuadPart = (((DWORDLONG) this->tv_.tv_sec * (10000 * 1000) +
00141                       this->tv_.tv_usec * 10) +
00142                      ACE_Time_Value::FILETIME_to_timval_skew);
00143 
00144   file_time.dwLowDateTime = _100ns.LowPart;
00145   file_time.dwHighDateTime = _100ns.HighPart;
00146 #endif //ACE_LACKS_LONGLONG_T
00147 
00148   return file_time;
00149 }

ACE_INLINE ACE_Time_Value::operator timespec_t   const
 

Returns the value of the object as a timespec_t.

Definition at line 213 of file Time_Value.inl.

References sec, tv_, timespec::tv_nsec, and timespec::tv_sec.

00214 {
00215   // ACE_OS_TRACE ("ACE_Time_Value::operator timespec_t");
00216   timespec_t tv;
00217 #if ! defined(ACE_HAS_BROKEN_TIMESPEC_MEMBERS)
00218   tv.tv_sec = this->sec ();
00219   // Convert microseconds into nanoseconds.
00220   tv.tv_nsec = this->tv_.tv_usec * 1000;
00221 #else
00222   tv.ts_sec = this->sec ();
00223   // Convert microseconds into nanoseconds.
00224   tv.ts_nsec = this->tv_.tv_usec * 1000;
00225 #endif /* ACE_HAS_BROKEN_TIMESPEC_MEMBERS */
00226   return tv;
00227 }

ACE_INLINE ACE_Time_Value::operator timeval   const
 

Returns the value of the object as a timeval.

Definition at line 9 of file Time_Value.inl.

References tv_.

00010 {
00011   // ACE_OS_TRACE ("ACE_Time_Value::operator timeval");
00012   return this->tv_;
00013 }

ACE_Time_Value & ACE_Time_Value::operator++ void   
 

Increment microseconds as prefix.

Note:
The only reason this is here is to allow the use of ACE_Atomic_Op with ACE_Time_Value.

Definition at line 44 of file Time_Value.cpp.

References normalize, and usec.

00045 {
00046   // ACE_OS_TRACE ("ACE_Time_Value::operator ++ (void)");
00047   this->usec (this->usec () + 1);
00048   this->normalize ();
00049   return *this;
00050 }

ACE_Time_Value ACE_Time_Value::operator++ int   
 

Increment microseconds as postfix.

Note:
The only reason this is here is to allow the use of ACE_Atomic_Op with ACE_Time_Value.

Definition at line 35 of file Time_Value.cpp.

00036 {
00037   // ACE_OS_TRACE ("ACE_Time_Value::operator ++ (int)");
00038   ACE_Time_Value tv (*this);
00039   ++*this;
00040   return tv;
00041 }

ACE_INLINE ACE_Time_Value & ACE_Time_Value::operator+= const ACE_Time_Value &    tv
 

Add tv to this.

Definition at line 283 of file Time_Value.inl.

References normalize, sec, and usec.

00284 {
00285   // ACE_OS_TRACE ("ACE_Time_Value::operator+=");
00286   this->sec (this->sec () + tv.sec ());
00287   this->usec (this->usec () + tv.usec ());
00288   this->normalize ();
00289   return *this;
00290 }

ACE_Time_Value & ACE_Time_Value::operator-- void   
 

Decrement microseconds as prefix.

Note:
The only reason this is here is to allow the use of ACE_Atomic_Op with ACE_Time_Value.

Definition at line 65 of file Time_Value.cpp.

References normalize, and usec.

00066 {
00067   // ACE_OS_TRACE ("ACE_Time_Value::operator -- (void)");
00068   this->usec (this->usec () - 1);
00069   this->normalize ();
00070   return *this;
00071 }

ACE_Time_Value ACE_Time_Value::operator-- int   
 

Decrement microseconds as postfix.

Note:
The only reason this is here is to allow the use of ACE_Atomic_Op with ACE_Time_Value.

Definition at line 56 of file Time_Value.cpp.

00057 {
00058   // ACE_OS_TRACE ("ACE_Time_Value::operator -- (int)");
00059   ACE_Time_Value tv (*this);
00060   --*this;
00061   return tv;
00062 }

ACE_INLINE ACE_Time_Value & ACE_Time_Value::operator-= const ACE_Time_Value &    tv
 

Subtract tv to this.

Definition at line 295 of file Time_Value.inl.

References normalize, sec, and usec.

00296 {
00297   // ACE_OS_TRACE ("ACE_Time_Value::operator-=");
00298   this->sec (this->sec () - tv.sec ());
00299   this->usec (this->usec () - tv.usec ());
00300   this->normalize ();
00301   return *this;
00302 }

ACE_INLINE void ACE_Time_Value::sec long    sec
 

Set seconds.

Definition at line 109 of file Time_Value.inl.

References sec, and tv_.

00110 {
00111   // ACE_OS_TRACE ("ACE_Time_Value::sec");
00112   this->tv_.tv_sec = sec;
00113 }

ACE_INLINE long ACE_Time_Value::sec void    const
 

Get seconds.

Returns:
The second field/component of this ACE_Time_Value.
Note:
The semantics of this method differs from the msec() method.

Definition at line 100 of file Time_Value.inl.

References tv_.

Referenced by ACE_Time_Value, ACE_OS::cond_timedwait, ACE_TLI_Connector::connect, ACE_Log_Record::decode, ACE_Time_Request::dump, ACE_Name_Request::dump, ACE_Dynamic_Message_Strategy::dump, ACE_Profile_Timer::elapsed_time, ACE_OS::event_timedwait, ACE_System_Time::get_local_system_time, ACE_System_Time::get_master_system_time, ACE_OS::gethrtime, ACE_High_Res_Timer::gettime, ACE::handle_timed_accept, ACE_Handle_Ops::handle_timed_open, ACE_High_Res_Timer::hrtime_to_tv, ACE_OS::mktime, ACE_OS::mutex_lock, operator *=, operator timespec_t, operator+, operator+=, operator-, operator-=, operator==, operator>, operator>=, ACE_Dynamic_Message_Strategy::priority_status, ACE_Timer_Hash_T::reschedule, ACE_FlReactor::reset_timeout, ACE_Timer_Hash_T::schedule, sec, ACE_OS::sema_wait, set, ACE_OS::set_scheduling_params, ACE_Token::shared_acquire, ACE_SOCK_Connector::shared_connect_finish, ACE_OS::time, ACE_Log_Record::time_stamp, ACE_Time_Request::timeout, ACE_Name_Request::timeout, ACE::timestamp, ACE_OS::ualarm, ACE_Date_Time::update, and ACE_FlReactor::wait_for_multiple_events.

00101 {
00102   // ACE_OS_TRACE ("ACE_Time_Value::sec");
00103   return this->tv_.tv_sec;
00104 }

void ACE_Time_Value::set const FILETIME &    ft
 

Initializes the ACE_Time_Value object from a Win32 FILETIME.

Definition at line 97 of file Time_Value.cpp.

References FILETIME_to_timval_skew, normalize, and tv_.

00098 {
00099   //  Initializes the ACE_Time_Value object from a Win32 FILETIME
00100 #if defined (ACE_LACKS_LONGLONG_T)
00101   ACE_U_LongLong LL_100ns(file_time.dwLowDateTime, file_time.dwHighDateTime);
00102   LL_100ns -= ACE_Time_Value::FILETIME_to_timval_skew;
00103   // Convert 100ns units to seconds;
00104   this->tv_.tv_sec = (long) (LL_100ns / ((double) (10000 * 1000)));
00105   // Convert remainder to microseconds;
00106   this->tv_.tv_usec = (long)((LL_100ns % ((ACE_UINT32)(10000 * 1000))) / 10);
00107 #else
00108   // Don't use a struct initializer, gcc don't like it.
00109   ULARGE_INTEGER _100ns;
00110   _100ns.LowPart = file_time.dwLowDateTime;
00111   _100ns.HighPart = file_time.dwHighDateTime;
00112 
00113   _100ns.QuadPart -= ACE_Time_Value::FILETIME_to_timval_skew;
00114 
00115   // Convert 100ns units to seconds;
00116   this->tv_.tv_sec = (long) (_100ns.QuadPart / (10000 * 1000));
00117   // Convert remainder to microseconds;
00118   this->tv_.tv_usec = (long) ((_100ns.QuadPart % (10000 * 1000)) / 10);
00119 #endif // ACE_LACKS_LONGLONG_T
00120   this->normalize ();
00121 }

ACE_INLINE void ACE_Time_Value::set const timespec_t   t
 

Initializes the ACE_Time_Value object from a timespec_t.

Definition at line 48 of file Time_Value.inl.

References normalize, tv_, timespec::tv_nsec, and timespec::tv_sec.

00049 {
00050   // ACE_OS_TRACE ("ACE_Time_Value::set");
00051 #if ! defined(ACE_HAS_BROKEN_TIMESPEC_MEMBERS)
00052   this->tv_.tv_sec = ACE_static_cast (long, tv.tv_sec);
00053   // Convert nanoseconds into microseconds.
00054   this->tv_.tv_usec = tv.tv_nsec / 1000;
00055 #else
00056   this->tv_.tv_sec = tv.ts_sec;
00057   // Convert nanoseconds into microseconds.
00058   this->tv_.tv_usec = tv.ts_nsec / 1000;
00059 #endif /* ACE_HAS_BROKEN_TIMESPEC_MEMBERS */
00060 
00061   this->normalize ();
00062 }

ACE_INLINE void ACE_Time_Value::set const timeval &    t
 

Initializes the ACE_Time_Value from a timeval.

Definition at line 65 of file Time_Value.inl.

References normalize, and tv_.

00066 {
00067   // ACE_OS_TRACE ("ACE_Time_Value::set");
00068   this->tv_.tv_sec = tv.tv_sec;
00069   this->tv_.tv_usec = tv.tv_usec;
00070 
00071   this->normalize ();
00072 }

ACE_INLINE void ACE_Time_Value::set double    d
 

Initializes the ACE_Time_Value from a double, which is assumed to be in second format, with any remainder treated as microseconds.

Definition at line 34 of file Time_Value.inl.

References ACE_ONE_SECOND_IN_USECS, normalize, and tv_.

00035 {
00036   // ACE_OS_TRACE ("ACE_Time_Value::set");
00037   long l = (long) d;
00038   this->tv_.tv_sec = l;
00039   this->tv_.tv_usec = (long) ((d - (double) l) * ACE_ONE_SECOND_IN_USECS);
00040   this->normalize ();
00041 }

ACE_INLINE void ACE_Time_Value::set long    sec,
long    usec
 

Initializes the ACE_Time_Value from two longs.

Definition at line 25 of file Time_Value.inl.

References normalize, sec, tv_, and usec.

Referenced by ACE_Time_Value, and ACE_OS::cond_timedwait.

00026 {
00027   // ACE_OS_TRACE ("ACE_Time_Value::set");
00028   this->tv_.tv_sec = sec;
00029   this->tv_.tv_usec = usec;
00030   this->normalize ();
00031 }

ACE_INLINE void ACE_Time_Value::usec long    usec
 

Set microseconds.

Definition at line 148 of file Time_Value.inl.

References tv_, and usec.

00149 {
00150   // ACE_OS_TRACE ("ACE_Time_Value::usec");
00151   this->tv_.tv_usec = usec;
00152 }

ACE_INLINE long ACE_Time_Value::usec void    const
 

Get microseconds.

Returns:
The microsecond field/component of this ACE_Time_Value.
Note:
The semantics of this method differs from the msec() method.

Definition at line 139 of file Time_Value.inl.

References tv_.

Referenced by ACE_Time_Value, ACE_OS::cond_timedwait, ACE_TLI_Connector::connect, ACE_Log_Record::decode, ACE_Token_Request::dump, ACE_Time_Request::dump, ACE_Buffered_Svc_Handler::dump, ACE_Name_Request::dump, ACE_Dynamic_Message_Strategy::dump, ACE_Profile_Timer::elapsed_time, ACE_WFMO_Reactor::event_handling, ACE_OS::event_timedwait, ACE_OS::gethrtime, ACE_High_Res_Timer::gettime, ACE::handle_timed_accept, ACE_Handle_Ops::handle_timed_open, ACE_High_Res_Timer::hrtime_to_tv, ACE_OS::mutex_lock, operator *=, operator+, operator++, operator+=, operator-, operator--, operator-=, operator==, operator>, operator>=, ACE_Dynamic_Message_Strategy::priority_status, ACE_FlReactor::reset_timeout, ACE_Reactor::run_reactor_event_loop, ACE_OS::sema_wait, set, ACE_OS::set_scheduling_params, ACE_Token::shared_acquire, ACE_SOCK_Connector::shared_connect_finish, ACE_Log_Record::time_stamp, ACE_Time_Request::timeout, ACE_Name_Request::timeout, ACE::timestamp, ACE_OS::ualarm, ACE_Date_Time::update, usec, and ACE_FlReactor::wait_for_multiple_events.

00140 {
00141   // ACE_OS_TRACE ("ACE_Time_Value::usec");
00142   return this->tv_.tv_usec;
00143 }


Friends And Related Function Documentation

ACE_OS_Export ACE_Time_Value operator * const ACE_Time_Value &    tv,
double    d
[friend]
 

Multiplies the time value by d.

Definition at line 173 of file Time_Value.inl.

00174 {
00175   return ACE_Time_Value (tv) *= d;
00176 }

ACE_OS_Export ACE_Time_Value operator * double    d,
const ACE_Time_Value &    tv
[friend]
 

Multiplies the time value by d.

Definition at line 167 of file Time_Value.inl.

00168 {
00169   return ACE_Time_Value (tv) *= d;
00170 }

ACE_OS_Export int operator!= const ACE_Time_Value &    tv1,
const ACE_Time_Value &    tv2
[friend]
 

True if tv1 != tv2.

Definition at line 273 of file Time_Value.inl.

00275 {
00276   // ACE_OS_TRACE ("operator !=");
00277   return !(tv1 == tv2);
00278 }

ACE_OS_Export ACE_Time_Value operator+ const ACE_Time_Value &    tv1,
const ACE_Time_Value &    tv2
[friend]
 

Adds two ACE_Time_Value objects together, returns the sum.

Definition at line 307 of file Time_Value.inl.

00309 {
00310   // ACE_OS_TRACE ("operator +");
00311   ACE_Time_Value sum (tv1.sec () + tv2.sec (),
00312                       tv1.usec () + tv2.usec ());
00313 
00314   sum.normalize ();
00315   return sum;
00316 }

ACE_OS_Export ACE_Time_Value operator- const ACE_Time_Value &    tv1,
const ACE_Time_Value &    tv2
[friend]
 

Subtracts two ACE_Time_Value objects, returns the difference.

Definition at line 321 of file Time_Value.inl.

00323 {
00324   // ACE_OS_TRACE ("operator -");
00325   ACE_Time_Value delta (tv1.sec () - tv2.sec (),
00326                         tv1.usec () - tv2.usec ());
00327   delta.normalize ();
00328   return delta;
00329 }

ACE_OS_Export int operator< const ACE_Time_Value &    tv1,
const ACE_Time_Value &    tv2
[friend]
 

True if tv1 < tv2.

Definition at line 242 of file Time_Value.inl.

00244 {
00245   // ACE_OS_TRACE ("operator <");
00246   return tv2 > tv1;
00247 }

ACE_OS_Export int operator<= const ACE_Time_Value &    tv1,
const ACE_Time_Value &    tv2
[friend]
 

True if tv1 <= tv2.

Definition at line 252 of file Time_Value.inl.

00254 {
00255   // ACE_OS_TRACE ("operator <=");
00256   return tv2 >= tv1;
00257 }

ACE_OS_Export int operator== const ACE_Time_Value &    tv1,
const ACE_Time_Value &    tv2
[friend]
 

True if tv1 == tv2.

Definition at line 262 of file Time_Value.inl.

00264 {
00265   // ACE_OS_TRACE ("operator ==");
00266   return tv1.sec () == tv2.sec ()
00267     && tv1.usec () == tv2.usec ();
00268 }

ACE_OS_Export int operator> const ACE_Time_Value &    tv1,
const ACE_Time_Value &    tv2
[friend]
 

True if tv1 > tv2.

Definition at line 181 of file Time_Value.inl.

00183 {
00184   // ACE_OS_TRACE ("operator >");
00185   if (tv1.sec () > tv2.sec ())
00186     return 1;
00187   else if (tv1.sec () == tv2.sec ()
00188            && tv1.usec () > tv2.usec ())
00189     return 1;
00190   else
00191     return 0;
00192 }

ACE_OS_Export int operator>= const ACE_Time_Value &    tv1,
const ACE_Time_Value &    tv2
[friend]
 

True if tv1 >= tv2.

Definition at line 197 of file Time_Value.inl.

00199 {
00200   // ACE_OS_TRACE ("operator >=");
00201   if (tv1.sec () > tv2.sec ())
00202     return 1;
00203   else if (tv1.sec () == tv2.sec ()
00204            && tv1.usec () >= tv2.usec ())
00205     return 1;
00206   else
00207     return 0;
00208 }


Member Data Documentation

const DWORDLONG ACE_Time_Value::FILETIME_to_timval_skew [static]
 

Initial value:

ACE_INT64_LITERAL (0x19db1ded53e8000)
Const time difference between FILETIME and POSIX time.

Definition at line 85 of file Time_Value.cpp.

Referenced by operator FILETIME, and set.

const ACE_Time_Value ACE_Time_Value::max_time [static]
 

Constant for maximum time representable. Note that this time is not intended for use with <select> or other calls that may have *their own* implementation-specific maximum time representations. Its primary use is in time computations such as those used by the dynamic subpriority strategies in the ACE_Dynamic_Message_Queue class.

Referenced by ACE_Message_Block::ACE_Message_Block, ACE_Message_Queue< ACE_SYNCH_USE >::dequeue_deadline_i, ACE_Activation_Queue::enqueue, ACE_OutputCDR::grow_and_adjust, ACE_Message_Block::init, ACE_Message_Block::msg_deadline_time, ACE_Process_Manager::reap, ACE_Timer_Wheel_T::remove_first, ACE_Process_Manager::wait, and ACE_Process::wait.

timeval ACE_Time_Value::tv_ [private]
 

Store the values as a timeval.

Definition at line 321 of file Time_Value.h.

Referenced by msec, normalize, operator const timeval *, operator FILETIME, operator timespec_t, operator timeval, sec, set, and usec.

const ACE_Time_Value ACE_Time_Value::zero [static]
 

Constant "0".

Definition at line 18 of file Time_Value.cpp.

Referenced by ACE_Oneshot_Acceptor::accept, ACE_Message_Block::ACE_Message_Block, ACE_Timer_Queue_T::calculate_timeout, ACE_Select_Reactor_T::check_handles, ACE_SPIPE_Connector::connect, ACE_Connector< SVC_HANDLER, ACE_PEER_CONNECTOR_2 >::connect_i, ACE_Timer_Queue_T::dispatch_info_i, ACE_Timer_Wheel_T::earliest_time, ACE_Timer_List_T::earliest_time, ACE_Activation_Queue::enqueue, ACE_OS::event_timedwait, ACE_Timer_Wheel_T::expire, ACE_Timer_Hash_T::expire, ACE_Timer_Hash_T::find_new_earliest, ACE_FlReactor::fl_io_proc, ACE_OutputCDR::grow_and_adjust, ACE_WFMO_Reactor_Notify::handle_signal, ACE_Message_Block::init, ACE_XtReactor::InputCallbackProc, ACE_TkReactor::InputCallbackProc, ACE_Message_Block::msg_execution_time, ACE_Timer_Wheel_T::open_i, ACE_Dynamic_Message_Strategy::priority_status, ACE_Proactor::proactor_run_event_loop, ACE_QtReactor::QtWaitForMultipleEvents, ACE_Process_Manager::reap, ACE_Timer_Wheel_T::recalc_earliest, ACE_OS::sched_params, ACE_Proactor::schedule_timer, ACE_Async_Timer_Queue_Adapter::schedule_ualarm, ACE_OS::sema_wait, ACE_Synch_Options::set, ACE_OS::set_scheduling_params, ACE_Countdown_Time::stop, ACE_TkReactor::TkWaitForMultipleEvents, ACE_Token::tryacquire, ACE_Token::tryacquire_read, ACE_Token::tryacquire_write, ACE_Process_Manager::wait, ACE_Process::wait, ACE_FlReactor::wait_for_multiple_events, ACE_Select_Reactor_T::wakeup_all_threads, ACE_Dev_Poll_Reactor::wakeup_all_threads, and ACE_XtReactor::XtWaitForMultipleEvents.


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