ACE_WIN32_Asynch_Result Class Reference

An abstract class which adds information to the OVERLAPPED structure to make it more useful. More...

#include <WIN32_Asynch_IO.h>

Inheritance diagram for ACE_WIN32_Asynch_Result:

Inheritance graph
[legend]
Collaboration diagram for ACE_WIN32_Asynch_Result:

Collaboration graph
[legend]
List of all members.

Public Member Functions

size_t bytes_transferred (void) const
 Number of bytes transferred by the operation.

const void * act (void) const
 ACT associated with the operation.

int success (void) const
 Did the operation succeed?

const void * completion_key (void) const
u_long error (void) const
 Error value if the operation fail.

ACE_HANDLE event (void) const
 Event associated with the OVERLAPPED structure.

u_long offset (void) const
 This really make sense only when doing file I/O.

u_long offset_high (void) const
 Offset_high associated with the OVERLAPPED structure.

int priority (void) const
int signal_number (void) const
 Returns 0.

int post_completion (ACE_Proactor_Impl *proactor)
 Post to the Proactor's completion port.

virtual ~ACE_WIN32_Asynch_Result (void)
 Destructor.

void set_error (u_long errcode)
 Simulate error value to use in the post_completion ().

void set_bytes_transferred (size_t nbytes)
 Simulate value to use in the post_completion ().


Protected Member Functions

 ACE_WIN32_Asynch_Result (const ACE_Handler::Proxy_Ptr &handler_proxy, const void *act, ACE_HANDLE event, u_long offset, u_long offset_high, int priority, int signal_number=0)
 Constructor.


Protected Attributes

ACE_Handler::Proxy_Ptr handler_proxy_
 Proxy for the ACE_Handler that will be called back.

const void * act_
 ACT for this operation.

size_t bytes_transferred_
 Bytes transferred by this operation.

int success_
 Success indicator.

const void * completion_key_
 ACT associated with handle.

u_long error_
 Error if operation failed.


Friends

class ACE_WIN32_Asynch_Accept
 Factory class has special permissions.

class ACE_WIN32_Proactor
 Proactor class has special permission.


Detailed Description

An abstract class which adds information to the OVERLAPPED structure to make it more useful.

An abstract base class from which you can obtain some basic information like the number of bytes transferred, the ACT associated with the asynchronous operation, indication of success or failure, etc. Subclasses may want to store more information that is particular to the asynchronous operation it represents.

Definition at line 62 of file WIN32_Asynch_IO.h.


Constructor & Destructor Documentation

ACE_WIN32_Asynch_Result::~ACE_WIN32_Asynch_Result void   )  [virtual]
 

Destructor.

Definition at line 109 of file WIN32_Asynch_IO.cpp.

00110 {
00111 }

ACE_WIN32_Asynch_Result::ACE_WIN32_Asynch_Result const ACE_Handler::Proxy_Ptr handler_proxy,
const void *  act,
ACE_HANDLE  event,
u_long  offset,
u_long  offset_high,
int  priority,
int  signal_number = 0
[protected]
 

Constructor.

Definition at line 114 of file WIN32_Asynch_IO.cpp.

References ACE_Handler::Proxy_Ptr.

00121   : ACE_Asynch_Result_Impl (),
00122     OVERLAPPED (),
00123     handler_proxy_ (handler_proxy),
00124     act_ (act),
00125     bytes_transferred_ (0),
00126     success_ (0),
00127     completion_key_ (0),
00128     error_ (0)
00129 {
00130   // Set the ACE_OVERLAPPED structure
00131   this->Internal = 0;
00132   this->InternalHigh = 0;
00133   this->Offset = offset;
00134   this->OffsetHigh = offset_high;
00135   this->hEvent = event;
00136 
00137   ACE_UNUSED_ARG (priority);
00138   ACE_UNUSED_ARG (signal_number);
00139 }


Member Function Documentation

const void * ACE_WIN32_Asynch_Result::act void   )  const [virtual]
 

ACT associated with the operation.

Implements ACE_Asynch_Result_Impl.

