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

 ACE_POSIX_Asynch_Read_Stream (ACE_POSIX_Proactor *posix_proactor)
 Constructor.

int read (ACE_Message_Block &message_block, size_t bytes_to_read, const void *act, int priority, int signal_number=0)
virtual ~ACE_POSIX_Asynch_Read_Stream (void)
 Destructor.


Detailed Description

This class implements for all POSIX based implementation of Proactor.

Definition at line 285 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 284 of file POSIX_Asynch_IO.cpp.

00285   : ACE_POSIX_Asynch_Operation (posix_proactor)
00286 {
00287 }

ACE_POSIX_Asynch_Read_Stream::~ACE_POSIX_Asynch_Read_Stream void   )  [virtual]
 

Destructor.

Definition at line 327 of file POSIX_Asynch_IO.cpp.

00328 {
00329 }


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 will be read and stored in the .

Implements ACE_Asynch_Read_Stream_Impl.

Reimplemented in ACE_POSIX_Asynch_Read_File.

Definition at line 290 of file POSIX_Asynch_IO.cpp.

References ACE_NEW_RETURN, ACE_POSIX_Proactor::get_handle(), ACE_POSIX_Asynch_Operation::posix_proactor(), 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().

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


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