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

ACE_WIN32_Asynch_Read_File_Result Class Reference

This class provides concrete implementation for ACE_Asynch_Read_File::Result class. More...

#include <WIN32_Asynch_IO.h>

Inheritance diagram for ACE_WIN32_Asynch_Read_File_Result:

Inheritance graph
[legend]
Collaboration diagram for ACE_WIN32_Asynch_Read_File_Result:

Collaboration graph
[legend]
List of all members.

Public Methods

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

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

int success (void) const
 Did the operation succeed? More...

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

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

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

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

int priority (void) const
 The priority of the asynchronous operation. Currently, this is not supported on Win32. More...

int signal_number (void) const
 No-op. Returns 0. More...

size_t bytes_to_read (void) const
 The number of bytes which were requested at the start of the asynchronous read. More...

ACE_Message_Blockmessage_block (void) const
 Message block which contains the read data. More...

ACE_HANDLE handle (void) const
 I/O handle used for reading. More...

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


Protected Methods

 ACE_WIN32_Asynch_Read_File_Result (ACE_Handler &handler, ACE_HANDLE handle, ACE_Message_Block &message_block, size_t bytes_to_read, const void *act, u_long offset, u_long offset_high, ACE_HANDLE event, int priority, int signal_number=0, int scatter_enabled=0)
 Constructor is protected since creation is limited to ACE_Asynch_Read_File factory. More...

virtual void complete (size_t bytes_transferred, int success, const void *completion_key, u_long error)
 ACE_Proactor will call this method when the read completes. More...

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


Friends

class ACE_WIN32_Asynch_Read_File
 Factory class will have special permissions. More...

class ACE_WIN32_Proactor
 Proactor class has special permission. More...


Detailed Description

This class provides concrete implementation for ACE_Asynch_Read_File::Result class.

Definition at line 561 of file WIN32_Asynch_IO.h.


Constructor & Destructor Documentation

ACE_WIN32_Asynch_Read_File_Result::ACE_WIN32_Asynch_Read_File_Result ACE_Handler   handler,
ACE_HANDLE    handle,
ACE_Message_Block   message_block,
size_t    bytes_to_read,
const void *    act,
u_long    offset,
u_long    offset_high,
ACE_HANDLE    event,
int    priority,
int    signal_number = 0,
int    scatter_enabled = 0
[protected]
 

Constructor is protected since creation is limited to ACE_Asynch_Read_File factory.

Definition at line 1029 of file WIN32_Asynch_IO.cpp.

References offset, and offset_high.

01040   : ACE_Asynch_Result_Impl (),
01041     ACE_Asynch_Read_Stream_Result_Impl (),
01042     ACE_Asynch_Read_File_Result_Impl (),
01043     ACE_WIN32_Asynch_Read_Stream_Result (handler,
01044                                          handle,
01045                                          message_block,
01046                                          bytes_to_read,
01047                                          act,
01048                                          event,
01049                                          priority,
01050                                          signal_number,
01051                                          scatter_enabled)
01052 {
01053   this->Offset = offset;
01054   this->OffsetHigh = offset_high;
01055 }

ACE_WIN32_Asynch_Read_File_Result::~ACE_WIN32_Asynch_Read_File_Result void    [protected, virtual]
 

Destructor.

Definition at line 1102 of file WIN32_Asynch_IO.cpp.

01103 {
01104 }


Member Function Documentation

const void * ACE_WIN32_Asynch_Read_File_Result::act void    const [virtual]
 

ACT associated with the operation.

Reimplemented from ACE_WIN32_Asynch_Read_Stream_Result.

Definition at line 1116 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::act.

01117 {
01118   return ACE_WIN32_Asynch_Result::act ();
01119 }

size_t ACE_WIN32_Asynch_Read_File_Result::bytes_to_read void    const [virtual]
 

The number of bytes which were requested at the start of the asynchronous read.

Reimplemented from ACE_WIN32_Asynch_Read_Stream_Result.

Definition at line 1175 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Read_Stream_Result::bytes_to_read.

01176 {
01177   return ACE_WIN32_Asynch_Read_Stream_Result::bytes_to_read ();
01178 }

size_t ACE_WIN32_Asynch_Read_File_Result::bytes_transferred void    const [virtual]
 

Number of bytes transferred by the operation.

Reimplemented from ACE_WIN32_Asynch_Read_Stream_Result.

Definition at line 1110 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::bytes_transferred.

Referenced by complete.

01111 {
01112   return ACE_WIN32_Asynch_Result::bytes_transferred ();
01113 }

void ACE_WIN32_Asynch_Read_File_Result::complete size_t    bytes_transferred,
int    success,
const void *    completion_key,
u_long    error
[protected, virtual]
 

ACE_Proactor will call this method when the read completes.

Reimplemented from ACE_WIN32_Asynch_Read_Stream_Result.

Definition at line 1058 of file WIN32_Asynch_IO.cpp.

References bytes_transferred, ACE_WIN32_Asynch_Result::bytes_transferred_, completion_key, ACE_WIN32_Asynch_Result::completion_key_, ACE_Message_Block::cont, error, ACE_WIN32_Asynch_Result::error_, ACE_OS::getpagesize, ACE_Handler::handle_read_file, ACE_WIN32_Asynch_Result::handler_, ACE_WIN32_Asynch_Read_Stream_Result::message_block_, ACE_WIN32_Asynch_Read_Stream_Result::scatter_enabled, success, ACE_WIN32_Asynch_Result::success_, and ACE_Message_Block::wr_ptr.

