27 #ifndef _UCOMMON_TIMERS_H_
28 #define _UCOMMON_TIMERS_H_
30 #ifndef _UCOMMON_LINKED_H_
56 #if _POSIX_TIMERS > 0 && defined(POSIX_TIMERS)
59 #undef POSIX_TIMERS // make sure not used if no support
65 #if _MSC_VER > 1400 // windows broken dll linkage issue...
67 static const time_t reset = ((time_t)(0));
74 typedef unsigned __int64 tick_t;
76 typedef uint64_t tick_t;
106 bool isExpired(
void);
112 bool isUpdated(
void);
124 void set(time_t expire);
153 bool operator!()
const;
159 operator bool()
const;
165 Timer& operator=(time_t expire);
177 Timer& operator+=(time_t expire);
189 Timer& operator-=(time_t expire);
209 bool operator==(
const Timer& timer);
216 bool operator!=(
const Timer& timer);
223 bool operator<(
const Timer& timer);
230 bool operator<=(
const Timer& timer);
237 bool operator>(
const Timer& timer);
244 bool operator>=(
const Timer& timer);
250 static void sync(
Timer &timer);
256 static tick_t ticks(
void);
301 virtual void expired(
void) = 0;
343 inline bool isExpired(
void)
344 {
return Timer::isExpired();};
351 {
return Timer::get();};
373 virtual void modify(
void) = 0;
380 virtual void update(
void) = 0;
429 __EXPORT
int gettimeofday(
struct timeval *tv,
void *tz);