Reimplemented in ACE_WIN32_Asynch_Read_Stream_Result, ACE_WIN32_Asynch_Write_Stream_Result, ACE_WIN32_Asynch_Read_File_Result, ACE_WIN32_Asynch_Write_File_Result, ACE_WIN32_Asynch_Accept_Result, ACE_WIN32_Asynch_Connect_Result, ACE_WIN32_Asynch_Transmit_File_Result, ACE_WIN32_Asynch_Read_Dgram_Result, and ACE_WIN32_Asynch_Write_Dgram_Result.

Definition at line 29 of file WIN32_Asynch_IO.cpp.

Referenced by ACE_WIN32_Asynch_Write_Dgram_Result::act(), ACE_WIN32_Asynch_Read_Dgram_Result::act(), ACE_WIN32_Asynch_Transmit_File_Result::act(), ACE_WIN32_Asynch_Connect_Result::act(), ACE_WIN32_Asynch_Accept_Result::act(), ACE_WIN32_Asynch_Write_File_Result::act(), ACE_WIN32_Asynch_Read_File_Result::act(), ACE_WIN32_Asynch_Write_Stream_Result::act(), and ACE_WIN32_Asynch_Read_Stream_Result::act().

00030 {
00031   return this->act_;
00032 }

ACE_BEGIN_VERSIONED_NAMESPACE_DECL size_t ACE_WIN32_Asynch_Result::bytes_transferred void   )  const [virtual]
 

Number of bytes transferred by the operation.

Implements ACE_Asynch_Result_Impl.

Reimplemented in ACE_WIN32_Asynch_Read_Stream_Result, ACE_WIN32_Asynch_Write_Stream_Result, ACE_WIN32_Asynch_Read_File_Result, ACE_WIN32_Asynch_Write_File_Result, ACE_WIN32_Asynch_Accept_Result, ACE_WIN32_Asynch_Connect_Result, ACE_WIN32_Asynch_Transmit_File_Result, ACE_WIN32_Asynch_Read_Dgram_Result, and ACE_WIN32_Asynch_Write_Dgram_Result.

Definition at line 23 of file WIN32_Asynch_IO.cpp.

Referenced by ACE_WIN32_Asynch_Write_Dgram_Result::bytes_transferred(), ACE_WIN32_Asynch_Read_Dgram_Result::bytes_transferred(), ACE_WIN32_Asynch_Transmit_File_Result::bytes_transferred(), ACE_WIN32_Asynch_Connect_Result::bytes_transferred(), ACE_WIN32_Asynch_Accept_Result::bytes_transferred(), ACE_WIN32_Asynch_Write_File_Result::bytes_transferred(), ACE_WIN32_Asynch_Read_File_Result::bytes_transferred(), ACE_WIN32_Asynch_Write_Stream_Result::bytes_transferred(), ACE_WIN32_Asynch_Read_Stream_Result::bytes_transferred(), and ACE_WIN32_Proactor::post_completion().

00024 {
00025   return this->bytes_transferred_;
00026 }

const void * ACE_WIN32_Asynch_Result::completion_key void   )  const [virtual]
 

This returns the ACT associated with the handle when it was registered with the I/O completion port. This ACT is not the same as the ACT associated with the asynchronous operation.

Implements ACE_Asynch_Result_Impl.

Reimplemented in ACE_WIN32_Asynch_Read_Stream_Result, ACE_WIN32_Asynch_Write_Stream_Result, ACE_WIN32_Asynch_Read_File_Result, ACE_WIN32_Asynch_Write_File_Result, ACE_WIN32_Asynch_Accept_Result, ACE_WIN32_Asynch_Connect_Result, ACE_WIN32_Asynch_Transmit_File_Result, ACE_WIN32_Asynch_Read_Dgram_Result, and ACE_WIN32_Asynch_Write_Dgram_Result.

Definition at line 41 of file WIN32_Asynch_IO.cpp.

Referenced by ACE_WIN32_Asynch_Write_Dgram_Result::completion_key(), ACE_WIN32_Asynch_Read_Dgram_Result::completion_key(), ACE_WIN32_Asynch_Transmit_File_Result::completion_key(), ACE_WIN32_Asynch_Connect_Result::completion_key(), ACE_WIN32_Asynch_Accept_Result::completion_key(), ACE_WIN32_Asynch_Write_File_Result::completion_key(), ACE_WIN32_Asynch_Read_File_Result::completion_key(), ACE_WIN32_Asynch_Write_Stream_Result::completion_key(), ACE_WIN32_Asynch_Read_Stream_Result::completion_key(), and ACE_WIN32_Proactor::post_completion().

