Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / ACE / examples / APG / Timers / Upcall.h
blob5b2c1c7593e10e4e4de27563018317952ffc5953
1 /* -*- C++ -*- */
2 #if !defined(UPCALL_H)
3 #define UPCALL_H
5 #include "ace/Timer_Queue_T.h"
6 #include "ace/Timer_Heap_T.h"
7 #include "ace/Synch.h"
9 #include "PCB.h"
11 // Listing 1 code/ch20
12 class UpcallHandler;
14 typedef ACE_Timer_Queue_T<PCB*, UpcallHandler, ACE_Null_Mutex>
15 PTimerQueue;
17 // Create a special heap-based timer queue that allows you to
18 // control exactly how timer evetns are handled.
19 typedef ACE_Timer_Heap_T<PCB*, UpcallHandler, ACE_Null_Mutex>
20 PTimerHeap;
21 // Listing 1
23 class UpcallHandler
25 public:
26 // The signature of this method changed at ACE 5.4. The 'recurring_timer'
27 // parameter was added.
28 int timeout (PTimerQueue &timer_queue,
29 PCB *handler,
30 const void *arg,
31 int recurring_timer,
32 const ACE_Time_Value &cur_time);
34 #if 0
35 // This method was removed at ACE 5.4. Replaced by cancel_type() and
36 // cancel_timer().
37 // This method is called when the timer is canceled.
38 int cancellation (PTimerQueue &timer_queue,
39 PCB *handler);
40 #endif
42 // This method is called when the timer queue is destroyed and
43 // the timer is still contained in it.
44 int deletion (PTimerQueue &timer_queue,
45 PCB *handler,
46 const void *arg);
48 // The following methods don't appear before ACE 5.4, so aren't
49 // referenced in APG (it's based on ACE 5.3).
51 // This method is called when a timer is registered.
52 int registration (PTimerQueue &timer_queue,
53 PCB *handler,
54 const void *arg);
56 // This method is called before the timer expires.
57 int preinvoke (PTimerQueue &timer_queue,
58 PCB *handler,
59 const void *arg,
60 int recurring_timer,
61 const ACE_Time_Value &cur_time,
62 const void *&upcall_act);
64 // This method is called after the timer expires.
65 int postinvoke (PTimerQueue &timer_queue,
66 PCB *handler,
67 const void *arg,
68 int recurring_timer,
69 const ACE_Time_Value &cur_time,
70 const void *upcall_act);
72 // This method is called when a handler is cancelled
73 int cancel_type (PTimerQueue &timer_queue,
74 PCB *handler,
75 int dont_call,
76 int &requires_reference_counting);
78 // This method is called when a timer is cancelled
79 int cancel_timer (PTimerQueue &timer_queue,
80 PCB *handler,
81 int dont_call,
82 int requires_reference_counting);
85 #endif /*UPCALL_H*/