01062 {
01063   // Copy the data which was returned by GetQueuedCompletionStatus.
01064   this->bytes_transferred_ = bytes_transferred;
01065   this->success_ = success;
01066   this->completion_key_ = completion_key;
01067   this->error_ = error;
01068 
01069   // Appropriately move the pointers in the message block.
01070   if (!this->scatter_enabled ())
01071     this->message_block_.wr_ptr (bytes_transferred);
01072   else
01073   {
01074     static const size_t page_size = ACE_OS::getpagesize();
01075 
01076     for (ACE_Message_Block* mb = &this->message_block_;
01077          (mb != 0) && (bytes_transferred > 0);
01078          mb = mb->cont ())
01079     {
01080       // mb->space () is ought to be >= page_size.
01081       // this is verified in the readv method
01082       // ACE_ASSERT (mb->space () >= page_size);
01083 
01084       size_t len_part = page_size ;
01085 
01086       if ( len_part > bytes_transferred)
01087         len_part = bytes_transferred;
01088 
01089       mb->wr_ptr (len_part);
01090 
01091       bytes_transferred -= len_part;
01092     }
01093   }
01094 
01095   // Create the interface result class.
01096   ACE_Asynch_Read_File::Result result (this);
01097 
01098   // Call the application handler.
01099   this->handler_.handle_read_file (result);
01100 }

const void * ACE_WIN32_Asynch_Read_File_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.

Reimplemented from ACE_WIN32_Asynch_Read_Stream_Result.

Definition at line 1128 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::completion_key.

Referenced by complete.

01129 {
01130   return ACE_WIN32_Asynch_Result::completion_key ();
01131 }

u_long ACE_WIN32_Asynch_Read_File_Result::error void    const [virtual]
 

Error value if the operation fail.

Reimplemented from ACE_WIN32_Asynch_Read_Stream_Result.

Definition at line 1134 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::error.

Referenced by complete.

01135 {
01136   return ACE_WIN32_Asynch_Result::error ();
01137 }

ACE_HANDLE ACE_WIN32_Asynch_Read_File_Result::event void    const [virtual]
 

Event associated with the OVERLAPPED structure.

Reimplemented from ACE_WIN32_Asynch_Read_Stream_Result.

Definition at line 1140 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::event.

01141 {
01142   return ACE_WIN32_Asynch_Result::event ();
01143 }

ACE_HANDLE ACE_WIN32_Asynch_Read_File_Result::handle void    const [virtual]
 

I/O handle used for reading.

Reimplemented from ACE_WIN32_Asynch_Read_Stream_Result.

Definition at line 1187 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Read_Stream_Result::handle.

Referenced by ACE_WIN32_Asynch_Read_File::readv.

01188 {
01189   return ACE_WIN32_Asynch_Read_Stream_Result::handle ();
01190 }

ACE_Message_Block & ACE_WIN32_Asynch_Read_File_Result::message_block void    const [virtual]
 

Message block which contains the read data.

Reimplemented from ACE_WIN32_Asynch_Read_Stream_Result.

Definition at line 1181 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Read_Stream_Result::message_block.

01182 {
01183   return ACE_WIN32_Asynch_Read_Stream_Result::message_block ();
01184 }

u_long ACE_WIN32_Asynch_Read_File_Result::offset void    const [virtual]
 

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

Reimplemented from ACE_WIN32_Asynch_Read_Stream_Result.

Definition at line 1146 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::offset.

Referenced by ACE_WIN32_Asynch_Read_File_Result.

01147 {
01148   return ACE_WIN32_Asynch_Result::offset ();
01149 }

u_long ACE_WIN32_Asynch_Read_File_Result::offset_high void    const [virtual]
 

Offset_high associated with the OVERLAPPED structure.

Reimplemented from ACE_WIN32_Asynch_Read_Stream_Result.

Definition at line 1152 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::offset_high.

Referenced by ACE_WIN32_Asynch_Read_File_Result.

01153 {
01154   return ACE_WIN32_Asynch_Result::offset_high ();
01155 }

int ACE_WIN32_Asynch_Read_File_Result::post_completion ACE_Proactor_Impl   proactor [virtual]
 

Post <this> to the Proactor's completion port.

Reimplemented from ACE_WIN32_Asynch_Read_Stream_Result.

Definition at line 1193 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::post_completion.

01194 {
01195   return ACE_WIN32_Asynch_Result::post_completion (proactor);
01196 }

int ACE_WIN32_Asynch_Read_File_Result::priority void    const [virtual]
 

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

Reimplemented from ACE_WIN32_Asynch_Read_Stream_Result.

Definition at line 1158 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::priority.

01159 {
01160   return ACE_WIN32_Asynch_Result::priority ();
01161 }

int ACE_WIN32_Asynch_Read_File_Result::signal_number void    const [virtual]
 

No-op. Returns 0.

Reimplemented from ACE_WIN32_Asynch_Read_Stream_Result.

Definition at line 1164 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::signal_number.

01165 {
01166   return ACE_WIN32_Asynch_Result::signal_number ();
01167 }

int ACE_WIN32_Asynch_Read_File_Result::success void    const [virtual]
 

Did the operation succeed?

Reimplemented from ACE_WIN32_Asynch_Read_Stream_Result.

Definition at line 1122 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::success.

Referenced by complete.

01123 {
01124   return ACE_WIN32_Asynch_Result::success ();
01125 }


Friends And Related Function Documentation

friend class ACE_WIN32_Asynch_Read_File [friend]
 

Factory class will have special permissions.

Definition at line 565 of file WIN32_Asynch_IO.h.

friend class ACE_WIN32_Proactor [friend]
 

Proactor class has special permission.

Reimplemented from ACE_WIN32_Asynch_Read_Stream_Result.

Definition at line 568 of file WIN32_Asynch_IO.h.


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