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.
21 virtual ~JAWS_Timer_Impl () {}
23 virtual void schedule_timer ( long *timer_id
24 , const ACE_Time_Value
&delta
25 , JAWS_Event_Completer
*completer
28 // Schedule a timer to expire at now+delta.
30 virtual void schedule_absolute_timer ( long *timer_id
31 , const ACE_Time_Value
&tv
32 , JAWS_Event_Completer
*completer
35 // Schedule a timer to expire at tv.
37 virtual void schedule_interval_timer ( long *timer_id
38 , const ACE_Time_Value
&interval
39 , JAWS_Event_Completer
*completer
42 // Schedule a timer to expire at now+interval, and every interval following.
44 virtual void cancel_timer (long timer_id
) = 0;
49 class JAWS_Export JAWS_Timer
51 // Abstraction base class for Timers that corresponds to the LHS of the
55 JAWS_Timer (JAWS_Timer_Impl
*impl
= 0);
57 static JAWS_Timer
* instance ()
59 return ACE_Singleton
<JAWS_Timer
, ACE_SYNCH_MUTEX
>::instance ();
62 void schedule_timer ( long *timer_id
63 , const ACE_Time_Value
&delta
64 , JAWS_Event_Completer
*completer
68 void schedule_absolute_timer ( long *timer_id
69 , const ACE_Time_Value
&tv
70 , JAWS_Event_Completer
*completer
74 void schedule_interval_timer ( long *timer_id
75 , const ACE_Time_Value
&interval
76 , JAWS_Event_Completer
*completer
80 void cancel_timer (long timer_id
);
83 JAWS_Timer_Impl
*impl_
;
87 #endif /* JAWS_TIMER_H */