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

ACE_WIN32_Asynch_Read_Stream_Result Class Reference

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

#include <WIN32_Asynch_IO.h>

Inheritance diagram for ACE_WIN32_Asynch_Read_Stream_Result:

Inheritance graph
[legend]
Collaboration diagram for ACE_WIN32_Asynch_Read_Stream_Result:

Collaboration graph
[legend]
List of all members.

Public Methods

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

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

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

int scatter_enabled (void) const
 Accessor for the scatter read flag. More...


Protected Methods

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

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

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


Protected Attributes

size_t bytes_to_read_
 Bytes requested when the asynchronous read was initiated. More...

ACE_Message_Blockmessage_block_
 Message block for reading the data into. More...

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

int scatter_enabled_
 Flag for scatter read. More...


Friends

class ACE_WIN32_Asynch_Read_Stream
 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_Stream::Result class.

Definition at line 205 of file WIN32_Asynch_IO.h.


Constructor & Destructor Documentation

ACE_WIN32_Asynch_Read_Stream_Result::ACE_WIN32_Asynch_Read_Stream_Result ACE_Handler   handler,
ACE_HANDLE    handle,
ACE_Message_Block   message_block,
size_t    bytes_to_read,
const void *    act,
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_Stream factory.

Definition at line 222 of file WIN32_Asynch_IO.cpp.

ACE_WIN32_Asynch_Read_Stream_Result::~ACE_WIN32_Asynch_Read_Stream_Result void    [protected, virtual]
 

Destructor.

Definition at line 280 of file WIN32_Asynch_IO.cpp.

00281 {
00282 }


Member Function Documentation

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

ACT associated with the operation.

Reimplemented from ACE_WIN32_Asynch_Result.

Reimplemented in ACE_WIN32_Asynch_Read_File_Result.

Definition at line 294 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::act.

00295 {
00296   return ACE_WIN32_Asynch_Result::act ();
00297 }

size_t ACE_WIN32_Asynch_Read_Stream_Result::bytes_to_read void    const [virtual]
 

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

Implements ACE_Asynch_Read_Stream_Result_Impl.

Reimplemented in ACE_WIN32_Asynch_Read_File_Result.

Definition at line 205 of file WIN32_Asynch_IO.cpp.

References bytes_to_read_.

Referenced by ACE_WIN32_Asynch_Read_File_Result::bytes_to_read, and ACE_WIN32_Asynch_Read_Stream::shared_read.

00206 {
00207   return this->bytes_to_read_;
00208 }

size_t ACE_WIN32_Asynch_Read_Stream_Result::bytes_transferred void    const [virtual]
 

Number of bytes transferred by the operation.

Reimplemented from ACE_WIN32_Asynch_Result.

Reimplemented in ACE_WIN32_Asynch_Read_File_Result.

Definition at line 288 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::bytes_transferred.

Referenced by complete.

00289 {
00290   return ACE_WIN32_Asynch_Result::bytes_transferred ();
00291 }

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

Proactor will call this method when the read completes.

Implements ACE_Asynch_Result_Impl.

Reimplemented in ACE_WIN32_Asynch_Read_File_Result.

Definition at line 242 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_Handler::handle_read_stream, ACE_WIN32_Asynch_Result::handler_, message_block_, scatter_enabled, ACE_Message_Block::space, success, ACE_WIN32_Asynch_Result::success_, and ACE_Message_Block::wr_ptr.

00246 {
00247   // Copy the data which was returned by GetQueuedCompletionStatus
00248   this->bytes_transferred_ = bytes_transferred;
00249   this->success_ = success;
00250   this->completion_key_ = completion_key;
00251   this->error_ = error;
00252 
00253   // Appropriately move the pointers in the message block.
00254   if (!this->scatter_enabled ())
00255     this->message_block_.wr_ptr (bytes_transferred);
00256   else
00257   {
00258     for (ACE_Message_Block* mb = &this->message_block_;
00259          (mb != 0) && (bytes_transferred > 0);
00260          mb = mb->cont ())
00261     {
00262       size_t len_part = mb->space ();
00263 
00264       if (len_part > bytes_transferred)
00265         len_part = bytes_transferred;
00266 
00267       mb->wr_ptr (len_part);
00268 
00269       bytes_transferred -= len_part;
00270     }
00271   }
00272 
00273   // Create the interface result class.
00274   ACE_Asynch_Read_Stream::Result result (this);
00275 
00276   // Call the application handler.
00277   this->handler_.handle_read_stream (result);
00278 }

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

Reimplemented in ACE_WIN32_Asynch_Read_File_Result.

Definition at line 306 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::completion_key.

Referenced by complete.

00307 {
00308   return ACE_WIN32_Asynch_Result::completion_key ();
00309 }

u_long ACE_WIN32_Asynch_Read_Stream_Result::error void    const [virtual]
 

Error value if the operation fail.

Reimplemented from ACE_WIN32_Asynch_Result.

Reimplemented in ACE_WIN32_Asynch_Read_File_Result.

Definition at line 312 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::error.

Referenced by complete.

00313 {
00314   return ACE_WIN32_Asynch_Result::error ();
00315 }

ACE_HANDLE ACE_WIN32_Asynch_Read_Stream_Result::event void    const [virtual]
 

Event associated with the OVERLAPPED structure.

Reimplemented from ACE_WIN32_Asynch_Result.

Reimplemented in ACE_WIN32_Asynch_Read_File_Result.

Definition at line 318 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::event.

00319 {
00320   return ACE_WIN32_Asynch_Result::event ();
00321 }

