Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACE_Proactor_Handle_Timeout_Upcall Class Reference

Functor for <ACE_Timer_Queue>. More...

#include <Proactor.h>

Collaboration diagram for ACE_Proactor_Handle_Timeout_Upcall:

Collaboration graph
[legend]
List of all members.

Public Methods

 ACE_Proactor_Handle_Timeout_Upcall (void)
 Constructor. More...

int timeout (TIMER_QUEUE &timer_queue, ACE_Handler *handler, const void *arg, const ACE_Time_Value &cur_time)
 This method is called when the timer expires. More...

int cancellation (TIMER_QUEUE &timer_queue, ACE_Handler *handler)
 This method is called when the timer is canceled. More...

int deletion (TIMER_QUEUE &timer_queue, ACE_Handler *handler, const void *arg)
 This method is called when the timer queue is destroyed and the timer is still contained in it. More...


Protected Methods

int proactor (ACE_Proactor &proactor)
 Set the proactor. This will fail, if one is already set! More...


Protected Attributes

ACE_Proactorproactor_
 Handle to the proactor. This is needed for posting a timer result to the Proactor's completion queue. More...


Private Types

typedef ACE_Timer_Queue_T<
ACE_Handler *, ACE_Proactor_Handle_Timeout_Upcall,
ACE_SYNCH_RECURSIVE_MUTEX > 
TIMER_QUEUE
 Type def for the timer queue. More...


Friends

class ACE_Proactor
 The main Proactor class has special permissions. More...


Detailed Description

Functor for <ACE_Timer_Queue>.

This class implements the functor required by the Timer Queue to call <handle_timeout> on ACE_Handlers.

Definition at line 53 of file Proactor.h.


Member Typedef Documentation

typedef ACE_Timer_Queue_T<ACE_Handler *, ACE_Proactor_Handle_Timeout_Upcall, ACE_SYNCH_RECURSIVE_MUTEX> ACE_Proactor_Handle_Timeout_Upcall::TIMER_QUEUE [private]
 

Type def for the timer queue.

Definition at line 60 of file Proactor.h.


Constructor & Destructor Documentation

ACE_Proactor_Handle_Timeout_Upcall::ACE_Proactor_Handle_Timeout_Upcall void   
 

Constructor.

Definition at line 162 of file Proactor.cpp.

00163   : proactor_ (0)
00164 {
00165 }


Member Function Documentation

int ACE_Proactor_Handle_Timeout_Upcall::cancellation TIMER_QUEUE   timer_queue,
ACE_Handler   handler
 

This method is called when the timer is canceled.

Definition at line 205 of file Proactor.cpp.

00207 {
00208   ACE_UNUSED_ARG (timer_queue);
00209   ACE_UNUSED_ARG (handler);
00210 
00211   // Do nothing
00212   return 0;
00213 }

int ACE_Proactor_Handle_Timeout_Upcall::deletion TIMER_QUEUE   timer_queue,
ACE_Handler   handler,
const void *    arg
 

This method is called when the timer queue is destroyed and the timer is still contained in it.

Definition at line 216 of file Proactor.cpp.

00219 {
00220   ACE_UNUSED_ARG (timer_queue);
00221   ACE_UNUSED_ARG (handler);
00222   ACE_UNUSED_ARG (arg);
00223 
00224   // Do nothing
00225   return 0;
00226 }

int ACE_Proactor_Handle_Timeout_Upcall::proactor ACE_Proactor   proactor [protected]
 

Set the proactor. This will fail, if one is already set!

Definition at line 229 of file Proactor.cpp.

References ACE_ERROR_RETURN, ACE_LIB_TEXT, LM_ERROR, and proactor_.

Referenced by ACE_Proactor::timer_queue.

00230 {
00231   if (this->proactor_ == 0)
00232     {
00233       this->proactor_ = &proactor;
00234       return 0;
00235     }
00236   else
00237     ACE_ERROR_RETURN ((LM_ERROR,
00238                        ACE_LIB_TEXT ("ACE_Proactor_Handle_Timeout_Upcall is only suppose")
00239                        ACE_LIB_TEXT (" to be used with ONE (and only one) Proactor\n")),
00240                       -1);
00241 }

int ACE_Proactor_Handle_Timeout_Upcall::timeout TIMER_QUEUE   timer_queue,
ACE_Handler   handler,
const void *    arg,
const ACE_Time_Value   cur_time
 

This method is called when the timer expires.

Definition at line 168 of file Proactor.cpp.

References ACE_ERROR_RETURN, ACE_LIB_TEXT, ACE_Proactor::create_asynch_timer, LM_ERROR, ACE_Asynch_Result_Impl::post_completion, and proactor_.

00172 {
00173   ACE_UNUSED_ARG (timer_queue);
00174 
00175   if (this->proactor_ == 0)
00176     ACE_ERROR_RETURN ((LM_ERROR,
00177                        ACE_LIB_TEXT ("(%t) No Proactor set in ACE_Proactor_Handle_Timeout_Upcall,")
00178                        ACE_LIB_TEXT (" no completion port to post timeout to?!@\n")),
00179                       -1);
00180 
00181   // Create the Asynch_Timer.
00182   ACE_Asynch_Result_Impl *asynch_timer = this->proactor_->create_asynch_timer (*handler,
00183                                                                                act,
00184                                                                                time,
00185                                                                                ACE_INVALID_HANDLE,
00186                                                                                0,
00187                                                                                -1);
00188   if (asynch_timer == 0)
00189     ACE_ERROR_RETURN ((LM_ERROR,
00190                        ACE_LIB_TEXT ("%N:%l:(%P | %t):%p\n"),
00191                        ACE_LIB_TEXT ("ACE_Proactor_Handle_Timeout_Upcall::timeout:")
00192                        ACE_LIB_TEXT ("create_asynch_timer failed")),
00193                       -1);
00194 
00195   // Post a completion.
00196   if (asynch_timer->post_completion (this->proactor_->implementation ()) == -1)
00197     ACE_ERROR_RETURN ((LM_ERROR,
00198                        ACE_LIB_TEXT ("Failure in dealing with timers: ")
00199                        ACE_LIB_TEXT ("PostQueuedCompletionStatus failed\n")),
00200                       -1);
00201   return 0;
00202 }


Friends And Related Function Documentation

friend class ACE_Proactor [friend]
 

The main Proactor class has special permissions.

Definition at line 63 of file Proactor.h.


Member Data Documentation

ACE_Proactor* ACE_Proactor_Handle_Timeout_Upcall::proactor_ [protected]
 

Handle to the proactor. This is needed for posting a timer result to the Proactor's completion queue.

Definition at line 91 of file Proactor.h.

Referenced by proactor, and timeout.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 12:54:21 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002