OS_NS_time.h File Reference

#include "ace/config-all.h"
#include "ace/OS_NS_errno.h"
#include "ace/Basic_Types.h"
#include "ace/os_include/os_time.h"
#include "ace/ACE_export.h"
#include "ace/OS_NS_time.inl"

Include dependency graph for OS_NS_time.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Namespaces

namespace  ACE_OS

Defines

#define ACE_EXPORT_MACRO   ACE_Export
#define ACE_HRTIME_CONVERSION(VAL)   ACE_U64_TO_U32(VAL)
#define ACE_HRTIME_TO_U64(VAL)   (VAL)
#define ACE_GETHRTIME_NAME   ACE_gethrtime
#define ACE_INLINE   inline

Typedefs

typedef unsigned __int64 ACE_QWORD
typedef unsigned __int64 ACE_hrtime_t

Functions

long ace_timezone ()
 Helper for the ACE_OS::timezone() function.

double ace_difftime (time_t t1, time_t t0)
 Helper for the ACE_OS::difftime() function.

ACE_QWORD ACE_MAKE_QWORD (DWORD lo, DWORD hi)
DWORD ACE_LOW_DWORD (ACE_QWORD q)
DWORD ACE_HIGH_DWORD (ACE_QWORD q)

Variables

ACE_BEGIN_VERSIONED_NAMESPACE_DECL
const ACE_UINT32 
ACE_U_ONE_SECOND_IN_MSECS = 1000U
const ACE_UINT32 ACE_U_ONE_SECOND_IN_USECS = 1000000U
const ACE_UINT32 ACE_U_ONE_SECOND_IN_NSECS = 1000000000U


Detailed Description

OS_NS_time.h,v 1.19 2006/06/20 20:27:41 shuston Exp

Author:
Douglas C. Schmidt <schmidt@cs.wustl.edu>

Jesper S. M|ller<stophph@diku.dk>

and a cast of thousands...

Originally in OS.h.

Definition in file OS_NS_time.h.


Define Documentation

#define ACE_EXPORT_MACRO   ACE_Export
 

Definition at line 36 of file OS_NS_time.h.

#define ACE_GETHRTIME_NAME   ACE_gethrtime
 

Definition at line 287 of file OS_NS_time.h.

Referenced by ACE_OS::gethrtime().

#define ACE_HRTIME_CONVERSION VAL   )     ACE_U64_TO_U32(VAL)
 

Definition at line 155 of file OS_NS_time.h.

Referenced by ACE_High_Res_Timer::calibrate().

#define ACE_HRTIME_TO_U64 VAL   )     (VAL)
 

Definition at line 156 of file OS_NS_time.h.

#define ACE_INLINE   inline
 

Definition at line 295 of file OS_NS_time.h.


Typedef Documentation

typedef unsigned __int64 ACE_hrtime_t
 

Definition at line 132 of file OS_NS_time.h.

Referenced by ACE_High_Res_Timer::calibrate(), ACE_High_Res_Timer::elapsed_hrtime(), ACE_High_Res_Timer::elapsed_microseconds(), ACE_Profile_Timer::elapsed_time(), ACE_High_Res_Timer::elapsed_time(), ACE_High_Res_Timer::elapsed_time_incr(), ACE_OS::gethrtime(), ACE_High_Res_Timer::hrtime_to_tv(), ACE_High_Res_Timer::print_ave(), ACE_Timeprobe_Ex< ACE_LOCK, ALLOCATOR >::print_times(), ACE_High_Res_Timer::print_total(), ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR >::report_dequeue_start(), ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR >::report_dequeue_stop(), ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR >::report_enqueue_start(), and ACE_Metrics_Cache< ACE_LOCK, ALLOCATOR >::report_enqueue_stop().

typedef unsigned __int64 ACE_QWORD
 

Definition at line 131 of file OS_NS_time.h.

Referenced by ACE_MAKE_QWORD().


Function Documentation

double ace_difftime time_t  t1,
time_t  t0
[inline]
 

