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

ACE_WIN32_Asynch_Write_Stream_Result Class Reference

This class provides concrete implementation for ACE_Asynch_Write_Stream::Result class. More...

#include <WIN32_Asynch_IO.h>

Inheritance diagram for ACE_WIN32_Asynch_Write_Stream_Result:

Inheritance graph
[legend]
Collaboration diagram for ACE_WIN32_Asynch_Write_Stream_Result:

Collaboration graph
[legend]
List of all members.

Public Methods

size_t bytes_to_write (void) const
 The number of bytes which were requested at the start of the asynchronous write. More...

ACE_Message_Blockmessage_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...

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...

int post_completion (ACE_Proactor_Impl *proactor)
 Post <this> to the Proactor's completion port. More...

int gather_enabled (void) const
 Accessor for the gather write flag. More...


Protected Methods

 ACE_WIN32_Asynch_Write_Stream_Result (ACE_Handler &handler, ACE_HANDLE handle, ACE_Message_Block &message_block, size_t bytes_to_write, const void *act, ACE_HANDLE event, int priority, int signal_number=0, int gather_enabled=0)
 Constructor is protected since creation is limited to ACE_Asynch_Write_Stream 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_Stream_Result (void)
 Destructor. More...


Protected Attributes

size_t bytes_to_write_
 The number of bytes which were requested at the start of the asynchronous write. More...

ACE_Message_Blockmessage_block_
 Message block that contains the data to be written. More...

ACE_HANDLE handle_
 I/O handle used for writing. More...

int gather_enabled_
 Flag for gather write. More...


Friends

class ACE_WIN32_Asynch_Write_Stream
 Factory class willl have special permissions. More...

class ACE_WIN32_Proactor
 Proactor class has special permission. More...


Detailed Description

This class provides concrete implementation for ACE_Asynch_Write_Stream::Result class.

Definition at line 382 of file WIN32_Asynch_IO.h.


Constructor & Destructor Documentation

ACE_WIN32_Asynch_Write_Stream_Result::ACE_WIN32_Asynch_Write_Stream_Result ACE_Handler   handler,
ACE_HANDLE    handle,
ACE_Message_Block   message_block,
size_t    bytes_to_write,
const void *    act,
ACE_HANDLE    event,
int    priority,
int    signal_number = 0,
int    gather_enabled = 0
[protected]
 

Constructor is protected since creation is limited to ACE_Asynch_Write_Stream factory.

Definition at line 637 of file WIN32_Asynch_IO.cpp.

ACE_WIN32_Asynch_Write_Stream_Result::~ACE_WIN32_Asynch_Write_Stream_Result void    [protected, virtual]
 

Destructor.

Definition at line 695 of file WIN32_Asynch_IO.cpp.

00696 {
00697 }


Member Function Documentation

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

ACT associated with the operation.

Reimplemented from ACE_WIN32_Asynch_Result.

Reimplemented in ACE_WIN32_Asynch_Write_File_Result.

Definition at line 709 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::act.

00710 {
00711   return ACE_WIN32_Asynch_Result::act ();
00712 }

size_t ACE_WIN32_Asynch_Write_Stream_Result::bytes_to_write void    const [virtual]
 

The number of bytes which were requested at the start of the asynchronous write.

Implements ACE_Asynch_Write_Stream_Result_Impl.

Reimplemented in ACE_WIN32_Asynch_Write_File_Result.

Definition at line 620 of file WIN32_Asynch_IO.cpp.

References bytes_to_write_.

Referenced by ACE_WIN32_Asynch_Write_File_Result::bytes_to_write, and ACE_WIN32_Asynch_Write_Stream::shared_write.

00621 {
00622   return this->bytes_to_write_;
00623 }

size_t ACE_WIN32_Asynch_Write_Stream_Result::bytes_transferred void    const [virtual]
 

Number of bytes transferred by the operation.

Reimplemented from ACE_WIN32_Asynch_Result.

Reimplemented in ACE_WIN32_Asynch_Write_File_Result.

Definition at line 703 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::bytes_transferred.

Referenced by complete.

00704 {
00705   return ACE_WIN32_Asynch_Result::bytes_transferred ();
00706 }

