ACE_POSIX_Asynch_Read_Stream_Result Class Reference

This class provides concrete implementation for <ACE_Asynch_Read_Stream::Result> class for POSIX platforms. More...

#include <POSIX_Asynch_IO.h>

Inheritance diagram for ACE_POSIX_Asynch_Read_Stream_Result:

Inheritance graph
[legend]
Collaboration diagram for ACE_POSIX_Asynch_Read_Stream_Result:

Collaboration graph
[legend]
List of all members.

Public Member Functions

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

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


Protected Member Functions

 ACE_POSIX_Asynch_Read_Stream_Result (const ACE_Handler::Proxy_Ptr &handler_proxy, ACE_HANDLE handle, ACE_Message_Block &message_block, size_t bytes_to_read, const void *act, ACE_HANDLE event, int priority, int signal_number)
virtual void complete (size_t bytes_transferred, int success, const void *completion_key, u_long error)
virtual ~ACE_POSIX_Asynch_Read_Stream_Result (void)
 Destructor.


Protected Attributes

ACE_Message_Blockmessage_block_
 Message block for reading the data into.


Friends

class ACE_POSIX_Asynch_Read_Stream
 Factory classes will have special permissions.

class ACE_POSIX_Proactor
 The Proactor constructs the Result class for faking results.


Detailed Description

This class provides concrete implementation for <ACE_Asynch_Read_Stream::Result> class for POSIX platforms.

Definition at line 225 of file POSIX_Asynch_IO.h.


Constructor & Destructor Documentation

ACE_POSIX_Asynch_Read_Stream_Result::ACE_POSIX_Asynch_Read_Stream_Result const ACE_Handler::Proxy_Ptr handler_proxy,
ACE_HANDLE  handle,
ACE_Message_Block message_block,
size_t  bytes_to_read,
const void *  act,
ACE_HANDLE  event,
int  priority,
int  signal_number
[protected]
 

Definition at line 235 of file POSIX_Asynch_IO.cpp.

References ACE_Handler::Proxy_Ptr.

00243   : ACE_POSIX_Asynch_Result
00244       (handler_proxy, act, event, 0, 0, priority, signal_number),
00245     message_block_ (message_block)
00246 {
00247   this->aio_fildes = handle;
00248   this->aio_buf = message_block.wr_ptr ();
00249   this->aio_nbytes = bytes_to_read;
00250 }

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

Destructor.

Definition at line 278 of file POSIX_Asynch_IO.cpp.

00279 {
00280 }


Member Function Documentation

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

Definition at line 217 of file POSIX_Asynch_IO.cpp.

00218 {
00219   return this->aio_nbytes;
00220 }

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

Get the data copied to this class, before calling application handler.

Implements ACE_Asynch_Result_Impl.

Reimplemented in ACE_POSIX_Asynch_Read_File_Result.

Definition at line 253 of file POSIX_Asynch_IO.cpp.

References ACE_Refcounted_Auto_Ptr< X, ACE_LOCK >::get(), ACE_Handler::handle_read_stream(), message_block_, and ACE_Message_Block::wr_ptr().

00257 {
00258   this->bytes_transferred_ = bytes_transferred;
00259   this->success_ = success;
00260   this->completion_key_ = completion_key;
00261   this->error_ = error;
00262 
00263   // <errno> is available in the aiocb.
00264   ACE_UNUSED_ARG (error);
00265 
00266   // Appropriately move the pointers in the message block.
00267   this->message_block_.wr_ptr (bytes_transferred);
00268 
00269   // Create the interface result class.
00270   ACE_Asynch_Read_Stream::Result result (this);
00271 
00272   // Call the application handler.
00273   ACE_Handler *handler = this->handler_proxy_.get ()->handler ();
00274   if (handler != 0)
00275     handler->handle_read_stream (result);
00276 }

ACE_HANDLE ACE_POSIX_Asynch_Read_Stream_Result::handle void   )  const [virtual]
 

I/O handle used for reading.

Implements ACE_Asynch_Read_Stream_Result_Impl.

Definition at line 229 of file POSIX_Asynch_IO.cpp.

00230 {
00231   return this->aio_fildes;
00232 }

ACE_Message_Block & ACE_POSIX_Asynch_Read_Stream_Result::message_block void   )  const [virtual]
 

Message block which contains the read data.

Implements ACE_Asynch_Read_Stream_Result_Impl.

Definition at line 223 of file POSIX_Asynch_IO.cpp.

References message_block_.

00224 {
00225   return this->message_block_;
00226 }


Friends And Related Function Documentation

friend class ACE_POSIX_Asynch_Read_Stream [friend]
 

Factory classes will have special permissions.

Definition at line 230 of file POSIX_Asynch_IO.h.

friend class ACE_POSIX_Proactor [friend]
 

The Proactor constructs the Result class for faking results.

Reimplemented in ACE_POSIX_Asynch_Read_File_Result.

Definition at line 233 of file POSIX_Asynch_IO.h.


Member Data Documentation

ACE_Message_Block& ACE_POSIX_Asynch_Read_Stream_Result::message_block_ [protected]
 

Message block for reading the data into.

Definition at line 272 of file POSIX_Asynch_IO.h.

Referenced by complete(), and message_block().


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