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 Member Functions

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

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


Protected Member Functions

 ACE_POSIX_Asynch_Write_Stream_Result (const ACE_Handler::Proxy_Ptr &handler_proxy, ACE_HANDLE handle, ACE_Message_Block &message_block, size_t bytes_to_write, 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)
 ACE_Proactor will call this method when the write completes.

virtual ~ACE_POSIX_Asynch_Write_Stream_Result (void)
 Destructor.


Protected Attributes

ACE_Message_Blockmessage_block_
 Message block that contains the data to be written.


Friends

class ACE_POSIX_Asynch_Write_Stream
 Factory classes will have special privilages.

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


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 to uniquiely identify the completion of the asynchronous write.

Definition at line 316 of file POSIX_Asynch_IO.h.


Constructor & Destructor Documentation

ACE_POSIX_Asynch_Write_Stream_Result::ACE_POSIX_Asynch_Write_Stream_Result const ACE_Handler::Proxy_Ptr handler_proxy,
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 352 of file POSIX_Asynch_IO.cpp.

References ACE_Handler::Proxy_Ptr.

00360   : ACE_POSIX_Asynch_Result
00361       (handler_proxy, act, event, 0, 0, priority, signal_number),
00362     message_block_ (message_block)
00363 {
00364   this->aio_fildes = handle;
00365   this->aio_buf = message_block.rd_ptr ();
00366   this->aio_nbytes = bytes_to_write;
00367 }

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

Destructor.

Definition at line 396 of file POSIX_Asynch_IO.cpp.

00397 {
00398 }


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 334 of file POSIX_Asynch_IO.cpp.

00335 {
00336   return this->aio_nbytes;
00337 }

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 370 of file POSIX_Asynch_IO.cpp.

References ACE_Refcounted_Auto_Ptr< X, ACE_LOCK >::get(), ACE_Handler::handle_write_stream(), and ACE_Message_Block::rd_ptr().

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

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 346 of file POSIX_Asynch_IO.cpp.

00347 {
00348   return this->aio_fildes;
00349 }

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 340 of file POSIX_Asynch_IO.cpp.

00341 {
00342   return this->message_block_;
00343 }


Friends And Related Function Documentation

friend class ACE_POSIX_Asynch_Write_Stream [friend]
 

Factory classes will have special privilages.

Definition at line 320 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 323 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 363 of file POSIX_Asynch_IO.h.


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