#include <POSIX_Asynch_IO.h>
Inheritance diagram for ACE_POSIX_Asynch_Result:


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_Handler & | handler_ |
| 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... | |
aiocb and makes it more useful.
Definition at line 49 of file POSIX_Asynch_IO.h.
|
|
Destructor.
Definition at line 107 of file POSIX_Asynch_IO.cpp.
00108 {
00109 }
|
|
||||||||||||||||||||||||||||||||
|
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 } |
|
|
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 }
|
|
|
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 }
|
|
|
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 }
|
|
|
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 }
|
|
|
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 }
|
|
|
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 }
|
|
|
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 }
|
|
|
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 }
|
|
|
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 }
|
|
|
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 }
|
|
|
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 }
|
|
|
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 }
|
|
|
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 }
|
|
|
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. |
|
|
|
|
|
1.2.14 written by Dimitri van Heesch,
© 1997-2002