Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / ACE / examples / APG / Timers / TimerDispatcher.h
blob44df8959af2a790b83484aba71f21e873935c5ec
1 /* -*- C++ -*- */
2 #if !defined(TIMER_DISPATCHER_H)
3 #define TIMER_DISPATCHER_H
5 #include "ace/Event_Handler.h"
6 #include "ace/Singleton.h"
7 #include "ace/Synch.h" // needed for ACE_Event
8 #include "ace/Timer_Queue.h"
10 // Listing 1 code/ch20
11 class Timer_Dispatcher
13 public:
14 void wait_for_event ();
16 long schedule (ACE_Event_Handler *cb,
17 void *arg,
18 const ACE_Time_Value &abs_time,
19 const ACE_Time_Value &interval);
21 int cancel (ACE_Event_Handler *cb,
22 int dont_call_handle_close = 1);
24 int reset_interval (long timer_id,
25 const ACE_Time_Value &interval);
27 void set (ACE_Timer_Queue *timer_queue);
29 private:
30 ACE_Timer_Queue *timer_queue_;
31 ACE_Event timer_;
34 typedef ACE_Singleton<Timer_Dispatcher, ACE_Null_Mutex> Timer;
35 // Listing 1
37 #endif /*TIMER_DISPATCHER_H*/