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

ACE_POSIX_Asynch_Result Class Reference

#include <POSIX_Asynch_IO.h>

Inheritance diagram for ACE_POSIX_Asynch_Result:

Inheritance graph
[legend]
Collaboration diagram for ACE_POSIX_Asynch_Result:

Collaboration graph
[legend]
List of all members.

Public Methods

size_t bytes_transferred (void) const
 Number of bytes transferred by the operation. More...

const void * act (void) const
 ACT associated with the operation. More...

int success (void) const
 Did the operation succeed? More...

const void * completion_key (void) const
u_long error (void) const
 Error value if the operation fail. More...

ACE_HANDLE event (void) const
 This returns ACE_INVALID_HANDLE on POSIX4 platforms. More...

u_long offset (void) const
u_long offset_high (void) const
int priority (void) const
 Priority of the operation. More...

int signal_number (void) const
int post_completion (ACE_Proactor_Impl *proactor)
 Post <this> to the Proactor. More...

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

void set_error (u_long errcode)
 Simulate error value to use in the post_completion (). More...

void set_bytes_transferred (size_t nbytes)
 Simulate value to use in the post_completion (). More...


Protected Methods

 ACE_POSIX_Asynch_Result (ACE_Handler &handler, const void *act, ACE_HANDLE event, u_long offset, u_long offset_high, int priority, int signal_number)
 Constructor. <Event> is not used on POSIX. More...


Protected Attributes

ACE_Handlerhandler_
 Handler that will be called back. More...

const void * act_
size_t bytes_transferred_
 Bytes transferred by this operation. More...

int success_
 Success indicator. More...

const void * completion_key_
 ACT associated with handle. More...

u_long error_
 Error if operation failed. More...


Detailed Description

This class provides concrete implementation for ACE_Asynch_Result for POSIX4 platforms. This class extends aiocb and makes it more useful.

Definition at line 49 of file POSIX_Asynch_IO.h.


Constructor & Destructor Documentation

ACE_POSIX_Asynch_Result::~ACE_POSIX_Asynch_Result void    [virtual]
 

Destructor.

Definition at line 107 of file POSIX_Asynch_IO.cpp.

00108 {
00109 }

ACE_POSIX_Asynch_Result::ACE_POSIX_Asynch_Result ACE_Handler   handler,
const void *    act,
ACE_HANDLE    event,
u_long    offset,
u_long    offset_high,
int    priority,
int    signal_number
[protected]
 

Constructor. <Event> is not used on POSIX.

Definition at line 111 of file POSIX_Asynch_IO.cpp.

References event, offset, offset_high, priority, and signal_number.

00118   : ACE_Asynch_Result_Impl (),
00119     aiocb (),
00120     handler_ (handler),
00121     act_ (act),
00122     bytes_transferred_ (0),
00123     success_ (0),
00124     completion_key_ (0),
00125     error_ (0)
00126 {
00127   aio_offset = offset;
00128   aio_reqprio = priority;
00129   aio_sigevent.sigev_signo = signal_number;
00130 
00131   // Event is not used on POSIX.
00132   ACE_UNUSED_ARG (event);
00133 
00134   //
00135   // @@ Support offset_high with aiocb64.
00136   //
00137   ACE_UNUSED_ARG (offset_high);
00138 
00139   // Other fields in the <aiocb> will be initialized by the
00140   // subclasses.
00141 }


Member Function Documentation

const void * ACE_POSIX_Asynch_Result::act void    const [virtual]
 

ACT associated with the operation.

Implements ACE_Asynch_Result_Impl.

Definition at line 32 of file POSIX_Asynch_IO.cpp.

References act_.

00033 {
00034   return this->act_;
00035 }

size_t ACE_POSIX_Asynch_Result::bytes_transferred void    const [virtual]
 

Number of bytes transferred by the operation.

Implements ACE_Asynch_Result_Impl.

Definition at line 20 of file POSIX_Asynch_IO.cpp.

References bytes_transferred_.

Referenced by ACE_POSIX_Asynch_Write_Dgram_Result::complete, ACE_POSIX_Asynch_Read_Dgram_Result::complete, ACE_POSIX_Asynch_Transmit_File_Result::complete, ACE_POSIX_Asynch_Connect_Result::complete, ACE_POSIX_Asynch_Accept_Result::complete, ACE_POSIX_Asynch_Write_File_Result::complete, ACE_POSIX_Asynch_Read_File_Result::complete, ACE_POSIX_Asynch_Write_Stream_Result::complete, ACE_POSIX_Asynch_Read_Stream_Result::complete, and ACE_POSIX_AIOCB_Proactor::process_result_queue.

