#include <ace/OS.h>
class ACE_Time_Value {
public:
static const ACE_Time_Value zero;
ACE_Time_Value (void);
ACE_Time_Value (long sec, long usec = 0);
ACE_Time_Value (const struct timeval &t);
ACE_Time_Value (const timespec_t &t);
ACE_Time_Value (const ACE_Time_Value &tv);
ACE_Time_Value (const FILETIME &ft);
void set (long sec, long usec);
void set (double d);
void set (const timeval &t);
void set (const timespec_t &t);
void set (const FILETIME &ft);
long msec (void) const;
void msec (long);
operator timespec_t () const;
operator timeval () const;
operator const timeval *() const;
operator FILETIME () const;
long sec (void) const;
void sec (long sec);
long usec (void) const;
void usec (long usec);
void operator += (const ACE_Time_Value &tv);
void operator -= (const ACE_Time_Value &tv);
friend ACE_Export ACE_Time_Value operator + ( const ACE_Time_Value &tv1, const ACE_Time_Value &tv2 );
friend ACE_Export ACE_Time_Value operator - ( const ACE_Time_Value &tv1, const ACE_Time_Value &tv2 );
friend ACE_Export int operator < ( const ACE_Time_Value &tv1, const ACE_Time_Value &tv2 );
friend ACE_Export int operator > ( const ACE_Time_Value &tv1, const ACE_Time_Value &tv2 );
friend ACE_Export int operator <= ( const ACE_Time_Value &tv1, const ACE_Time_Value &tv2 );
friend ACE_Export int operator >= ( const ACE_Time_Value &tv1, const ACE_Time_Value &tv2 );
friend ACE_Export int operator == ( const ACE_Time_Value &tv1, const ACE_Time_Value &tv2 );
friend ACE_Export int operator != ( const ACE_Time_Value &tv1, const ACE_Time_Value &tv2 );
void dump (void) const;
private:
void normalize (void);
timeval tv_;
};
select
, poll
, or
cond_timedwait
. ACE_Time_Value help make the use of these
mechanisms portable across OS platforms,
static const ACE_Time_Value zero;
ACE_Time_Value (void);
ACE_Time_Value (long sec, long usec = 0);
ACE_Time_Value (const struct timeval &t);
ACE_Time_Value
from a timeval
.
ACE_Time_Value (const timespec_t &t);
ACE_Time_Value
object from a timespec_t
.
ACE_Time_Value (const ACE_Time_Value &tv);
ACE_Time_Value (const FILETIME &ft);
void set (long sec, long usec);
Time_Value
from two long
s.
void set (double d);
Time_Value
from a double
, which is assumed to be
in second format, with any remainder treated as microseconds.
void set (const timeval &t);
Time_Value
from a timeval
.
void set (const timespec_t &t);
Time_Value
object from a timespec_t
.
void set (const FILETIME &ft);
Time_Value
object from a timespec_t
.
long msec (void) const;
Time_Value
format into milli-seconds format.
void msec (long);
Time_Value
format.
operator timespec_t () const;
timespec_t
.
operator timeval () const;
timeval
.
operator const timeval *() const;
timeval
.
operator FILETIME () const;
long sec (void) const;
void sec (long sec);
long usec (void) const;
void usec (long usec);
void operator += (const ACE_Time_Value &tv);
tv
to this.
void operator -= (const ACE_Time_Value &tv);
tv
to this.
friend ACE_Export ACE_Time_Value operator + (
const ACE_Time_Value &tv1,
const ACE_Time_Value &tv2
);
friend ACE_Export ACE_Time_Value operator - (
const ACE_Time_Value &tv1,
const ACE_Time_Value &tv2
);
friend ACE_Export int operator < (
const ACE_Time_Value &tv1,
const ACE_Time_Value &tv2
);
tv2.
friend ACE_Export int operator > (
const ACE_Time_Value &tv1,
const ACE_Time_Value &tv2
);
friend ACE_Export int operator <= (
const ACE_Time_Value &tv1,
const ACE_Time_Value &tv2
);
= tv2.
friend ACE_Export int operator >= (
const ACE_Time_Value &tv1,
const ACE_Time_Value &tv2
);
friend ACE_Export int operator == (
const ACE_Time_Value &tv1,
const ACE_Time_Value &tv2
);
friend ACE_Export int operator != (
const ACE_Time_Value &tv1,
const ACE_Time_Value &tv2
);
void dump (void) const;
schmidt@cs.wustl.edu
, Jesper S. M|ller
stophph@diku.dk
, and a cast of thousands...