ACE_POSIX_Asynch_Operation Class Reference

This class implements ACE_Asynch_Operation for all implementations of Proactor (AIOCB, SIG, SUN) Specific future implementations can derive from this class. More...

#include <POSIX_Asynch_IO.h>

Inheritance diagram for ACE_POSIX_Asynch_Operation:

Inheritance graph
[legend]
Collaboration diagram for ACE_POSIX_Asynch_Operation:

Collaboration graph
[legend]
List of all members.

Public Member Functions

int open (const ACE_Handler::Proxy_Ptr &handler_proxy, ACE_HANDLE handle, const void *completion_key, ACE_Proactor *proactor=0)
int cancel (void)
 Check the documentation for ACE_Asynch_Operation::cancel.

ACE_Proactorproactor (void) const
 Return the underlying proactor.

ACE_POSIX_Proactorposix_proactor (void) const
 Return the underlying Proactor implementation.


Protected Member Functions

 ACE_POSIX_Asynch_Operation (ACE_POSIX_Proactor *posix_proactor)
 Contructor.

virtual ~ACE_POSIX_Asynch_Operation (void)
 Destructor.


Protected Attributes

ACE_POSIX_Proactorposix_proactor_
ACE_Proactorproactor_
 Proactor that this Asynch IO will be registered with.

ACE_Handler::Proxy_Ptr handler_proxy_
 Handler that will receive the callback.

ACE_HANDLE handle_
 I/O handle used for reading.


Detailed Description

This class implements ACE_Asynch_Operation for all implementations of Proactor (AIOCB, SIG, SUN) Specific future implementations can derive from this class.

Definition at line 158 of file POSIX_Asynch_IO.h.


Constructor & Destructor Documentation

ACE_POSIX_Asynch_Operation::ACE_POSIX_Asynch_Operation ACE_POSIX_Proactor posix_proactor  )  [protected]
 

Contructor.

Definition at line 208 of file POSIX_Asynch_IO.cpp.

00209   : posix_proactor_ (posix_proactor),
00210     handle_  (ACE_INVALID_HANDLE)
00211 {
00212 }

ACE_POSIX_Asynch_Operation::~ACE_POSIX_Asynch_Operation void   )  [protected, virtual]
 

Destructor.

Definition at line 204 of file POSIX_Asynch_IO.cpp.

00205 {
00206 }


Member Function Documentation

int ACE_POSIX_Asynch_Operation::cancel void   )  [virtual]
 

Check the documentation for ACE_Asynch_Operation::cancel.

Implements ACE_Asynch_Operation_Impl.

Reimplemented in ACE_POSIX_Asynch_Accept, and ACE_POSIX_Asynch_Connect.

Definition at line 185 of file POSIX_Asynch_IO.cpp.

References ACE_POSIX_Proactor::cancel_aio(), and posix_proactor_.

Referenced by ACE_AIOCB_Notify_Pipe_Manager::~ACE_AIOCB_Notify_Pipe_Manager().

00186 {
00187   if (!posix_proactor_)
00188     return -1;
00189   return posix_proactor_->cancel_aio (this->handle_);
00190 }

int ACE_POSIX_Asynch_Operation::open const ACE_Handler::Proxy_Ptr handler_proxy,
ACE_HANDLE  handle,
const void *  completion_key,
ACE_Proactor proactor = 0
[virtual]
 

Initializes the factory with information which will be used with each asynchronous call. If (handle == ACE_INVALID_HANDLE), ACE_Handler::handle will be called on the handler to get the correct handle. No need for the Proactor since the sub classes will know the correct implementation Proactor class, since this Operation class itself was created by the correct implementation Proactor class.

Implements ACE_Asynch_Operation_Impl.

Reimplemented in ACE_POSIX_Asynch_Accept, and ACE_POSIX_Asynch_Connect.

Definition at line 146 of file POSIX_Asynch_IO.cpp.

References ACE_Handler::handle(), ACE_Proactor::instance(), and ACE_Handler::Proxy_Ptr.