00021 {
00022   return this->bytes_transferred_;
00023 }

const void * ACE_POSIX_Asynch_Result::completion_key void    const [virtual]
 

This is the ACT associated with the handle on which the Asynch_Operation takes place.

@ This is not implemented for POSIX4 platforms.

Implements ACE_Asynch_Result_Impl.

Definition at line 44 of file POSIX_Asynch_IO.cpp.

References completion_key_.

Referenced by ACE_POSIX_Asynch_Write_Dgram_Result::complete, ACE_POSIX_Asynch_Read_Dgram_Result::complete, ACE_POSIX_Asynch_Transmit_File_Result::complete, ACE_POSIX_Asynch_Connect_Result::complete, ACE_POSIX_Asynch_Accept_Result::complete, ACE_POSIX_Asynch_Write_File_Result::complete, ACE_POSIX_Asynch_Read_File_Result::complete, ACE_POSIX_Asynch_Write_Stream_Result::complete, and ACE_POSIX_Asynch_Read_Stream_Result::complete.

00045 {
00046   return this->completion_key_;
00047 }

u_long ACE_POSIX_Asynch_Result::error void    const [virtual]
 

Error value if the operation fail.

Implements ACE_Asynch_Result_Impl.

Definition at line 50 of file POSIX_Asynch_IO.cpp.

References error_.

Referenced by ACE_POSIX_Asynch_Write_Dgram_Result::complete, ACE_POSIX_Asynch_Read_Dgram_Result::complete, ACE_POSIX_Asynch_Transmit_File_Result::complete, ACE_POSIX_Asynch_Connect_Result::complete, ACE_POSIX_Asynch_Accept_Result::complete, ACE_POSIX_Asynch_Write_File_Result::complete, ACE_POSIX_Asynch_Read_File_Result::complete, ACE_POSIX_Asynch_Write_Stream_Result::complete, ACE_POSIX_Asynch_Read_Stream_Result::complete, and ACE_POSIX_AIOCB_Proactor::process_result_queue.

00051 {
00052   return this->error_;
00053 }

ACE_HANDLE ACE_POSIX_Asynch_Result::event void    const [virtual]
 

This returns ACE_INVALID_HANDLE on POSIX4 platforms.

Implements ACE_Asynch_Result_Impl.

Definition at line 61 of file POSIX_Asynch_IO.cpp.

Referenced by ACE_POSIX_Asynch_Read_Stream_Result::ACE_POSIX_Asynch_Read_Stream_Result, and ACE_POSIX_Asynch_Result.

00062 {
00063   return ACE_INVALID_HANDLE;
00064 }

u_long ACE_POSIX_Asynch_Result::offset void    const [virtual]
 

This really make sense only when doing file I/O.

@ On POSIX4-Unix, offset_high should be supported using aiocb64.

Implements ACE_Asynch_Result_Impl.

Definition at line 67 of file POSIX_Asynch_IO.cpp.

Referenced by ACE_POSIX_Asynch_Result.

00068 {
00069   return this->aio_offset;
00070 }

u_long ACE_POSIX_Asynch_Result::offset_high void    const [virtual]
 

Implements ACE_Asynch_Result_Impl.

Definition at line 73 of file POSIX_Asynch_IO.cpp.

Referenced by ACE_POSIX_Asynch_Result.

00074 {
00075   //
00076   // @@ Support aiocb64??
00077   //
00078   ACE_NOTSUP_RETURN (0);
00079 }

int ACE_POSIX_Asynch_Result::post_completion ACE_Proactor_Impl   proactor [virtual]
 

Post <this> to the Proactor.

Implements ACE_Asynch_Result_Impl.

Definition at line 94 of file POSIX_Asynch_IO.cpp.

References ACE_ERROR_RETURN, LM_ERROR, and ACE_POSIX_Proactor::post_completion.

