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

ACE_POSIX_Asynch_Read_Stream Class Reference

#include <POSIX_Asynch_IO.h>

Inheritance diagram for ACE_POSIX_Asynch_Read_Stream:

Inheritance graph
[legend]
Collaboration diagram for ACE_POSIX_Asynch_Read_Stream:

Collaboration graph
[legend]
List of all members.

Public Methods

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

int read (ACE_Message_Block &message_block, size_t bytes_to_read, const void *act, int priority, int signal_number=0)
 This starts off an asynchronous read. Upto <bytes_to_read> will be read and stored in the <message_block>. More...

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


Detailed Description

This class implements <ACE_Asynch_Read_Stream> for all POSIX based implementation of Proactor.

Definition at line 278 of file POSIX_Asynch_IO.h.


Constructor & Destructor Documentation

ACE_POSIX_Asynch_Read_Stream::ACE_POSIX_Asynch_Read_Stream ACE_POSIX_Proactor   posix_proactor
 

Constructor.

Definition at line 283 of file POSIX_Asynch_IO.cpp.

00284   : ACE_Asynch_Operation_Impl (),
00285     ACE_Asynch_Read_Stream_Impl (),
00286     ACE_POSIX_Asynch_Operation (posix_proactor)
00287 {
00288 }

ACE_POSIX_Asynch_Read_Stream::~ACE_POSIX_Asynch_Read_Stream void    [virtual]
 

Destructor.

Definition at line 328 of file POSIX_Asynch_IO.cpp.

00329 {
00330 }


Member Function Documentation

int ACE_POSIX_Asynch_Read_Stream::read ACE_Message_Block   message_block,
size_t    bytes_to_read,
const void *    act,
int    priority,
int    signal_number = 0
[virtual]
 

This starts off an asynchronous read. Upto <bytes_to_read> will be read and stored in the <message_block>.

Implements ACE_Asynch_Read_Stream_Impl.

Reimplemented in ACE_POSIX_Asynch_Read_File.

Definition at line 291 of file POSIX_Asynch_IO.cpp.

References ACE_NEW_RETURN, ACE_POSIX_Proactor::get_handle, ACE_POSIX_Asynch_Operation::posix_proactor, ACE_POSIX_Asynch_Operation::proactor, ACE_POSIX_Proactor::READ, ACE_Message_Block::space, and ACE_POSIX_Proactor::start_aio.

Referenced by ACE_AIOCB_Notify_Pipe_Manager::ACE_AIOCB_Notify_Pipe_Manager, and ACE_POSIX_Asynch_Read_File::read.

00296 {
00297   size_t space = message_block.space ();
00298   if (bytes_to_read > space)
00299      bytes_to_read=space;
00300 
00301   if (bytes_to_read == 0)
00302     {
00303       errno = ENOSPC;
00304       return -1;
00305     }
00306 
00307   // Create the Asynch_Result.
00308   ACE_POSIX_Asynch_Read_Stream_Result *result = 0;
00309   ACE_POSIX_Proactor *proactor = this->posix_proactor ();
00310   ACE_NEW_RETURN (result,
00311                   ACE_POSIX_Asynch_Read_Stream_Result (*this->handler_,
00312                                                        this->handle_,
00313                                                        message_block,
00314                                                        bytes_to_read,
00315                                                        act,
00316                                                        proactor->get_handle (),
00317                                                        priority,
00318                                                        signal_number),
00319                   -1);
00320 
00321   int return_val = proactor->start_aio (result, ACE_POSIX_Proactor::READ);
00322   if (return_val == -1)
00323     delete result;
00324 
00325   return return_val;
00326 }


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