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/Event_Completer.h"
13 class JAWS_Timer_Impl
;
15 class JAWS_Export JAWS_Timer_Impl
17 // Implementation base class for Timers that corresponds to the
18 // RHS of the Bridge pattern.
22 virtual ~JAWS_Timer_Impl (void) {}
24 virtual void schedule_timer ( long *timer_id
25 , const ACE_Time_Value
&delta
26 , JAWS_Event_Completer
*completer
29 // Schedule a timer to expire at now+delta.
31 virtual void schedule_absolute_timer ( long *timer_id
32 , const ACE_Time_Value
&tv
33 , JAWS_Event_Completer
*completer
36 // Schedule a timer to expire at tv.
38 virtual void schedule_interval_timer ( long *timer_id
39 , const ACE_Time_Value
&interval
40 , JAWS_Event_Completer
*completer
43 // Schedule a timer to expire at now+interval, and every interval following.
45 virtual void cancel_timer (long timer_id
) = 0;
51 class JAWS_Export JAWS_Timer
53 // Abstraction base class for Timers that corresponds to the LHS of the
58 JAWS_Timer (JAWS_Timer_Impl
*impl
= 0);
60 static JAWS_Timer
* instance (void)
62 return ACE_Singleton
<JAWS_Timer
, ACE_SYNCH_MUTEX
>::instance ();
65 void schedule_timer ( long *timer_id
66 , const ACE_Time_Value
&delta
67 , JAWS_Event_Completer
*completer
71 void schedule_absolute_timer ( long *timer_id
72 , const ACE_Time_Value
&tv
73 , JAWS_Event_Completer
*completer
77 void schedule_interval_timer ( long *timer_id
78 , const ACE_Time_Value
&interval
79 , JAWS_Event_Completer
*completer
83 void cancel_timer (long timer_id
);
87 JAWS_Timer_Impl
*impl_
;
92 #endif /* JAWS_TIMER_H */