00095 {
00096   // Get to the platform specific implementation.
00097   ACE_POSIX_Proactor *posix_proactor = ACE_dynamic_cast (ACE_POSIX_Proactor *,
00098                                                          proactor_impl);
00099 
00100   if (posix_proactor == 0)
00101     ACE_ERROR_RETURN ((LM_ERROR, "Dynamic cast to POSIX Proactor failed\n"), -1);
00102 
00103   // Post myself.
00104   return posix_proactor->post_completion (this);
00105 }

int ACE_POSIX_Asynch_Result::priority void    const [virtual]
 

Priority of the operation.

Implements ACE_Asynch_Result_Impl.

Definition at line 82 of file POSIX_Asynch_IO.cpp.

Referenced by ACE_POSIX_Asynch_Result, ACE_POSIX_Asynch_Transmit_Handler::handle_read_file, ACE_POSIX_Asynch_Transmit_Handler::handle_write_stream, and ACE_POSIX_Asynch_Transmit_Handler::initiate_read_file.

00083 {
00084   return this->aio_reqprio;
00085 }

void ACE_POSIX_Asynch_Result::set_bytes_transferred size_t    nbytes
 

Simulate value to use in the post_completion ().

Definition at line 26 of file POSIX_Asynch_IO.cpp.

References bytes_transferred_.

Referenced by ACE_POSIX_AIOCB_Proactor::cancel_aio, ACE_POSIX_Asynch_Connect::cancel_uncompleted, ACE_POSIX_Asynch_Accept::cancel_uncompleted, ACE_POSIX_Asynch_Connect::connect_i, ACE_POSIX_Asynch_Connect::handle_close, ACE_POSIX_Asynch_Connect::handle_output, and ACE_POSIX_AIOCB_Proactor::start_deferred_aio.

00027 {
00028   this->bytes_transferred_= nbytes;
00029 }

void ACE_POSIX_Asynch_Result::set_error u_long    errcode
 

Simulate error value to use in the post_completion ().

Definition at line 56 of file POSIX_Asynch_IO.cpp.

References error_.

Referenced by ACE_POSIX_AIOCB_Proactor::cancel_aio, ACE_POSIX_Asynch_Connect::cancel_uncompleted, ACE_POSIX_Asynch_Accept::cancel_uncompleted, ACE_POSIX_Asynch_Connect::connect, ACE_POSIX_Asynch_Connect::connect_i, ACE_POSIX_Asynch_Connect::handle_close, ACE_POSIX_Asynch_Accept::handle_input, ACE_POSIX_Asynch_Connect::handle_output, and ACE_POSIX_AIOCB_Proactor::start_deferred_aio.

00057 {
00058   this->error_=errcode;
00059 }

int ACE_POSIX_Asynch_Result::signal_number void    const [virtual]
 

POSIX4 realtime signal number to be used for the operation. <signal_number> ranges from SIGRTMIN to SIGRTMAX. By default, SIGRTMIN is used to issue <aio_> calls.

Implements ACE_Asynch_Result_Impl.

Definition at line 88 of file POSIX_Asynch_IO.cpp.

Referenced by ACE_POSIX_Asynch_Result, ACE_POSIX_Asynch_Transmit_Handler::handle_read_file, ACE_POSIX_Asynch_Transmit_Handler::handle_write_stream, ACE_POSIX_Asynch_Transmit_Handler::initiate_read_file, and ACE_POSIX_AIOCB_Proactor::putq_result.

00089 {
00090   return this->aio_sigevent.sigev_signo;
00091 }

int ACE_POSIX_Asynch_Result::success void    const [virtual]
 

Did the operation succeed?

Implements ACE_Asynch_Result_Impl.

Definition at line 38 of file POSIX_Asynch_IO.cpp.

References success_.

Referenced by ACE_POSIX_Asynch_Write_Dgram_Result::complete, ACE_POSIX_Asynch_Read_Dgram_Result::complete, ACE_POSIX_Asynch_Transmit_File_Result::complete, ACE_POSIX_Asynch_Connect_Result::complete, ACE_POSIX_Asynch_Accept_Result::complete, ACE_POSIX_Asynch_Write_File_Result::complete, ACE_POSIX_Asynch_Read_File_Result::complete, ACE_POSIX_Asynch_Write_Stream_Result::complete, and ACE_POSIX_Asynch_Read_Stream_Result::complete.

00039 {
00040   return this->success_;
00041 }


Member Data Documentation

const void* ACE_POSIX_Asynch_Result::act_ [protected]
 