Helper for the ACE_OS::difftime() function.

We moved the difftime code that used to be in ACE_OS::difftime() here because on some platforms "difftime" is a macro. Because of this, the name ACE_OS::difftime will cause errors. So in order to use the macro as it is defined but also keep the name ACE_OS::difftime, we use difftime first here in this inline function, and then undefine it.

Definition at line 122 of file OS_NS_time.h.

Referenced by ACE_OS::difftime().

00123 {
00124   return difftime (t1, t0);
00125 }

DWORD ACE_HIGH_DWORD ACE_QWORD  q  )  [inline]
 

Definition at line 135 of file OS_NS_time.h.

00135 { return (DWORD) (q >> 32); }

DWORD ACE_LOW_DWORD ACE_QWORD  q  )  [inline]
 

Definition at line 134 of file OS_NS_time.h.

00134 { return (DWORD) q; }

ACE_QWORD ACE_MAKE_QWORD DWORD  lo,
DWORD  hi
[inline]
 

Definition at line 133 of file OS_NS_time.h.

References ACE_QWORD.

00133 { return ACE_QWORD (lo) | (ACE_QWORD (hi) << 32); }

long ace_timezone  )  [inline]
 

Helper for the ACE_OS::timezone() function.

We put all the timezone stuff that used to be in ACE_OS::timezone() here because on some platforms "timezone" is a macro. Because of this, the name ACE_OS::timezone will cause errors. So in order to use the macro as it is defined but also keep the name ACE_OS::timezone, we use timezone first here in this inline function, and then undefine timezone.

Definition at line 78 of file OS_NS_time.h.

References ACE_NOTSUP_RETURN.

Referenced by ACE_OS::timezone().

00079 {
00080 #if defined (ACE_HAS_WINCE)
00081   TIME_ZONE_INFORMATION tz;
00082   GetTimeZoneInformation (&tz);
00083   return tz.Bias * 60;
00084 #elif defined (ACE_WIN32) && !defined (ACE_HAS_DINKUM_STL)
00085   return _timezone;  // For Win32.
00086 #elif defined (ACE_WIN32) && defined (ACE_HAS_DINKUM_STL)
00087   time_t tod = time(0);   // get current time
00088   time_t t1 = mktime(gmtime(&tod));   // convert without timezone
00089   time_t t2 = mktime(localtime(&tod));   // convert with timezone
00090   return difftime(t1, t2); // compute difference in seconds
00091 #elif defined (ACE_HAS_TIMEZONE)
00092   // The XPG/POSIX specification requires that tzset() be called to
00093   // set the global variable <timezone>.
00094   ::tzset();
00095   return timezone;
00096 #elif defined (ACE_HAS_TIMEZONE_GETTIMEOFDAY)
00097   // The XPG/POSIX specification does not require gettimeofday to
00098   // set the timezone struct (it leaves the behavior of passing a
00099   // non-null struct undefined).
00100   long result = 0;
00101   struct timeval time;
00102   struct timezone zone;
00103   ACE_UNUSED_ARG (result);
00104   ACE_OSCALL (::gettimeofday (&time, &zone), int, -1, result);
00105   return zone.tz_minuteswest * 60;
00106 #else
00107   ACE_NOTSUP_RETURN (0);
00108 #endif
00109 }


Variable Documentation

ACE_BEGIN_VERSIONED_NAMESPACE_DECL const ACE_UINT32 ACE_U_ONE_SECOND_IN_MSECS = 1000U [static]
 

Definition at line 46 of file OS_NS_time.h.

const ACE_UINT32 ACE_U_ONE_SECOND_IN_NSECS = 1000000000U [static]
 

Definition at line 48 of file OS_NS_time.h.

const ACE_UINT32 ACE_U_ONE_SECOND_IN_USECS = 1000000U [static]
 

Definition at line 47 of file OS_NS_time.h.


Generated on Thu Nov 9 10:46:53 2006 for ACE by doxygen 1.3.6