00042 {
00043   return this->completion_key_;
00044 }

u_long ACE_WIN32_Asynch_Result::error void   )  const [virtual]
 

Error value if the operation fail.

Implements ACE_Asynch_Result_Impl.

Reimplemented in ACE_WIN32_Asynch_Read_Stream_Result, ACE_WIN32_Asynch_Write_Stream_Result, ACE_WIN32_Asynch_Read_File_Result, ACE_WIN32_Asynch_Write_File_Result, ACE_WIN32_Asynch_Accept_Result, ACE_WIN32_Asynch_Connect_Result, ACE_WIN32_Asynch_Transmit_File_Result, ACE_WIN32_Asynch_Read_Dgram_Result, and ACE_WIN32_Asynch_Write_Dgram_Result.

Definition at line 47 of file WIN32_Asynch_IO.cpp.

Referenced by ACE_WIN32_Asynch_Write_Dgram_Result::error(), ACE_WIN32_Asynch_Read_Dgram_Result::error(), ACE_WIN32_Asynch_Transmit_File_Result::error(), ACE_WIN32_Asynch_Connect_Result::error(), ACE_WIN32_Asynch_Accept_Result::error(), ACE_WIN32_Asynch_Write_File_Result::error(), ACE_WIN32_Asynch_Read_File_Result::error(), ACE_WIN32_Asynch_Write_Stream_Result::error(), ACE_WIN32_Asynch_Read_Stream_Result::error(), and ACE_WIN32_Proactor::handle_events().

00048 {
00049   return this->error_;
00050 }

ACE_HANDLE ACE_WIN32_Asynch_Result::event void   )  const [virtual]
 

Event associated with the OVERLAPPED structure.

Implements ACE_Asynch_Result_Impl.

Reimplemented in ACE_WIN32_Asynch_Read_Stream_Result, ACE_WIN32_Asynch_Write_Stream_Result, ACE_WIN32_Asynch_Read_File_Result, ACE_WIN32_Asynch_Write_File_Result, ACE_WIN32_Asynch_Accept_Result, ACE_WIN32_Asynch_Connect_Result, ACE_WIN32_Asynch_Transmit_File_Result, ACE_WIN32_Asynch_Read_Dgram_Result, and ACE_WIN32_Asynch_Write_Dgram_Result.

Definition at line 53 of file WIN32_Asynch_IO.cpp.

Referenced by ACE_WIN32_Asynch_Write_Dgram_Result::event(), ACE_WIN32_Asynch_Read_Dgram_Result::event(), ACE_WIN32_Asynch_Transmit_File_Result::event(), ACE_WIN32_Asynch_Connect_Result::event(), ACE_WIN32_Asynch_Accept_Result::event(), ACE_WIN32_Asynch_Write_File_Result::event(), ACE_WIN32_Asynch_Read_File_Result::event(), ACE_WIN32_Asynch_Write_Stream_Result::event(), and ACE_WIN32_Asynch_Read_Stream_Result::event().

00054 {
00055   return this->hEvent;
00056 }

u_long ACE_WIN32_Asynch_Result::offset void   )  const [virtual]
 

This really make sense only when doing file I/O.

Implements ACE_Asynch_Result_Impl.

Reimplemented in ACE_WIN32_Asynch_Read_Stream_Result, ACE_WIN32_Asynch_Write_Stream_Result, ACE_WIN32_Asynch_Read_File_Result, ACE_WIN32_Asynch_Write_File_Result, ACE_WIN32_Asynch_Accept_Result, ACE_WIN32_Asynch_Connect_Result, ACE_WIN32_Asynch_Transmit_File_Result, ACE_WIN32_Asynch_Read_Dgram_Result, and ACE_WIN32_Asynch_Write_Dgram_Result.

Definition at line 59 of file WIN32_Asynch_IO.cpp.

