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 Member Functions

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


Protected Member Functions

 ACE_WIN32_Asynch_Operation (ACE_WIN32_Proactor *win32_proactor)
 Constructor.

virtual ~ACE_WIN32_Asynch_Operation (void)
 Destructor.


Protected Attributes

ACE_WIN32_Proactorwin32_proactor_
 Win32 Proactor.

ACE_Proactorproactor_
 Proactor that this asynch IO is 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 abstracts out the common things needed for implementing Asynch_Operation for WIN32 platform.

Definition at line 155 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 200 of file WIN32_Asynch_IO.cpp.

00201   : ACE_Asynch_Operation_Impl (),
00202     win32_proactor_ (win32_proactor),
00203     proactor_ (0),
00204     handle_ (ACE_INVALID_HANDLE)
00205 {
00206 }

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

Destructor.

Definition at line 208 of file WIN32_Asynch_IO.cpp.

00209 {
00210 }


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, ACE_WIN32_Asynch_Write_Stream, ACE_WIN32_Asynch_Read_File, ACE_WIN32_Asynch_Write_File, ACE_WIN32_Asynch_Accept, ACE_WIN32_Asynch_Connect, ACE_WIN32_Asynch_Transmit_File, ACE_WIN32_Asynch_Read_Dgram, and ACE_WIN32_Asynch_Write_Dgram.

Definition at line 167 of file WIN32_Asynch_IO.cpp.

References ACE_NOTSUP_RETURN.

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().

00168 {
00169 #if (defined (ACE_HAS_WINNT4) && (ACE_HAS_WINNT4 != 0)) \
00170     && (   (defined (_MSC_VER)) \
00171         || (defined (__BORLANDC__)) \
00172         || (defined (__MINGW32)))
00173   // All I/O operations that are canceled will complete with the error
00174   // ERROR_OPERATION_ABORTED. All completion notifications for the I/O
00175   // operations will occur normally.
00176 
00177   // @@ This API returns 0 on failure. So, I am returning -1 in that
00178   //    case. Is that right? (Alex).
00179 
00180   int const result = (int) ::CancelIo (this->handle_);
00181 
00182   if (result == 0)
00183     // Couldnt cancel the operations.
00184     return 2;
00185 
00186   // result is non-zero. All the operations are cancelled then.
00187   return 0;
00188 
00189 #else /* Not ACE_HAS_WINNT4 && ACE_HAS_WINNT4!=0 && _MSC... */
00190   ACE_NOTSUP_RETURN (-1);
00191 #endif /* ACE_HAS_AIO_CALLS */
00192 }

int ACE_WIN32_Asynch_Operation::open const ACE_Handler::Proxy_Ptr handler_proxy,
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 ( == ACE_INVALID_HANDLE), <ACE_Handler::handle> will be called on the to get the correct handle.

Implements ACE_Asynch_Operation_Impl.

Reimplemented in ACE_WIN32_Asynch_Read_Stream, ACE_WIN32_Asynch_Write_Stream, ACE_WIN32_Asynch_Read_File, ACE_WIN32_Asynch_Write_File, ACE_WIN32_Asynch_Accept, ACE_WIN32_Asynch_Connect, ACE_WIN32_Asynch_Transmit_File, ACE_WIN32_Asynch_Read_Dgram, and ACE_WIN32_Asynch_Write_Dgram.

Definition at line 142 of file WIN32_Asynch_IO.cpp.

References ACE_Handler::handle(), ACE_Handler::Proxy_Ptr, 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().

00146 {
00147   this->proactor_ = proactor;
00148   this->handler_proxy_ = handler_proxy;
00149   this->handle_ = handle;
00150 
00151   // Grab the handle from the <handler> if <handle> is invalid
00152   if (this->handle_ == ACE_INVALID_HANDLE)
00153     {
00154       ACE_Handler *handler = handler_proxy.get ()->handler ();
00155       if (handler != 0)
00156         this->handle_ = handler->handle ();
00157     }
00158   if (this->handle_ == ACE_INVALID_HANDLE)
00159     return -1;
00160 
00161   // Register with the <proactor>.
00162   return this->win32_proactor_->register_handle (this->handle_,
00163                                                  completion_key);
00164 }

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, ACE_WIN32_Asynch_Write_Stream, ACE_WIN32_Asynch_Read_File, ACE_WIN32_Asynch_Write_File, ACE_WIN32_Asynch_Accept, ACE_WIN32_Asynch_Connect, ACE_WIN32_Asynch_Transmit_File, ACE_WIN32_Asynch_Read_Dgram, and ACE_WIN32_Asynch_Write_Dgram.

Definition at line 195 of file WIN32_Asynch_IO.cpp.

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().

00196 {
00197   return this->proactor_;
00198 }


Member Data Documentation

ACE_HANDLE ACE_WIN32_Asynch_Operation::handle_ [protected]
 

I/O handle used for reading.

Definition at line 198 of file WIN32_Asynch_IO.h.

ACE_Handler::Proxy_Ptr ACE_WIN32_Asynch_Operation::handler_proxy_ [protected]
 

Handler that will receive the callback.

Definition at line 195 of file WIN32_Asynch_IO.h.

ACE_Proactor* ACE_WIN32_Asynch_Operation::proactor_ [protected]
 

Proactor that this asynch IO is registered with.

Definition at line 192 of file WIN32_Asynch_IO.h.

ACE_WIN32_Proactor* ACE_WIN32_Asynch_Operation::win32_proactor_ [protected]
 

Win32 Proactor.

Definition at line 189 of file WIN32_Asynch_IO.h.

Referenced by open().


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