diff options
author | mcorino <mcorino@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2011-12-15 11:09:41 +0000 |
---|---|---|
committer | mcorino <mcorino@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2011-12-15 11:09:41 +0000 |
commit | 9d1004206324867a4287e99b9675d24e536fa090 (patch) | |
tree | 89d59383f294627917ee3cf054f347884a914f32 /ACE/ace/Event_Handler_Handle_Timeout_Upcall.inl | |
parent | b8d69007a4e25977f11cc3de8eb3793c0c61161a (diff) | |
download | ATCD-9d1004206324867a4287e99b9675d24e536fa090.tar.gz |
Thu Dec 15 11:00:00 UTC 2011 Martin Corino <mcorino@remedy.nl>
Merged timer_policy branch.
Diffstat (limited to 'ACE/ace/Event_Handler_Handle_Timeout_Upcall.inl')
-rw-r--r-- | ACE/ace/Event_Handler_Handle_Timeout_Upcall.inl | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/ACE/ace/Event_Handler_Handle_Timeout_Upcall.inl b/ACE/ace/Event_Handler_Handle_Timeout_Upcall.inl new file mode 100644 index 00000000000..a2dc51cc453 --- /dev/null +++ b/ACE/ace/Event_Handler_Handle_Timeout_Upcall.inl @@ -0,0 +1,71 @@ +// $Id$ + +#include "ace/Event_Handler.h" + +ACE_BEGIN_VERSIONED_NAMESPACE_DECL + +ACE_INLINE int +ACE_Event_Handler_Handle_Timeout_Upcall:: +registration (ACE_Timer_Queue &, + ACE_Event_Handler *event_handler, + const void *) +{ + event_handler->add_reference (); + return 0; +} + +ACE_INLINE int +ACE_Event_Handler_Handle_Timeout_Upcall:: +preinvoke (ACE_Timer_Queue &, + ACE_Event_Handler *event_handler, + const void *, + int, + const ACE_Time_Value &, + const void * & upcall_act) +{ + bool const requires_reference_counting = + event_handler->reference_counting_policy ().value () == + ACE_Event_Handler::Reference_Counting_Policy::ENABLED; + + if (requires_reference_counting) + { + event_handler->add_reference (); + + upcall_act = &this->requires_reference_counting_; + } + + return 0; +} + +ACE_INLINE int +ACE_Event_Handler_Handle_Timeout_Upcall:: +postinvoke (ACE_Timer_Queue & /* timer_queue */, + ACE_Event_Handler *event_handler, + const void * /* timer_act */, + int /* recurring_timer */, + const ACE_Time_Value & /* cur_time */, + const void *upcall_act) +{ + if (upcall_act == &this->requires_reference_counting_) + { + event_handler->remove_reference (); + } + + return 0; +} + +ACE_INLINE int +ACE_Event_Handler_Handle_Timeout_Upcall:: +cancel_timer (ACE_Timer_Queue &, + ACE_Event_Handler *event_handler, + int, + int requires_reference_counting) +{ + if (requires_reference_counting) + event_handler->remove_reference (); + + return 0; +} + + +ACE_END_VERSIONED_NAMESPACE_DECL |