Referenced by ACE_WIN32_Asynch_Write_Dgram_Result::offset(), ACE_WIN32_Asynch_Read_Dgram_Result::offset(), ACE_WIN32_Asynch_Transmit_File_Result::offset(), ACE_WIN32_Asynch_Connect_Result::offset(), ACE_WIN32_Asynch_Accept_Result::offset(), ACE_WIN32_Asynch_Write_File_Result::offset(), ACE_WIN32_Asynch_Read_File_Result::offset(), ACE_WIN32_Asynch_Write_Stream_Result::offset(), and ACE_WIN32_Asynch_Read_Stream_Result::offset().

00060 {
00061   return this->Offset;
00062 }

u_long ACE_WIN32_Asynch_Result::offset_high void   )  const [virtual]
 

Offset_high associated with the OVERLAPPED structure.

Implements ACE_Asynch_Result_Impl.

Reimplemented in ACE_WIN32_Asynch_Read_Stream_Result, ACE_WIN32_Asynch_Write_Stream_Result, ACE_WIN32_Asynch_Read_File_Result, ACE_WIN32_Asynch_Write_File_Result, ACE_WIN32_Asynch_Accept_Result, ACE_WIN32_Asynch_Connect_Result, ACE_WIN32_Asynch_Transmit_File_Result, ACE_WIN32_Asynch_Read_Dgram_Result, and ACE_WIN32_Asynch_Write_Dgram_Result.

Definition at line 65 of file WIN32_Asynch_IO.cpp.

Referenced by ACE_WIN32_Asynch_Write_Dgram_Result::offset_high(), ACE_WIN32_Asynch_Read_Dgram_Result::offset_high(), ACE_WIN32_Asynch_Transmit_File_Result::offset_high(), ACE_WIN32_Asynch_Connect_Result::offset_high(), ACE_WIN32_Asynch_Accept_Result::offset_high(), ACE_WIN32_Asynch_Write_File_Result::offset_high(), ACE_WIN32_Asynch_Read_File_Result::offset_high(), ACE_WIN32_Asynch_Write_Stream_Result::offset_high(), and ACE_WIN32_Asynch_Read_Stream_Result::offset_high().

00066 {
00067   return this->OffsetHigh;
00068 }

int ACE_WIN32_Asynch_Result::post_completion ACE_Proactor_Impl proactor  )  [virtual]
 

Post to the Proactor's completion port.

Implements ACE_Asynch_Result_Impl.

Reimplemented in ACE_WIN32_Asynch_Read_Stream_Result, ACE_WIN32_Asynch_Write_Stream_Result, ACE_WIN32_Asynch_Read_File_Result, ACE_WIN32_Asynch_Write_File_Result, ACE_WIN32_Asynch_Accept_Result, ACE_WIN32_Asynch_Connect_Result, ACE_WIN32_Asynch_Transmit_File_Result, ACE_WIN32_Asynch_Read_Dgram_Result, and ACE_WIN32_Asynch_Write_Dgram_Result.

Definition at line 83 of file WIN32_Asynch_IO.cpp.

References ACE_ERROR_RETURN, ACE_LIB_TEXT, LM_ERROR, and ACE_WIN32_Proactor::post_completion().

Referenced by ACE_WIN32_Asynch_Write_Dgram_Result::post_completion(), ACE_WIN32_Asynch_Read_Dgram_Result::post_completion(), ACE_WIN32_Asynch_Transmit_File_Result::post_completion(), ACE_WIN32_Asynch_Connect_Result::post_completion(), ACE_WIN32_Asynch_Accept_Result::post_completion(), ACE_WIN32_Asynch_Write_File_Result::post_completion(), ACE_WIN32_Asynch_Read_File_Result::post_completion(), ACE_WIN32_Asynch_Write_Stream_Result::post_completion(), and ACE_WIN32_Asynch_Read_Stream_Result::post_completion().

00084 {
00085   // Get to the platform specific implementation.
00086   ACE_WIN32_Proactor *win32_proactor = dynamic_cast<ACE_WIN32_Proactor *> (proactor);
00087 
00088   if (win32_proactor == 0)
00089     ACE_ERROR_RETURN ((LM_ERROR,
00090                        ACE_LIB_TEXT ("Dynamic cast to WIN32 Proactor failed\n")),
00091                       -1);
00092 
00093   // Post myself.
00094   return win32_proactor->post_completion (this);
00095 }

