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"
17 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
22 * @class ACE_Event_Handler_Handle_Timeout_Upcall
24 * @brief Functor for Timer_Queues.
26 * This class implements the functor required by the Timer
27 * Queue to call <handle_timeout> on ACE_Event_Handlers.
29 class ACE_Export ACE_Event_Handler_Handle_Timeout_Upcall
32 ACE_Event_Handler_Handle_Timeout_Upcall () = default;
35 ~ACE_Event_Handler_Handle_Timeout_Upcall () = default;
37 /// This method is called when a timer is registered.
38 int registration (ACE_Timer_Queue
&timer_queue
,
39 ACE_Event_Handler
*handler
,
42 /// This method is called before the timer expires.
43 int preinvoke (ACE_Timer_Queue
&timer_queue
,
44 ACE_Event_Handler
*handler
,
47 const ACE_Time_Value
&cur_time
,
48 const void *&upcall_act
);
50 /// This method is called when the timer expires.
51 int timeout (ACE_Timer_Queue
&timer_queue
,
52 ACE_Event_Handler
*handler
,
55 const ACE_Time_Value
&cur_time
);
57 /// This method is called after the timer expires.
58 int postinvoke (ACE_Timer_Queue
&timer_queue
,
59 ACE_Event_Handler
*handler
,
62 const ACE_Time_Value
&cur_time
,
63 const void *upcall_act
);
65 /// This method is called when a handler is cancelled
66 int cancel_type (ACE_Timer_Queue
&timer_queue
,
67 ACE_Event_Handler
*handler
,
69 int &requires_reference_counting
);
71 /// This method is called when a timer is cancelled
72 int cancel_timer (ACE_Timer_Queue
&timer_queue
,
73 ACE_Event_Handler
*handler
,
75 int requires_reference_counting
);
77 /// This method is called when the timer queue is destroyed and
78 /// the timer is still contained in it
79 int deletion (ACE_Timer_Queue
&timer_queue
,
80 ACE_Event_Handler
*handler
,
83 /// Declare the dynamic allocation hooks.
84 ACE_ALLOC_HOOK_DECLARE
;
87 ACE_Event_Handler_Handle_Timeout_Upcall (const ACE_Event_Handler_Handle_Timeout_Upcall
&) = delete;
88 ACE_Event_Handler_Handle_Timeout_Upcall (ACE_Event_Handler_Handle_Timeout_Upcall
&&) = delete;
89 ACE_Event_Handler_Handle_Timeout_Upcall
&operator= (const ACE_Event_Handler_Handle_Timeout_Upcall
&) = delete;
90 ACE_Event_Handler_Handle_Timeout_Upcall
&operator= (ACE_Event_Handler_Handle_Timeout_Upcall
&&) = delete;
92 /// Flag indicating that reference counting is required for this
93 /// event handler upcall.
94 int requires_reference_counting_
{0};
97 ACE_END_VERSIONED_NAMESPACE_DECL
99 #if defined(__ACE_INLINE__)
100 # include "ace/Event_Handler_Handle_Timeout_Upcall.inl"
101 #endif /* __ACE_INLINE__ */
103 #include /**/ "ace/post.h"
104 #endif /* ACE_EVENT_HANDLER_HANDLE_TIMEOUT_UPCALL_H */