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

ACE_POSIX_Asynch_Write_Stream_Result Class Reference

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

#include <POSIX_Asynch_IO.h>

Inheritance diagram for ACE_POSIX_Asynch_Write_Stream_Result:

Inheritance graph
[legend]
Collaboration diagram for ACE_POSIX_Asynch_Write_Stream_Result:

Collaboration graph
[legend]
List of all members.

Public Methods

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

ACE_Message_Blockmessage_block (void) const
 Message block that contains the data to be written. More...

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


Protected Methods

 ACE_POSIX_Asynch_Write_Stream_Result (ACE_Handler &handler, ACE_HANDLE handle, ACE_Message_Block &message_block, size_t bytes_to_write, const void *act, ACE_HANDLE event, int priority, int signal_number)
 Constructor is protected since creation is limited to ACE_Asynch_Write_Stream 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 write completes. More...

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


Protected Attributes

ACE_Message_Blockmessage_block_
 Message block that contains the data to be written. More...


Friends

class ACE_POSIX_Asynch_Write_Stream
 Factory classes will have special privilages. More...

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


Detailed Description

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

This class has all the information necessary for the <handler> to uniquiely identify the completion of the asynchronous write.

Definition at line 309 of file POSIX_Asynch_IO.h.


Constructor & Destructor Documentation

ACE_POSIX_Asynch_Write_Stream_Result::ACE_POSIX_Asynch_Write_Stream_Result ACE_Handler   handler,
ACE_HANDLE    handle,
ACE_Message_Block   message_block,
size_t    bytes_to_write,
const void *    act,
ACE_HANDLE    event,
int    priority,
int    signal_number
[protected]
 

Constructor is protected since creation is limited to ACE_Asynch_Write_Stream factory.

Definition at line 353 of file POSIX_Asynch_IO.cpp.

00361   : ACE_Asynch_Result_Impl (),
00362     ACE_Asynch_Write_Stream_Result_Impl (),
00363     ACE_POSIX_Asynch_Result (handler, act, event, 0, 0, priority, signal_number),
00364     message_block_ (message_block)
00365 {
00366   this->aio_fildes = handle;
00367   this->aio_buf = message_block.rd_ptr ();
00368   this->aio_nbytes = bytes_to_write;
00369   ACE_UNUSED_ARG (event);
00370 }

ACE_POSIX_Asynch_Write_Stream_Result::~ACE_POSIX_Asynch_Write_Stream_Result void    [protected, virtual]
 

Destructor.

Definition at line 397 of file POSIX_Asynch_IO.cpp.

00398 {
00399 }


Member Function Documentation

size_t ACE_POSIX_Asynch_Write_Stream_Result::bytes_to_write void    const [virtual]
 

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

Implements ACE_Asynch_Write_Stream_Result_Impl.

Definition at line 335 of file POSIX_Asynch_IO.cpp.

00336 {
00337   return this->aio_nbytes;
00338 }

void ACE_POSIX_Asynch_Write_Stream_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 write completes.

Implements ACE_Asynch_Result_Impl.

Reimplemented in ACE_POSIX_Asynch_Write_File_Result.

Definition at line 373 of file POSIX_Asynch_IO.cpp.

References ACE_POSIX_Asynch_Result::bytes_transferred, ACE_POSIX_Asynch_Result::bytes_transferred_, ACE_POSIX_Asynch_Result::completion_key, ACE_POSIX_Asynch_Result::completion_key_, ACE_POSIX_Asynch_Result::error, ACE_POSIX_Asynch_Result::error_, ACE_Handler::handle_write_stream, ACE_POSIX_Asynch_Result::handler_, message_block_, ACE_Message_Block::rd_ptr, ACE_POSIX_Asynch_Result::success, and ACE_POSIX_Asynch_Result::success_.

00377 {
00378   // Get all the data copied.
00379   this->bytes_transferred_ = bytes_transferred;
00380   this->success_ = success;
00381   this->completion_key_ = completion_key;
00382   this->error_ = error;
00383 
00384   // <errno> is available in the aiocb.
00385   ACE_UNUSED_ARG (error);
00386 
00387   // Appropriately move the pointers in the message block.
00388   this->message_block_.rd_ptr (bytes_transferred);
00389 
00390   // Create the interface result class.
00391   ACE_Asynch_Write_Stream::Result result (this);
00392 
00393   // Call the application handler.
00394   this->handler_.handle_write_stream (result);
00395 }

ACE_HANDLE ACE_POSIX_Asynch_Write_Stream_Result::handle void    const [virtual]
 

I/O handle used for writing.

Implements ACE_Asynch_Write_Stream_Result_Impl.

Definition at line 347 of file POSIX_Asynch_IO.cpp.

00348 {
00349   return this->aio_fildes;
00350 }

ACE_Message_Block & ACE_POSIX_Asynch_Write_Stream_Result::message_block void    const [virtual]
 

Message block that contains the data to be written.

Implements ACE_Asynch_Write_Stream_Result_Impl.

Definition at line 341 of file POSIX_Asynch_IO.cpp.

References message_block_.

00342 {
00343   return this->message_block_;
00344 }


Friends And Related Function Documentation

friend class ACE_POSIX_Asynch_Write_Stream [friend]
 

Factory classes will have special privilages.

Definition at line 313 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_Write_File_Result.

Definition at line 316 of file POSIX_Asynch_IO.h.


Member Data Documentation

ACE_Message_Block& ACE_POSIX_Asynch_Write_Stream_Result::message_block_ [protected]
 

Message block that contains the data to be written.

Definition at line 356 of file POSIX_Asynch_IO.h.

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


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