int ACE_WIN32_Asynch_Result::priority void   )  const [virtual]
 

The priority of the asynchronous operation. Currently, this is not supported on Win32.

Implements ACE_Asynch_Result_Impl.

Reimplemented in ACE_WIN32_Asynch_Read_Stream_Result, ACE_WIN32_Asynch_Write_Stream_Result, ACE_WIN32_Asynch_Read_File_Result, ACE_WIN32_Asynch_Write_File_Result, ACE_WIN32_Asynch_Accept_Result, ACE_WIN32_Asynch_Connect_Result, ACE_WIN32_Asynch_Transmit_File_Result, ACE_WIN32_Asynch_Read_Dgram_Result, and ACE_WIN32_Asynch_Write_Dgram_Result.

Definition at line 71 of file WIN32_Asynch_IO.cpp.

References ACE_NOTSUP_RETURN.

Referenced by ACE_WIN32_Asynch_Write_Dgram_Result::priority(), ACE_WIN32_Asynch_Read_Dgram_Result::priority(), ACE_WIN32_Asynch_Transmit_File_Result::priority(), ACE_WIN32_Asynch_Connect_Result::priority(), ACE_WIN32_Asynch_Accept_Result::priority(), ACE_WIN32_Asynch_Write_File_Result::priority(), ACE_WIN32_Asynch_Read_File_Result::priority(), ACE_WIN32_Asynch_Write_Stream_Result::priority(), and ACE_WIN32_Asynch_Read_Stream_Result::priority().

00072 {
00073   ACE_NOTSUP_RETURN (0);
00074 }

void ACE_WIN32_Asynch_Result::set_bytes_transferred size_t  nbytes  ) 
 

Simulate value to use in the post_completion ().

Definition at line 98 of file WIN32_Asynch_IO.cpp.

Referenced by ACE_WIN32_Asynch_Connect::cancel_uncompleted(), ACE_WIN32_Asynch_Connect::connect_i(), ACE_WIN32_Asynch_Connect::handle_close(), and ACE_WIN32_Asynch_Connect::handle_output().

00099 {
00100   this->bytes_transferred_ = nbytes;
00101 }

void ACE_WIN32_Asynch_Result::set_error u_long  errcode  ) 
 

Simulate error value to use in the post_completion ().

Definition at line 104 of file WIN32_Asynch_IO.cpp.

Referenced by ACE_WIN32_Asynch_Connect::cancel_uncompleted(), ACE_WIN32_Asynch_Connect::connect(), ACE_WIN32_Asynch_Connect::connect_i(), ACE_WIN32_Asynch_Connect::handle_close(), ACE_WIN32_Asynch_Connect::handle_output(), ACE_WIN32_Asynch_Read_File::readv(), ACE_WIN32_Asynch_Read_Stream::readv(), ACE_WIN32_Asynch_Read_Stream::shared_read(), ACE_WIN32_Asynch_Write_Stream::shared_write(), and ACE_WIN32_Asynch_Write_File::writev().

00105 {
00106   this->error_ = errcode;
00107 }

int ACE_WIN32_Asynch_Result::signal_number void   )  const [virtual]
 

Returns 0.

Implements ACE_Asynch_Result_Impl.

Reimplemented in ACE_WIN32_Asynch_Read_Stream_Result, ACE_WIN32_Asynch_Write_Stream_Result, ACE_WIN32_Asynch_Read_File_Result, ACE_WIN32_Asynch_Write_File_Result, ACE_WIN32_Asynch_Accept_Result, ACE_WIN32_Asynch_Connect_Result, ACE_WIN32_Asynch_Transmit_File_Result, ACE_WIN32_Asynch_Read_Dgram_Result, and ACE_WIN32_Asynch_Write_Dgram_Result.

Definition at line 77 of file WIN32_Asynch_IO.cpp.

References ACE_NOTSUP_RETURN.