Referenced by ACE_AIOCB_Notify_Pipe_Manager::ACE_AIOCB_Notify_Pipe_Manager(), ACE_POSIX_Asynch_Connect::open(), ACE_POSIX_Asynch_Accept::open(), and ACE_POSIX_Asynch_Transmit_Handler::transmit().

00150 {
00151   this->proactor_ = proactor;
00152   this->handler_proxy_ = handler_proxy;
00153   this->handle_ = handle;
00154 
00155   // Grab the handle from the <handler> if <handle> is invalid
00156   if (this->handle_ == ACE_INVALID_HANDLE)
00157     {
00158       ACE_Handler *handler = handler_proxy.get ()->handler ();
00159       if (handler != 0)
00160         this->handle_ = handler->handle ();
00161     }
00162   if (this->handle_ == ACE_INVALID_HANDLE)
00163     return -1;
00164 
00165 #if 0
00166   // @@ If <proactor> is 0, let us not bother about getting this
00167   // Proactor, we have already got the specific implementation
00168   // Proactor.
00169 
00170   // If no proactor was passed
00171   if (this->proactor_ == 0)
00172     {
00173       // Grab the proactor from the <Service_Config> if
00174       // <handler->proactor> is zero
00175       this->proactor_ = this->handler_->proactor ();
00176       if (this->proactor_ == 0)
00177         this->proactor_ = ACE_Proactor::instance();
00178     }
00179 #endif /* 0 */
00180 
00181   return 0;
00182 }

ACE_POSIX_Proactor * ACE_POSIX_Asynch_Operation::posix_proactor void   )  const
 

Return the underlying Proactor implementation.

Definition at line 199 of file POSIX_Asynch_IO.cpp.

References posix_proactor_.

Referenced by ACE_POSIX_Asynch_Accept::accept(), ACE_POSIX_Asynch_Connect::cancel(), ACE_POSIX_Asynch_Accept::cancel(), ACE_POSIX_Asynch_Accept::cancel_uncompleted(), ACE_POSIX_Asynch_Connect::close(), ACE_POSIX_Asynch_Accept::close(), ACE_POSIX_Asynch_Connect::connect(), ACE_POSIX_Asynch_Connect::handle_close(), ACE_POSIX_Asynch_Accept::handle_input(), ACE_POSIX_Asynch_Connect::handle_output(), ACE_POSIX_Asynch_Accept::open(), ACE_POSIX_Asynch_Connect::post_result(), ACE_POSIX_Asynch_Read_File::read(), ACE_POSIX_Asynch_Read_Stream::read(), ACE_POSIX_Asynch_Read_Dgram::recv(), ACE_POSIX_Asynch_Write_Dgram::send(), ACE_POSIX_Asynch_Write_File::write(), and ACE_POSIX_Asynch_Write_Stream::write().

00200 {
00201   return this->posix_proactor_;
00202 }

ACE_Proactor * ACE_POSIX_Asynch_Operation::proactor void   )  const [virtual]
 

Return the underlying proactor.

Implements ACE_Asynch_Operation_Impl.

Definition at line 193 of file POSIX_Asynch_IO.cpp.

00194 {
00195   return this->proactor_;
00196 }


Member Data Documentation

ACE_HANDLE ACE_POSIX_Asynch_Operation::handle_ [protected]
 

I/O handle used for reading.

Definition at line 216 of file POSIX_Asynch_IO.h.

ACE_Handler::Proxy_Ptr ACE_POSIX_Asynch_Operation::handler_proxy_ [protected]
 

Handler that will receive the callback.

Definition at line 213 of file POSIX_Asynch_IO.h.

ACE_POSIX_Proactor* ACE_POSIX_Asynch_Operation::posix_proactor_ [protected]
 

It is easy to get this specific implementation proactor here, since it is the one that creates the correct POSIX_Asynch_* objects. We can use this to get to the implementation proactor directly.

Definition at line 207 of file POSIX_Asynch_IO.h.

Referenced by cancel(), and posix_proactor().

ACE_Proactor* ACE_POSIX_Asynch_Operation::proactor_ [protected]
 

Proactor that this Asynch IO will be registered with.

Definition at line 210 of file POSIX_Asynch_IO.h.


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 11:26:34 2006 for ACE by doxygen 1.3.6