void ACE_WIN32_Asynch_Write_Stream_Result::complete size_t    bytes_transferred,
int    success,
const void *    completion_key,
u_long    error
[protected, virtual]
 

ACE_Proactor will call this method when the write completes.

Implements ACE_Asynch_Result_Impl.

Reimplemented in ACE_WIN32_Asynch_Write_File_Result.

Definition at line 657 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_, gather_enabled, ACE_Handler::handle_write_stream, ACE_WIN32_Asynch_Result::handler_, ACE_Message_Block::length, message_block_, ACE_Message_Block::rd_ptr, success, and ACE_WIN32_Asynch_Result::success_.

00661 {
00662   // Copy the data which was returned by <GetQueuedCompletionStatus>.
00663   this->bytes_transferred_ = bytes_transferred;
00664   this->success_ = success;
00665   this->completion_key_ = completion_key;
00666   this->error_ = error;
00667 
00668   // Appropriately move the pointers in the message block.
00669   if (!this->gather_enabled ())
00670     this->message_block_.rd_ptr (bytes_transferred);
00671   else
00672   {
00673     for (ACE_Message_Block* mb = &this->message_block_;
00674          (mb != 0) && (bytes_transferred > 0);
00675          mb = mb->cont ())
00676     {
00677       size_t len_part = mb->length ();
00678 
00679       if ( len_part > bytes_transferred)
00680         len_part = bytes_transferred;
00681 
00682       mb->rd_ptr (len_part);
00683 
00684       bytes_transferred -= len_part;
00685     }
00686   }
00687 
00688   // Create the interface result class.
00689   ACE_Asynch_Write_Stream::Result result (this);
00690 
00691   // Call the application handler.
00692   this->handler_.handle_write_stream (result);
00693 }

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

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_Result.

Reimplemented in ACE_WIN32_Asynch_Write_File_Result.

Definition at line 721 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::completion_key.

Referenced by complete.

00722 {
00723   return ACE_WIN32_Asynch_Result::completion_key ();
00724 }

u_long ACE_WIN32_Asynch_Write_Stream_Result::error void    const [virtual]
 

Error value if the operation fail.

Reimplemented from ACE_WIN32_Asynch_Result.

Reimplemented in ACE_WIN32_Asynch_Write_File_Result.

Definition at line 727 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::error.

Referenced by complete.

00728 {
00729   return ACE_WIN32_Asynch_Result::error ();
00730 }

ACE_HANDLE ACE_WIN32_Asynch_Write_Stream_Result::event void    const [virtual]
 

Event associated with the OVERLAPPED structure.

Reimplemented from ACE_WIN32_Asynch_Result.

Reimplemented in ACE_WIN32_Asynch_Write_File_Result.

Definition at line 733 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::event.

00734 {
00735   return ACE_WIN32_Asynch_Result::event ();
00736 }

int ACE_WIN32_Asynch_Write_Stream_Result::gather_enabled void    const
 

Accessor for the gather write flag.

Definition at line 769 of file WIN32_Asynch_IO.cpp.

References gather_enabled_.

Referenced by ACE_WIN32_Asynch_Write_File_Result::complete, and complete.

00770 {
00771   return this->gather_enabled_;
00772 }

ACE_HANDLE ACE_WIN32_Asynch_Write_Stream_Result::handle void    const [virtual]
 

I/O handle used for writing.

Implements ACE_Asynch_Write_Stream_Result_Impl.

Reimplemented in ACE_WIN32_Asynch_Write_File_Result.

Definition at line 632 of file WIN32_Asynch_IO.cpp.

References handle_.

Referenced by ACE_WIN32_Asynch_Write_File_Result::handle, ACE_WIN32_Asynch_Write_Stream::shared_write, and ACE_WIN32_Asynch_Write_Stream::writev.

00633 {
00634   return this->handle_;
00635 }

ACE_Message_Block & ACE_WIN32_Asynch_Write_Stream_Result::message_block void    const [virtual]
 

Message block that contains the data to be written.

Implements ACE_Asynch_Write_Stream_Result_Impl.

Reimplemented in ACE_WIN32_Asynch_Write_File_Result.

Definition at line 626 of file WIN32_Asynch_IO.cpp.

References message_block_.

