2 #ifndef JAWS_TASK_TIMER_H
3 #define JAWS_TASK_TIMER_H
5 #include "ace/Singleton.h"
6 #include "ace/Timer_Wheel.h"
7 #include "ace/Timer_Queue_Adapters.h"
9 #include "jaws3/Export.h"
10 #include "jaws3/Timer.h"
12 class JAWS_Task_Timer
;
14 class JAWS_Export JAWS_Task_Timer
: public JAWS_Timer_Impl
19 static JAWS_Timer_Impl
* instance ()
21 return ACE_Singleton
<JAWS_Task_Timer
, ACE_SYNCH_MUTEX
>::instance ();
24 void schedule_timer ( long *timer_id
25 , const ACE_Time_Value
&delta
26 , JAWS_Event_Completer
*completer
30 void schedule_absolute_timer ( long *timer_id
31 , const ACE_Time_Value
&tv
32 , JAWS_Event_Completer
*completer
36 void schedule_interval_timer ( long *timer_id
37 , const ACE_Time_Value
&interval
38 , JAWS_Event_Completer
*completer
42 void cancel_timer (long timer_id
);
43 // NOTE: Cancelling the timer causes handle_close to be called, but
44 // not handle_timeout (of couse, I mean in the ACE_Event_Handler that
45 // is being used as the timer helper).
48 ACE_Thread_Timer_Queue_Adapter
<ACE_Timer_Wheel
> timer_queue_
;
51 #endif /* JAWS_TASK_TIMER_H */