1 #ifndef ACE_EVENT_HANDLER_HANDLE_TIMEOUT_UPCALL_H
2 #define ACE_EVENT_HANDLER_HANDLE_TIMEOUT_UPCALL_H
4 #include /**/ "ace/pre.h"
7 * @file Event_Handler_Handle_Timeout_Upcall.h
9 * @author Carlos O'Ryan <coryan@atdesk.com>
11 * Based on classes and files developed by Doug Schmidt, Darrell
12 * Brunsch, Irfan Pyarali and a cast of thousands.
15 #include "ace/Timer_Queuefwd.h"
16 #include "ace/Copy_Disabled.h"
18 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
23 * @class ACE_Event_Handler_Handle_Timeout_Upcall
25 * @brief Functor for Timer_Queues.
27 * This class implements the functor required by the Timer
28 * Queue to call <handle_timeout> on ACE_Event_Handlers.
30 class ACE_Export ACE_Event_Handler_Handle_Timeout_Upcall
31 : private ACE_Copy_Disabled
35 ACE_Event_Handler_Handle_Timeout_Upcall (void);
38 ~ACE_Event_Handler_Handle_Timeout_Upcall (void);
40 /// This method is called when a timer is registered.
41 int registration (ACE_Timer_Queue
&timer_queue
,
42 ACE_Event_Handler
*handler
,
45 /// This method is called before the timer expires.
46 int preinvoke (ACE_Timer_Queue
&timer_queue
,
47 ACE_Event_Handler
*handler
,
50 const ACE_Time_Value
&cur_time
,
51 const void *&upcall_act
);
53 /// This method is called when the timer expires.
54 int timeout (ACE_Timer_Queue
&timer_queue
,
55 ACE_Event_Handler
*handler
,
58 const ACE_Time_Value
&cur_time
);
60 /// This method is called after the timer expires.
61 int postinvoke (ACE_Timer_Queue
&timer_queue
,
62 ACE_Event_Handler
*handler
,
65 const ACE_Time_Value
&cur_time
,
66 const void *upcall_act
);
68 /// This method is called when a handler is cancelled
69 int cancel_type (ACE_Timer_Queue
&timer_queue
,
70 ACE_Event_Handler
*handler
,
72 int &requires_reference_counting
);
74 /// This method is called when a timer is cancelled
75 int cancel_timer (ACE_Timer_Queue
&timer_queue
,
76 ACE_Event_Handler
*handler
,
78 int requires_reference_counting
);
80 /// This method is called when the timer queue is destroyed and
81 /// the timer is still contained in it
82 int deletion (ACE_Timer_Queue
&timer_queue
,
83 ACE_Event_Handler
*handler
,
86 /// Declare the dynamic allocation hooks.
87 ACE_ALLOC_HOOK_DECLARE
;
91 /// Flag indicating that reference counting is required for this
92 /// event handler upcall.
93 int requires_reference_counting_
;
96 ACE_END_VERSIONED_NAMESPACE_DECL
98 #if defined(__ACE_INLINE__)
99 # include "ace/Event_Handler_Handle_Timeout_Upcall.inl"
100 #endif /* __ACE_INLINE__ */
102 #include /**/ "ace/post.h"
103 #endif /* ACE_EVENT_HANDLER_HANDLE_TIMEOUT_UPCALL_H */