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
75 bool is_active(
void)
const;
78 #if _MSC_VER > 1400 // windows broken dll linkage issue...
80 static const time_t reset = ((time_t)(0));
87 typedef unsigned __int64 tick_t;
89 typedef uint64_t tick_t;
107 Timer(time_t offset);
125 void set(time_t expire);
154 bool operator!()
const;
160 operator bool()
const;
166 Timer& operator=(time_t expire);
178 Timer& operator+=(time_t expire);
190 Timer& operator-=(time_t expire);
210 bool operator==(
const Timer& timer)
const;
217 bool operator!=(
const Timer& timer)
const;
224 bool operator<(
const Timer& timer)
const;
231 bool operator<=(
const Timer& timer)
const;
238 bool operator>(
const Timer& timer)
const;
245 bool operator>=(
const Timer& timer)
const;
251 static void sync(
Timer &timer);
257 static tick_t ticks(
void);
302 virtual void expired(
void) = 0;
367 virtual void modify(
void) = 0;
374 virtual void update(
void) = 0;
391 void operator+=(event &timer);
397 void operator-=(event &timer);
423 __EXPORT
int gettimeofday(
struct timeval *tv,
void *tz);
TimerQueue * list(void) const
Get the timer queue we are attached to.
void modify(accesslock_t &lock)
Convenience function to exclusively schedule conditional access.
Linked objects, lists, templates, and containers.
unsigned long timeout_t
Typedef for millisecond timer values.
A timer event object that lives on a timer queue.
Common namespace for all ucommon objects.
Timer timer_t
A convenience type for timers.
static const timeout_t inf
A value to use for infinite time.
A portable counting semaphore class.
A timer queue for timer events.
static const time_t reset
A value to use when resetting.
An index container for maintaining an ordered list of objects.
TimerQueue::event TQEvent
A convenience type for timer queue timer events.
A double linked list object.
Timer class to use when scheduling realtime events.
ObjectProtocol * copy(ObjectProtocol *object)
Convenience function to access object copy.
The conditional is a common base for other thread synchronizing classes.
timeout_t operator*() const
Get remaining time until timer expires by reference.
timeout_t get(void) const
Get remaining time until the timer expires.