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

ACE_WIN32_Asynch_Operation Class Reference

This class abstracts out the common things needed for implementing Asynch_Operation for WIN32 platform. More...

#include <WIN32_Asynch_IO.h>

Inheritance diagram for ACE_WIN32_Asynch_Operation:

Inheritance graph
[legend]
Collaboration diagram for ACE_WIN32_Asynch_Operation:

Collaboration graph
[legend]
List of all members.

Public Methods

int open (ACE_Handler &handler, ACE_HANDLE handle, const void *completion_key, ACE_Proactor *proactor)
int cancel (void)
ACE_Proactorproactor (void) const
 Return the underlying proactor. More...


Protected Methods

 ACE_WIN32_Asynch_Operation (ACE_WIN32_Proactor *win32_proactor)
 Constructor. More...

virtual ~ACE_WIN32_Asynch_Operation (void)
 Destructor. More...


Protected Attributes

ACE_WIN32_Proactorwin32_proactor_
 Win32 Proactor. More...

ACE_Proactorproactor_
 Proactor that this asynch IO is registered with. More...

ACE_Handlerhandler_
 Handler that will receive the callback. More...

ACE_HANDLE handle_
 I/O handle used for reading. More...


Detailed Description

This class abstracts out the common things needed for implementing Asynch_Operation for WIN32 platform.

Definition at line 153 of file WIN32_Asynch_IO.h.


Constructor & Destructor Documentation

ACE_WIN32_Asynch_Operation::ACE_WIN32_Asynch_Operation ACE_WIN32_Proactor   win32_proactor [protected]
 

Constructor.

Definition at line 189 of file WIN32_Asynch_IO.cpp.

00190   : ACE_Asynch_Operation_Impl (),
00191     win32_proactor_ (win32_proactor),
00192     proactor_ (0),
00193     handler_ (0),
00194     handle_ (ACE_INVALID_HANDLE)
00195 {
00196 }

ACE_WIN32_Asynch_Operation::~ACE_WIN32_Asynch_Operation void    [protected, virtual]
 

Destructor.

Definition at line 198 of file WIN32_Asynch_IO.cpp.

00199 {
00200 }


Member Function Documentation

int ACE_WIN32_Asynch_Operation::cancel void    [virtual]
 

This cancels all pending accepts operations that were issued by the calling thread. The function does not cancel asynchronous operations issued by other threads.

Implements ACE_Asynch_Operation_Impl.

Reimplemented in ACE_WIN32_Asynch_Read_Stream.

Definition at line 157 of file WIN32_Asynch_IO.cpp.

References handle_.

Referenced by ACE_WIN32_Asynch_Write_Dgram::cancel, ACE_WIN32_Asynch_Read_Dgram::cancel, ACE_WIN32_Asynch_Transmit_File::cancel, ACE_WIN32_Asynch_Accept::cancel, ACE_WIN32_Asynch_Write_File::cancel, ACE_WIN32_Asynch_Read_File::cancel, ACE_WIN32_Asynch_Write_Stream::cancel, and ACE_WIN32_Asynch_Read_Stream::cancel.

00158 {
00159 #if (defined (ACE_HAS_WINNT4) && (ACE_HAS_WINNT4 != 0)) \
00160     && (   (defined (_MSC_VER) && (_MSC_VER > 1020)) \
00161         || (defined (__BORLANDC__) && (__BORLANDC__ >= 0x530)))
00162   // All I/O operations that are canceled will complete with the error
00163   // ERROR_OPERATION_ABORTED. All completion notifications for the I/O
00164   // operations will occur normally.
00165 
00166   // @@ This API returns 0 on failure. So, I am returning -1 in that
00167   //    case. Is that right? (Alex).
00168 
00169   int result = (int) ::CancelIo (this->handle_);
00170 
00171   if (result == 0)
00172     // Couldnt cancel the operations.
00173     return 2;
00174 
00175   // result is non-zero. All the operations are cancelled then.
00176   return 0;
00177 
00178 #else /* Not ACE_HAS_WINNT4 && ACE_HAS_WINNT4!=0 && _MSC... */
00179   ACE_NOTSUP_RETURN (-1);
00180 #endif /* ACE_HAS_AIO_CALLS */
00181 }

