#include <WIN32_Asynch_IO.h>
Inheritance diagram for ACE_WIN32_Asynch_Write_File_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 |
| Event associated with the OVERLAPPED structure. More... | |
| u_long | offset (void) const |
| This really make sense only when doing file I/O. More... | |
| u_long | offset_high (void) const |
| Offset_high associated with the OVERLAPPED structure. More... | |
| int | priority (void) const |
| The priority of the asynchronous operation. Currently, this is not supported on Win32. More... | |
| int | signal_number (void) const |
| No-op. Returns 0. More... | |
| size_t | bytes_to_write (void) const |
| The number of bytes which were requested at the start of the asynchronous write. More... | |
| ACE_Message_Block & | message_block (void) const |
| Message block that contains the data to be written. More... | |
| ACE_HANDLE | handle (void) const |
| I/O handle used for writing. More... | |
| int | post_completion (ACE_Proactor_Impl *proactor) |
| Post <this> to the Proactor's completion port. More... | |
Protected Methods | |
| ACE_WIN32_Asynch_Write_File_Result (ACE_Handler &handler, ACE_HANDLE handle, ACE_Message_Block &message_block, size_t bytes_to_write, const void *act, u_long offset, u_long offset_high, ACE_HANDLE event, int priority, int signal_number=0, int gather_enabled=0) | |
| Constructor is protected since creation is limited to ACE_Asynch_Write_File factory. More... | |
| virtual void | complete (size_t bytes_transferred, int success, const void *completion_key, u_long error) |
| ACE_Proactor will call this method when the write completes. More... | |
| virtual | ~ACE_WIN32_Asynch_Write_File_Result (void) |
| Destructor. More... | |
Friends | |
| class | ACE_WIN32_Asynch_Write_File |
| Factory class will have special permission. More... | |
| class | ACE_WIN32_Proactor |
| Proactor class has special permission. More... | |
This class has all the information necessary for the <handler> to uniquiely identify the completion of the asynchronous write.
This class differs slightly from ACE_Asynch_Write_Stream::Result as it calls back <ACE_Handler::handle_write_file> on the <handler> instead of <ACE_Handler::handle_write_stream>. No additional state is required by this class as ACE_Asynch_Result can store the <offset>.
Definition at line 773 of file WIN32_Asynch_IO.h.
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
Constructor is protected since creation is limited to ACE_Asynch_Write_File factory.
Definition at line 1428 of file WIN32_Asynch_IO.cpp. References offset, and offset_high.
01439 : ACE_Asynch_Result_Impl (), 01440 ACE_Asynch_Write_Stream_Result_Impl (), 01441 ACE_Asynch_Write_File_Result_Impl (), 01442 ACE_WIN32_Asynch_Write_Stream_Result (handler, 01443 handle, 01444 message_block, 01445 bytes_to_write, 01446 act, 01447 event, 01448 priority, 01449 signal_number, 01450 gather_enabled) 01451 { 01452 this->Offset = offset; 01453 this->OffsetHigh = offset_high; 01454 } |
|
|
Destructor.
Definition at line 1502 of file WIN32_Asynch_IO.cpp.
01503 {
01504 }
|
|
|
ACT associated with the operation.
Reimplemented from ACE_WIN32_Asynch_Write_Stream_Result. Definition at line 1516 of file WIN32_Asynch_IO.cpp. References ACE_WIN32_Asynch_Result::act.
01517 {
01518 return ACE_WIN32_Asynch_Result::act ();
01519 }
|
|
|
The number of bytes which were requested at the start of the asynchronous write.
Reimplemented from ACE_WIN32_Asynch_Write_Stream_Result. Definition at line 1575 of file WIN32_Asynch_IO.cpp. References ACE_WIN32_Asynch_Write_Stream_Result::bytes_to_write.
01576 {
01577 return ACE_WIN32_Asynch_Write_Stream_Result::bytes_to_write ();
01578 }
|
|
|
Number of bytes transferred by the operation.
Reimplemented from ACE_WIN32_Asynch_Write_Stream_Result. Definition at line 1510 of file WIN32_Asynch_IO.cpp. References ACE_WIN32_Asynch_Result::bytes_transferred. Referenced by complete.
01511 {
01512 return ACE_WIN32_Asynch_Result::bytes_transferred ();
01513 }
|
|
||||||||||||||||||||
|
ACE_Proactor will call this method when the write completes.
Reimplemented from ACE_WIN32_Asynch_Write_Stream_Result. Definition at line 1457 of file WIN32_Asynch_IO.cpp. References bytes_transferred, ACE_WIN32_Asynch_Result::bytes_transferred_, completion_key, ACE_WIN32_Asynch_Result::completion_key_, ACE_Message_Block::cont, error, ACE_WIN32_Asynch_Result::error_, ACE_WIN32_Asynch_Write_Stream_Result::gather_enabled, ACE_OS::getpagesize, ACE_Handler::handle_write_file, ACE_WIN32_Asynch_Result::handler_, ACE_WIN32_Asynch_Write_Stream_Result::message_block_, ACE_Message_Block::rd_ptr, success, and ACE_WIN32_Asynch_Result::success_.
01461 {
01462 // Copy the data which was returned by GetQueuedCompletionStatus
01463 this->bytes_transferred_ = bytes_transferred;
01464 this->success_ = success;
01465 this->completion_key_ = completion_key;
01466 this->error_ = error;
01467
01468 // Appropriately move the pointers in the message block.
01469 if (!this->gather_enabled ())
01470 this->message_block_.rd_ptr (bytes_transferred);
01471 else
01472 {
01473 static const size_t page_size = ACE_OS::getpagesize();
01474
01475 for (ACE_Message_Block* mb = &this->message_block_;
01476 (mb != 0) && (bytes_transferred > 0);
01477 mb = mb->cont ())
01478 {
01479 // mb->length () is ought to be >= page_size.
01480 // this is verified in the writev method
01481 // ACE_ASSERT (mb->length () >= page_size);
01482
01483 size_t len_part = page_size;
01484
01485 if ( len_part > bytes_transferred)
01486 len_part = bytes_transferred;
01487
01488 mb->rd_ptr (len_part);
01489
01490 bytes_transferred -= len_part;
01491 }
01492
01493 }
01494
01495 // Create the interface result class.
01496 ACE_Asynch_Write_File::Result result (this);
01497
01498 // Call the application handler.
01499 this->handler_.handle_write_file (result);
01500 }
|
|
|
This returns the ACT associated with the handle when it was registered with the I/O completion port. This ACT is not the same as the ACT associated with the asynchronous operation. Reimplemented from ACE_WIN32_Asynch_Write_Stream_Result. Definition at line 1528 of file WIN32_Asynch_IO.cpp. References ACE_WIN32_Asynch_Result::completion_key. Referenced by complete.
01529 {
01530 return ACE_WIN32_Asynch_Result::completion_key ();
01531 }
|
|
|
Error value if the operation fail.
Reimplemented from ACE_WIN32_Asynch_Write_Stream_Result. Definition at line 1534 of file WIN32_Asynch_IO.cpp. References ACE_WIN32_Asynch_Result::error. Referenced by complete.
01535 {
01536 return ACE_WIN32_Asynch_Result::error ();
01537 }
|
|
|
Event associated with the OVERLAPPED structure.
Reimplemented from ACE_WIN32_Asynch_Write_Stream_Result. Definition at line 1540 of file WIN32_Asynch_IO.cpp. References ACE_WIN32_Asynch_Result::event.
01541 {
01542 return ACE_WIN32_Asynch_Result::event ();
01543 }
|
|
|
I/O handle used for writing.
Reimplemented from ACE_WIN32_Asynch_Write_Stream_Result. Definition at line 1587 of file WIN32_Asynch_IO.cpp. References ACE_WIN32_Asynch_Write_Stream_Result::handle. Referenced by ACE_WIN32_Asynch_Write_File::writev.
01588 {
01589 return ACE_WIN32_Asynch_Write_Stream_Result::handle ();
01590 }
|
|
|
Message block that contains the data to be written.
Reimplemented from ACE_WIN32_Asynch_Write_Stream_Result. Definition at line 1581 of file WIN32_Asynch_IO.cpp. References ACE_WIN32_Asynch_Write_Stream_Result::message_block.
01582 {
01583 return ACE_WIN32_Asynch_Write_Stream_Result::message_block ();
01584 }
|
|
|
This really make sense only when doing file I/O.
Reimplemented from ACE_WIN32_Asynch_Write_Stream_Result. Definition at line 1546 of file WIN32_Asynch_IO.cpp. References ACE_WIN32_Asynch_Result::offset. Referenced by ACE_WIN32_Asynch_Write_File_Result.
01547 {
01548 return ACE_WIN32_Asynch_Result::offset ();
01549 }
|
|
|
Offset_high associated with the OVERLAPPED structure.
Reimplemented from ACE_WIN32_Asynch_Write_Stream_Result. Definition at line 1552 of file WIN32_Asynch_IO.cpp. References ACE_WIN32_Asynch_Result::offset_high. Referenced by ACE_WIN32_Asynch_Write_File_Result.
01553 {
01554 return ACE_WIN32_Asynch_Result::offset_high ();
01555 }
|
|
|
Post <this> to the Proactor's completion port.
Reimplemented from ACE_WIN32_Asynch_Write_Stream_Result. Definition at line 1593 of file WIN32_Asynch_IO.cpp. References ACE_WIN32_Asynch_Result::post_completion.
01594 {
01595 return ACE_WIN32_Asynch_Result::post_completion (proactor);
01596 }
|
|
|
The priority of the asynchronous operation. Currently, this is not supported on Win32.
Reimplemented from ACE_WIN32_Asynch_Write_Stream_Result. Definition at line 1558 of file WIN32_Asynch_IO.cpp. References ACE_WIN32_Asynch_Result::priority.
01559 {
01560 return ACE_WIN32_Asynch_Result::priority ();
01561 }
|
|
|
No-op. Returns 0.
Reimplemented from ACE_WIN32_Asynch_Write_Stream_Result. Definition at line 1564 of file WIN32_Asynch_IO.cpp. References ACE_WIN32_Asynch_Result::signal_number.
01565 {
01566 return ACE_WIN32_Asynch_Result::signal_number ();
01567 }
|
|
|
Did the operation succeed?
Reimplemented from ACE_WIN32_Asynch_Write_Stream_Result. Definition at line 1522 of file WIN32_Asynch_IO.cpp. References ACE_WIN32_Asynch_Result::success. Referenced by complete.
01523 {
01524 return ACE_WIN32_Asynch_Result::success ();
01525 }
|
|
|
Factory class will have special permission.
Definition at line 777 of file WIN32_Asynch_IO.h. |
|
|
Proactor class has special permission.
Reimplemented from ACE_WIN32_Asynch_Write_Stream_Result. Definition at line 780 of file WIN32_Asynch_IO.h. |
1.2.14 written by Dimitri van Heesch,
© 1997-2002