Referenced by ACE_WIN32_Asynch_Write_File_Result::message_block, and ACE_WIN32_Asynch_Write_Stream::shared_write.

00627 {
00628   return this->message_block_;
00629 }

u_long ACE_WIN32_Asynch_Write_Stream_Result::offset void    const [virtual]
 

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

Reimplemented from ACE_WIN32_Asynch_Result.

Reimplemented in ACE_WIN32_Asynch_Write_File_Result.

Definition at line 739 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::offset.

00740 {
00741   return ACE_WIN32_Asynch_Result::offset ();
00742 }

u_long ACE_WIN32_Asynch_Write_Stream_Result::offset_high void    const [virtual]
 

Offset_high associated with the OVERLAPPED structure.

Reimplemented from ACE_WIN32_Asynch_Result.

Reimplemented in ACE_WIN32_Asynch_Write_File_Result.

Definition at line 745 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::offset_high.

00746 {
00747   return ACE_WIN32_Asynch_Result::offset_high ();
00748 }

int ACE_WIN32_Asynch_Write_Stream_Result::post_completion ACE_Proactor_Impl   proactor [virtual]
 

Post <this> to the Proactor's completion port.

Reimplemented from ACE_WIN32_Asynch_Result.

Reimplemented in ACE_WIN32_Asynch_Write_File_Result.

Definition at line 763 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::post_completion.

00764 {
00765   return ACE_WIN32_Asynch_Result::post_completion (proactor);
00766 }

int ACE_WIN32_Asynch_Write_Stream_Result::priority void    const [virtual]
 

The priority of the asynchronous operation. Currently, this is not supported on Win32.

Reimplemented from ACE_WIN32_Asynch_Result.

Reimplemented in ACE_WIN32_Asynch_Write_File_Result.

Definition at line 751 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::priority.

00752 {
00753   return ACE_WIN32_Asynch_Result::priority ();
00754 }

int ACE_WIN32_Asynch_Write_Stream_Result::signal_number void    const [virtual]
 

No-op. Returns 0.

Reimplemented from ACE_WIN32_Asynch_Result.

Reimplemented in ACE_WIN32_Asynch_Write_File_Result.

Definition at line 757 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::signal_number.

00758 {
00759   return ACE_WIN32_Asynch_Result::signal_number ();
00760 }

int ACE_WIN32_Asynch_Write_Stream_Result::success void    const [virtual]
 

Did the operation succeed?

Reimplemented from ACE_WIN32_Asynch_Result.

Reimplemented in ACE_WIN32_Asynch_Write_File_Result.

Definition at line 715 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::success.

Referenced by complete.

00716 {
00717   return ACE_WIN32_Asynch_Result::success ();
00718 }


Friends And Related Function Documentation

friend class ACE_WIN32_Asynch_Write_Stream [friend]
 

Factory class willl have special permissions.

Definition at line 386 of file WIN32_Asynch_IO.h.

friend class ACE_WIN32_Proactor [friend]
 

Proactor class has special permission.

Reimplemented from ACE_WIN32_Asynch_Result.

Reimplemented in ACE_WIN32_Asynch_Write_File_Result.

Definition at line 389 of file WIN32_Asynch_IO.h.


Member Data Documentation

size_t ACE_WIN32_Asynch_Write_Stream_Result::bytes_to_write_ [protected]
 

The number of bytes which were requested at the start of the asynchronous write.

Definition at line 470 of file WIN32_Asynch_IO.h.

Referenced by bytes_to_write.

int ACE_WIN32_Asynch_Write_Stream_Result::gather_enabled_ [protected]
 

Flag for gather write.

Definition at line 479 of file WIN32_Asynch_IO.h.

Referenced by gather_enabled.

ACE_HANDLE ACE_WIN32_Asynch_Write_Stream_Result::handle_ [protected]
 

I/O handle used for writing.

Definition at line 476 of file WIN32_Asynch_IO.h.

Referenced by handle.

ACE_Message_Block& ACE_WIN32_Asynch_Write_Stream_Result::message_block_ [protected]
 

Message block that contains the data to be written.

Definition at line 473 of file WIN32_Asynch_IO.h.

Referenced by ACE_WIN32_Asynch_Write_File_Result::complete, complete, and message_block.


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