int ACE_WIN32_Asynch_Operation::open ACE_Handler   handler,
ACE_HANDLE    handle,
const void *    completion_key,
ACE_Proactor   proactor
[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.

Implements ACE_Asynch_Operation_Impl.

Reimplemented in ACE_WIN32_Asynch_Read_Stream.

Definition at line 136 of file WIN32_Asynch_IO.cpp.

References ACE_Handler::handle, handle_, handler_, proactor_, ACE_WIN32_Proactor::register_handle, and win32_proactor_.

Referenced by ACE_WIN32_Asynch_Write_Dgram::open, ACE_WIN32_Asynch_Read_Dgram::open, ACE_WIN32_Asynch_Transmit_File::open, ACE_WIN32_Asynch_Connect::open, ACE_WIN32_Asynch_Accept::open, ACE_WIN32_Asynch_Write_File::open, ACE_WIN32_Asynch_Read_File::open, ACE_WIN32_Asynch_Write_Stream::open, and ACE_WIN32_Asynch_Read_Stream::open.

00140 {
00141   this->proactor_ = proactor;
00142   this->handler_ = &handler;
00143   this->handle_ = handle;
00144 
00145   // Grab the handle from the <handler> if <handle> is invalid
00146   if (this->handle_ == ACE_INVALID_HANDLE)
00147     this->handle_ = this->handler_->handle ();
00148   if (this->handle_ == ACE_INVALID_HANDLE)
00149     return -1;
00150 
00151   // Register with the <proactor>.
00152   return this->win32_proactor_->register_handle (this->handle_,
00153                                                  completion_key);
00154 }

ACE_Proactor * ACE_WIN32_Asynch_Operation::proactor void    const [virtual]
 

Return the underlying proactor.

Implements ACE_Asynch_Operation_Impl.

Reimplemented in ACE_WIN32_Asynch_Read_Stream.

Definition at line 184 of file WIN32_Asynch_IO.cpp.

References proactor_.

Referenced by ACE_WIN32_Asynch_Write_Dgram::proactor, ACE_WIN32_Asynch_Read_Dgram::proactor, ACE_WIN32_Asynch_Transmit_File::proactor, ACE_WIN32_Asynch_Connect::proactor, ACE_WIN32_Asynch_Accept::proactor, ACE_WIN32_Asynch_Write_File::proactor, ACE_WIN32_Asynch_Read_File::proactor, ACE_WIN32_Asynch_Write_Stream::proactor, and ACE_WIN32_Asynch_Read_Stream::proactor.

00185 {
00186   return this->proactor_;
00187 }


Member Data Documentation

ACE_HANDLE ACE_WIN32_Asynch_Operation::handle_ [protected]
 

I/O handle used for reading.

Definition at line 196 of file WIN32_Asynch_IO.h.

Referenced by cancel, and open.

ACE_Handler* ACE_WIN32_Asynch_Operation::handler_ [protected]
 

Handler that will receive the callback.

Definition at line 193 of file WIN32_Asynch_IO.h.

Referenced by open.

ACE_Proactor* ACE_WIN32_Asynch_Operation::proactor_ [protected]
 

Proactor that this asynch IO is registered with.

Definition at line 190 of file WIN32_Asynch_IO.h.

Referenced by open, and proactor.

ACE_WIN32_Proactor* ACE_WIN32_Asynch_Operation::win32_proactor_ [protected]
 

Win32 Proactor.

Definition at line 187 of file WIN32_Asynch_IO.h.

Referenced by ACE_WIN32_Asynch_Connect::cancel, ACE_WIN32_Asynch_Connect::close, ACE_WIN32_Asynch_Connect::connect, ACE_WIN32_Asynch_Connect::handle_close, open, and ACE_WIN32_Asynch_Connect::post_result.


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