GitHub Actions: Try MSVC builds with /std:c++17 and 20
[ACE_TAO.git] / ACE / ace / Event_Handler_Handle_Timeout_Upcall.inl
blob8c0b41bb0c3ba2f90cc5a04a4620395745583399
1 #include "ace/Event_Handler.h"
3 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
5 ACE_INLINE int
6 ACE_Event_Handler_Handle_Timeout_Upcall::
7 registration (ACE_Timer_Queue &,
8               ACE_Event_Handler *event_handler,
9               const void *)
11   event_handler->add_reference ();
12   return 0;
15 ACE_INLINE int
16 ACE_Event_Handler_Handle_Timeout_Upcall::
17 preinvoke (ACE_Timer_Queue &,
18           ACE_Event_Handler *event_handler,
19           const void *,
20           int,
21           const ACE_Time_Value &,
22           const void * & upcall_act)
24   bool const requires_reference_counting =
25     event_handler->reference_counting_policy ().value () ==
26     ACE_Event_Handler::Reference_Counting_Policy::ENABLED;
28   if (requires_reference_counting)
29     {
30       event_handler->add_reference ();
32       upcall_act = &this->requires_reference_counting_;
33     }
35   return 0;
38 ACE_INLINE int
39 ACE_Event_Handler_Handle_Timeout_Upcall::
40 postinvoke (ACE_Timer_Queue & /* timer_queue */,
41             ACE_Event_Handler *event_handler,
42             const void * /* timer_act */,
43             int /* recurring_timer */,
44             const ACE_Time_Value & /* cur_time */,
45             const void *upcall_act)
47   if (upcall_act == &this->requires_reference_counting_)
48     {
49       event_handler->remove_reference ();
50     }
52   return 0;
55 ACE_INLINE int
56 ACE_Event_Handler_Handle_Timeout_Upcall::
57 cancel_timer (ACE_Timer_Queue &,
58               ACE_Event_Handler *event_handler,
59               int,
60               int requires_reference_counting)
62   if (requires_reference_counting)
63     event_handler->remove_reference ();
65   return 0;
69 ACE_END_VERSIONED_NAMESPACE_DECL