ACT for this operation. We could use <aiocb::aio_sigevent.sigev_value.sival_ptr> for this. But it doesnot provide the constness, so this may be better.

Definition at line 128 of file POSIX_Asynch_IO.h.

Referenced by act.

size_t ACE_POSIX_Asynch_Result::bytes_transferred_ [protected]
 

Bytes transferred by this operation.

Definition at line 131 of file POSIX_Asynch_IO.h.

Referenced by bytes_transferred, ACE_POSIX_Asynch_Write_Dgram_Result::complete, ACE_POSIX_Asynch_Read_Dgram_Result::complete, ACE_POSIX_Asynch_Transmit_File_Result::complete, ACE_POSIX_Asynch_Connect_Result::complete, ACE_POSIX_Asynch_Accept_Result::complete, ACE_POSIX_Asynch_Write_File_Result::complete, ACE_POSIX_Asynch_Read_File_Result::complete, ACE_POSIX_Asynch_Write_Stream_Result::complete, ACE_POSIX_Asynch_Read_Stream_Result::complete, and set_bytes_transferred.

const void* ACE_POSIX_Asynch_Result::completion_key_ [protected]
 

ACT associated with handle.

Definition at line 137 of file POSIX_Asynch_IO.h.

Referenced by ACE_POSIX_Asynch_Write_Dgram_Result::complete, ACE_POSIX_Asynch_Read_Dgram_Result::complete, ACE_POSIX_Asynch_Transmit_File_Result::complete, ACE_POSIX_Asynch_Connect_Result::complete, ACE_POSIX_Asynch_Accept_Result::complete, ACE_POSIX_Asynch_Write_File_Result::complete, ACE_POSIX_Asynch_Read_File_Result::complete, ACE_POSIX_Asynch_Write_Stream_Result::complete, ACE_POSIX_Asynch_Read_Stream_Result::complete, and completion_key.

u_long ACE_POSIX_Asynch_Result::error_ [protected]
 

Error if operation failed.

Definition at line 140 of file POSIX_Asynch_IO.h.

Referenced by ACE_POSIX_Asynch_Write_Dgram_Result::complete, ACE_POSIX_Asynch_Read_Dgram_Result::complete, ACE_POSIX_Asynch_Transmit_File_Result::complete, ACE_POSIX_Asynch_Connect_Result::complete, ACE_POSIX_Asynch_Accept_Result::complete, ACE_POSIX_Asynch_Write_File_Result::complete, ACE_POSIX_Asynch_Read_File_Result::complete, ACE_POSIX_Asynch_Write_Stream_Result::complete, ACE_POSIX_Asynch_Read_Stream_Result::complete, error, and set_error.

ACE_Handler& ACE_POSIX_Asynch_Result::handler_ [protected]
 

Handler that will be called back.

Definition at line 120 of file POSIX_Asynch_IO.h.

Referenced by ACE_POSIX_Wakeup_Completion::complete, ACE_POSIX_Asynch_Timer::complete, ACE_POSIX_Asynch_Write_Dgram_Result::complete, ACE_POSIX_Asynch_Read_Dgram_Result::complete, ACE_POSIX_Asynch_Transmit_File_Result::complete, ACE_POSIX_Asynch_Connect_Result::complete, ACE_POSIX_Asynch_Accept_Result::complete, ACE_POSIX_Asynch_Write_File_Result::complete, ACE_POSIX_Asynch_Read_File_Result::complete, ACE_POSIX_Asynch_Write_Stream_Result::complete, and ACE_POSIX_Asynch_Read_Stream_Result::complete.

int ACE_POSIX_Asynch_Result::success_ [protected]
 

Success indicator.

Definition at line 134 of file POSIX_Asynch_IO.h.

Referenced by ACE_POSIX_Asynch_Write_Dgram_Result::complete, ACE_POSIX_Asynch_Read_Dgram_Result::complete, ACE_POSIX_Asynch_Transmit_File_Result::complete, ACE_POSIX_Asynch_Connect_Result::complete, ACE_POSIX_Asynch_Accept_Result::complete, ACE_POSIX_Asynch_Write_File_Result::complete, ACE_POSIX_Asynch_Read_File_Result::complete, ACE_POSIX_Asynch_Write_Stream_Result::complete, ACE_POSIX_Asynch_Read_Stream_Result::complete, and success.


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