Referenced by ACE_WIN32_Asynch_Write_Dgram_Result::signal_number(), ACE_WIN32_Asynch_Read_Dgram_Result::signal_number(), ACE_WIN32_Asynch_Transmit_File_Result::signal_number(), ACE_WIN32_Asynch_Connect_Result::signal_number(), ACE_WIN32_Asynch_Accept_Result::signal_number(), ACE_WIN32_Asynch_Write_File_Result::signal_number(), ACE_WIN32_Asynch_Read_File_Result::signal_number(), ACE_WIN32_Asynch_Write_Stream_Result::signal_number(), and ACE_WIN32_Asynch_Read_Stream_Result::signal_number().

00078 {
00079   ACE_NOTSUP_RETURN (0);
00080 }

int ACE_WIN32_Asynch_Result::success void   )  const [virtual]
 

Did the operation succeed?

Implements ACE_Asynch_Result_Impl.

Reimplemented in ACE_WIN32_Asynch_Read_Stream_Result, ACE_WIN32_Asynch_Write_Stream_Result, ACE_WIN32_Asynch_Read_File_Result, ACE_WIN32_Asynch_Write_File_Result, ACE_WIN32_Asynch_Accept_Result, ACE_WIN32_Asynch_Connect_Result, ACE_WIN32_Asynch_Transmit_File_Result, ACE_WIN32_Asynch_Read_Dgram_Result, and ACE_WIN32_Asynch_Write_Dgram_Result.

Definition at line 35 of file WIN32_Asynch_IO.cpp.

Referenced by ACE_WIN32_Asynch_Write_Dgram_Result::success(), ACE_WIN32_Asynch_Read_Dgram_Result::success(), ACE_WIN32_Asynch_Transmit_File_Result::success(), ACE_WIN32_Asynch_Connect_Result::success(), ACE_WIN32_Asynch_Accept_Result::success(), ACE_WIN32_Asynch_Write_File_Result::success(), ACE_WIN32_Asynch_Read_File_Result::success(), ACE_WIN32_Asynch_Write_Stream_Result::success(), and ACE_WIN32_Asynch_Read_Stream_Result::success().

00036 {
00037   return this->success_;
00038 }


Friends And Related Function Documentation

friend class ACE_WIN32_Asynch_Accept [friend]
 

Factory class has special permissions.

Reimplemented in ACE_WIN32_Asynch_Accept_Result.

Definition at line 66 of file WIN32_Asynch_IO.h.

friend class ACE_WIN32_Proactor [friend]
 

Proactor class has special permission.

Reimplemented in ACE_WIN32_Asynch_Read_Stream_Result, ACE_WIN32_Asynch_Write_Stream_Result, ACE_WIN32_Asynch_Read_File_Result, ACE_WIN32_Asynch_Write_File_Result, ACE_WIN32_Asynch_Accept_Result, ACE_WIN32_Asynch_Connect_Result, ACE_WIN32_Asynch_Transmit_File_Result, ACE_WIN32_Asynch_Read_Dgram_Result, ACE_WIN32_Asynch_Write_Dgram_Result, and ACE_WIN32_Asynch_Timer.

Definition at line 69 of file WIN32_Asynch_IO.h.


Member Data Documentation

const void* ACE_WIN32_Asynch_Result::act_ [protected]
 

ACT for this operation.

Definition at line 133 of file WIN32_Asynch_IO.h.

size_t ACE_WIN32_Asynch_Result::bytes_transferred_ [protected]
 

Bytes transferred by this operation.

Definition at line 136 of file WIN32_Asynch_IO.h.

const void* ACE_WIN32_Asynch_Result::completion_key_ [protected]
 

ACT associated with handle.

Definition at line 142 of file WIN32_Asynch_IO.h.

u_long ACE_WIN32_Asynch_Result::error_ [protected]
 

Error if operation failed.

Definition at line 145 of file WIN32_Asynch_IO.h.

ACE_Handler::Proxy_Ptr ACE_WIN32_Asynch_Result::handler_proxy_ [protected]
 

Proxy for the ACE_Handler that will be called back.

Definition at line 130 of file WIN32_Asynch_IO.h.

int ACE_WIN32_Asynch_Result::success_ [protected]
 

Success indicator.

Definition at line 139 of file WIN32_Asynch_IO.h.


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