ACE_HANDLE ACE_WIN32_Asynch_Read_Stream_Result::handle void    const [virtual]
 

I/O handle used for reading.

Implements ACE_Asynch_Read_Stream_Result_Impl.

Reimplemented in ACE_WIN32_Asynch_Read_File_Result.

Definition at line 217 of file WIN32_Asynch_IO.cpp.

References handle_.

Referenced by ACE_WIN32_Asynch_Read_File_Result::handle, ACE_WIN32_Asynch_Read_Stream::readv, and ACE_WIN32_Asynch_Read_Stream::shared_read.

00218 {
00219   return this->handle_;
00220 }

ACE_Message_Block & ACE_WIN32_Asynch_Read_Stream_Result::message_block void    const [virtual]
 

Message block which contains the read data.

Implements ACE_Asynch_Read_Stream_Result_Impl.

Reimplemented in ACE_WIN32_Asynch_Read_File_Result.

Definition at line 211 of file WIN32_Asynch_IO.cpp.

References message_block_.

Referenced by ACE_WIN32_Asynch_Read_File_Result::message_block, and ACE_WIN32_Asynch_Read_Stream::shared_read.

00212 {
00213   return this->message_block_;
00214 }

u_long ACE_WIN32_Asynch_Read_Stream_Result::offset void    const [virtual]
 

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

Reimplemented from ACE_WIN32_Asynch_Result.

Reimplemented in ACE_WIN32_Asynch_Read_File_Result.

Definition at line 324 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::offset.

00325 {
00326   return ACE_WIN32_Asynch_Result::offset ();
00327 }

u_long ACE_WIN32_Asynch_Read_Stream_Result::offset_high void    const [virtual]
 

Offset_high associated with the OVERLAPPED structure.

Reimplemented from ACE_WIN32_Asynch_Result.

Reimplemented in ACE_WIN32_Asynch_Read_File_Result.

Definition at line 330 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::offset_high.

00331 {
00332   return ACE_WIN32_Asynch_Result::offset_high ();
00333 }

int ACE_WIN32_Asynch_Read_Stream_Result::post_completion ACE_Proactor_Impl   proactor [virtual]
 

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

Reimplemented from ACE_WIN32_Asynch_Result.

Reimplemented in ACE_WIN32_Asynch_Read_File_Result.

Definition at line 348 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::post_completion.

00349 {
00350   return ACE_WIN32_Asynch_Result::post_completion (proactor);
00351 }

int ACE_WIN32_Asynch_Read_Stream_Result::priority void    const [virtual]
 

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

Reimplemented from ACE_WIN32_Asynch_Result.

Reimplemented in ACE_WIN32_Asynch_Read_File_Result.

Definition at line 336 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::priority.

00337 {
00338   return ACE_WIN32_Asynch_Result::priority ();
00339 }

int ACE_WIN32_Asynch_Read_Stream_Result::scatter_enabled void    const
 

Accessor for the scatter read flag.

Definition at line 354 of file WIN32_Asynch_IO.cpp.

References scatter_enabled_.

Referenced by ACE_WIN32_Asynch_Read_File_Result::complete, and complete.

00355 {
00356   return this->scatter_enabled_;
00357 }

int ACE_WIN32_Asynch_Read_Stream_Result::signal_number void    const [virtual]
 

No-op. Returns 0.

Reimplemented from ACE_WIN32_Asynch_Result.

Reimplemented in ACE_WIN32_Asynch_Read_File_Result.

Definition at line 342 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::signal_number.

00343 {
00344   return ACE_WIN32_Asynch_Result::signal_number ();
00345 }

int ACE_WIN32_Asynch_Read_Stream_Result::success void    const [virtual]
 

Did the operation succeed?

Reimplemented from ACE_WIN32_Asynch_Result.

Reimplemented in ACE_WIN32_Asynch_Read_File_Result.

Definition at line 300 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::success.

Referenced by complete.

00301 {
00302   return ACE_WIN32_Asynch_Result::success ();
00303 }


Friends And Related Function Documentation

friend class ACE_WIN32_Asynch_Read_Stream [friend]
 

Factory class will have special permissions.

Definition at line 209 of file WIN32_Asynch_IO.h.

friend class ACE_WIN32_Proactor [friend]
 

Proactor class has special permission.

Reimplemented from ACE_WIN32_Asynch_Result.

Reimplemented in ACE_WIN32_Asynch_Read_File_Result.

Definition at line 212 of file WIN32_Asynch_IO.h.


Member Data Documentation

size_t ACE_WIN32_Asynch_Read_Stream_Result::bytes_to_read_ [protected]
 

Bytes requested when the asynchronous read was initiated.

Definition at line 292 of file WIN32_Asynch_IO.h.

Referenced by bytes_to_read.

ACE_HANDLE ACE_WIN32_Asynch_Read_Stream_Result::handle_ [protected]
 

I/O handle used for reading.

Definition at line 298 of file WIN32_Asynch_IO.h.

Referenced by handle.

ACE_Message_Block& ACE_WIN32_Asynch_Read_Stream_Result::message_block_ [protected]
 

Message block for reading the data into.

Definition at line 295 of file WIN32_Asynch_IO.h.

Referenced by ACE_WIN32_Asynch_Read_File_Result::complete, complete, and message_block.

int ACE_WIN32_Asynch_Read_Stream_Result::scatter_enabled_ [protected]
 

Flag for scatter read.

Definition at line 301 of file WIN32_Asynch_IO.h.

Referenced by scatter_enabled.


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