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

ACE_POSIX_Asynch_Write_File Class Reference

#include <POSIX_Asynch_IO.h>

Inheritance diagram for ACE_POSIX_Asynch_Write_File:

Inheritance graph
[legend]
Collaboration diagram for ACE_POSIX_Asynch_Write_File:

Collaboration graph
[legend]
List of all members.

Public Methods

 ACE_POSIX_Asynch_Write_File (ACE_POSIX_Proactor *posix_proactor)
 Constructor. More...

int write (ACE_Message_Block &message_block, size_t bytes_to_write, u_long offset, u_long offset_high, const void *act, int priority, int signal_number=0)
virtual ~ACE_POSIX_Asynch_Write_File (void)
 Destructor. More...


Private Methods

int write (ACE_Message_Block &message_block, size_t bytes_to_write, const void *act, int priority, int signal_number=0)

Detailed Description

This class provides concrete implementation for <ACE_Asynch_Write_File> for POSIX platforms where the completion strategy for Proactor is based on AIOCB (AIO Control Blocks).

Definition at line 541 of file POSIX_Asynch_IO.h.


Constructor & Destructor Documentation

ACE_POSIX_Asynch_Write_File::ACE_POSIX_Asynch_Write_File ACE_POSIX_Proactor   posix_proactor
 

Constructor.

Definition at line 646 of file POSIX_Asynch_IO.cpp.

00647   : ACE_Asynch_Operation_Impl (),
00648     ACE_Asynch_Write_Stream_Impl (),
00649     ACE_Asynch_Write_File_Impl (),
00650     ACE_POSIX_Asynch_Write_Stream (posix_proactor)
00651 {
00652 }

ACE_POSIX_Asynch_Write_File::~ACE_POSIX_Asynch_Write_File void    [virtual]
 

Destructor.

Definition at line 696 of file POSIX_Asynch_IO.cpp.

00697 {
00698 }


Member Function Documentation

int ACE_POSIX_Asynch_Write_File::write ACE_Message_Block   message_block,
size_t    bytes_to_write,
const void *    act,
int    priority,
int    signal_number = 0
[private, virtual]
 

This <write> belongs to ACE_POSIX_Asynch_Write_Stream. We have put this here to avoid compiler warnings. We forward this method call to the <ACE_POSIX_Asynch_Write_Stream::write> one.

Implements ACE_Asynch_Write_File_Impl.

Definition at line 701 of file POSIX_Asynch_IO.cpp.

References ACE_POSIX_Asynch_Write_Stream::write.

00706 {
00707   return ACE_POSIX_Asynch_Write_Stream::write (message_block,
00708                                                      bytes_to_write,
00709                                                      act,
00710                                                      priority,
00711                                                      signal_number);
00712 }

int ACE_POSIX_Asynch_Write_File::write ACE_Message_Block   message_block,
size_t    bytes_to_write,
u_long    offset,
u_long    offset_high,
const void *    act,
int    priority,
int    signal_number = 0
[virtual]
 

This starts off an asynchronous write. Upto <bytes_to_write> will be written and stored in the <message_block>. The write will start at <offset> from the beginning of the file.

Implements ACE_Asynch_Write_File_Impl.

Definition at line 655 of file POSIX_Asynch_IO.cpp.

References ACE_ERROR_RETURN, ACE_LIB_TEXT, ACE_NEW_RETURN, ACE_POSIX_Proactor::get_handle, ACE_Message_Block::length, LM_ERROR, ACE_POSIX_Asynch_Operation::posix_proactor, ACE_POSIX_Asynch_Operation::proactor, ACE_POSIX_Proactor::start_aio, and ACE_POSIX_Proactor::WRITE.

00662 {
00663   size_t len = message_block.length ();
00664   if (bytes_to_write > len)
00665      bytes_to_write = len;
00666 
00667   if (bytes_to_write == 0)
00668     ACE_ERROR_RETURN 
00669       ((LM_ERROR,
00670         ACE_LIB_TEXT ("ACE_POSIX_Asynch_Write_File::write:")
00671         ACE_LIB_TEXT ("Attempt to write 0 bytes\n")),
00672       -1);
00673 
00674   ACE_POSIX_Asynch_Write_File_Result *result = 0;
00675   ACE_POSIX_Proactor *proactor = this->posix_proactor ();
00676   ACE_NEW_RETURN (result,
00677                   ACE_POSIX_Asynch_Write_File_Result (*this->handler_,
00678                                                       this->handle_,
00679                                                       message_block,
00680                                                       bytes_to_write,
00681                                                       act,
00682                                                       offset,
00683                                                       offset_high,
00684                                                       proactor->get_handle (),
00685                                                       priority,
00686                                                       signal_number),
00687                   -1);
00688 
00689   int return_val = proactor->start_aio (result, ACE_POSIX_Proactor::WRITE);
00690   if (return_val == -1)
00691     delete result;
00692 
00693   return return_val;
00694 }


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