Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / ACE / apps / JAWS3 / jaws3 / Timer.h
blob31c2affdc04425d38fa2b60c183fc833206c0c76
1 /* -*- c++ -*- */
2 #ifndef JAWS_TIMER_H
3 #define JAWS_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/Event_Completer.h"
12 class JAWS_Timer;
13 class JAWS_Timer_Impl;
15 class JAWS_Export JAWS_Timer_Impl
16 // = TITLE
17 // Implementation base class for Timers that corresponds to the
18 // RHS of the Bridge pattern.
20 public:
21 virtual ~JAWS_Timer_Impl () {}
23 virtual void schedule_timer ( long *timer_id
24 , const ACE_Time_Value &delta
25 , JAWS_Event_Completer *completer
26 , void *act = 0
27 ) = 0;
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
33 , void *act = 0
34 ) = 0;
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
40 , void *act = 0
41 ) = 0;
42 // Schedule a timer to expire at now+interval, and every interval following.
44 virtual void cancel_timer (long timer_id) = 0;
45 // Cancel a timer.
49 class JAWS_Export JAWS_Timer
50 // = TITLE
51 // Abstraction base class for Timers that corresponds to the LHS of the
52 // Bridge pattern.
54 public:
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
65 , void *act = 0
68 void schedule_absolute_timer ( long *timer_id
69 , const ACE_Time_Value &tv
70 , JAWS_Event_Completer *completer
71 , void *act = 0
74 void schedule_interval_timer ( long *timer_id
75 , const ACE_Time_Value &interval
76 , JAWS_Event_Completer *completer
77 , void *act = 0
80 void cancel_timer (long timer_id);
82 private:
83 JAWS_Timer_Impl *impl_;
87 #endif /* JAWS_TIMER_H */