1 #ifndef TIMER_DRIVER_CLASS
2 #define TIMER_DRIVER_CLASS
25 class driven_objects_list;
26 class signalling_thread;
32 class timeable :
public virtual basis::root_object
86 driven_objects_list *_timers;
88 #if defined(__UNIX__) || defined(__GNU_WINDOWS__)
89 signalling_thread *_prompter;
97 void hookup_OS_timer(
int duration);
99 void reset_OS_timer(
int next_hit);
102 void unhook_OS_timer();
108 #define program_wide_timer() timer_driver::global_timer_driver()
timeable is the base for objects that can be hooked into timer events.
virtual void handle_timer_callback()=0
this method is invoked when the timer period elapses for this object.
Provides platform-independent timer support.
static timer_driver & global_timer_driver()
the first time this is invoked, it creates a program-wide timer driver.
bool set_timer(int duration, timeable *to_invoke)
sets a timer to call "to_invoke" every "duration" milliseconds.
DEFINE_CLASS_NAME("timer_driver")
void handle_system_timer()
invoked by the OS timer support and must be called by main thread.
bool zap_timer(timeable *to_drop)
removes the timer that was established for "to_drop".
Constants and objects used throughout HOOPLE.
unsigned int un_int
Abbreviated name for unsigned integers.