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

ACE_WIN32_Asynch_Write_Dgram_Result Class Reference

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

#include <WIN32_Asynch_IO.h>

Inheritance diagram for ACE_WIN32_Asynch_Write_Dgram_Result:

Inheritance graph
[legend]
Collaboration diagram for ACE_WIN32_Asynch_Write_Dgram_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 which contains the sent data. More...

int flags (void) const
 The flags using in the write. 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...


Protected Methods

 ACE_WIN32_Asynch_Write_Dgram_Result (ACE_Handler &handler, ACE_HANDLE handle, ACE_Message_Block *message_block, size_t bytes_to_write, int flags, const void *act, ACE_HANDLE event, int priority, int signal_number=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_Dgram_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 used for the send. More...

int flags_
 The flags using in the write. More...

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


Friends

class ACE_WIN32_Asynch_Write_Dgram
 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_Dgram::Result class.

Definition at line 1763 of file WIN32_Asynch_IO.h.


Constructor & Destructor Documentation

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

Constructor is protected since creation is limited to ACE_Asynch_Write_Stream factory.

Definition at line 3520 of file WIN32_Asynch_IO.cpp.

03529   : ACE_Asynch_Result_Impl (),
03530     ACE_Asynch_Write_Dgram_Result_Impl(),
03531     ACE_WIN32_Asynch_Result (handler, act, event, 0, 0, priority, signal_number),
03532     bytes_to_write_ (bytes_to_write),
03533     message_block_ (message_block),
03534     flags_ (flags),
03535     handle_ (handle)
03536 {
03537 }

ACE_WIN32_Asynch_Write_Dgram_Result::~ACE_WIN32_Asynch_Write_Dgram_Result void    [protected, virtual]
 

Destructor.

Definition at line 3573 of file WIN32_Asynch_IO.cpp.

03574 {
03575 }


Member Function Documentation

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

ACT associated with the operation.

Reimplemented from ACE_WIN32_Asynch_Result.

Definition at line 3461 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::act.

03462 {
03463   return ACE_WIN32_Asynch_Result::act ();
03464 }

size_t ACE_WIN32_Asynch_Write_Dgram_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_Dgram_Result_Impl.

Definition at line 3431 of file WIN32_Asynch_IO.cpp.

References bytes_to_write_.

03432 {
03433   return this->bytes_to_write_;
03434 }

size_t ACE_WIN32_Asynch_Write_Dgram_Result::bytes_transferred void    const [virtual]
 

Number of bytes transferred by the operation.

Reimplemented from ACE_WIN32_Asynch_Result.

Definition at line 3455 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::bytes_transferred.

Referenced by complete.

03456 {
03457   return ACE_WIN32_Asynch_Result::bytes_transferred ();
03458 }

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

Definition at line 3540 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_Handler::handle_write_dgram, ACE_WIN32_Asynch_Result::handler_, ACE_Message_Block::length, message_block_, ACE_Message_Block::rd_ptr, success, and ACE_WIN32_Asynch_Result::success_.

03544 {
03545   // Copy the data which was returned by GetQueuedCompletionStatus
03546   this->bytes_transferred_ = bytes_transferred;
03547   this->success_ = success;
03548   this->completion_key_ = completion_key;
03549   this->error_ = error;
03550 
03551   // Appropriately move the pointers in the message block.
03552   for (ACE_Message_Block* mb = this->message_block_;
03553        (mb != 0) && (bytes_transferred > 0);
03554        mb = mb->cont ())
03555     {
03556       size_t len_part = mb->length ();
03557 
03558       if ( len_part > bytes_transferred)
03559         len_part = bytes_transferred;
03560 
03561       mb->rd_ptr (len_part);
03562 
03563       bytes_transferred -= len_part;
03564     }
03565 
03566   // Create the interface result class.
03567   ACE_Asynch_Write_Dgram::Result result (this);
03568 
03569   // Call the application handler.
03570   this->handler_.handle_write_dgram (result);
03571 }

const void * ACE_WIN32_Asynch_Write_Dgram_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.

Definition at line 3473 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::completion_key.

Referenced by complete.

03474 {
03475   return ACE_WIN32_Asynch_Result::completion_key ();
03476 }

u_long ACE_WIN32_Asynch_Write_Dgram_Result::error void    const [virtual]
 

Error value if the operation fail.

Reimplemented from ACE_WIN32_Asynch_Result.

Definition at line 3479 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::error.

Referenced by complete.

03480 {
03481   return ACE_WIN32_Asynch_Result::error ();
03482 }

ACE_HANDLE ACE_WIN32_Asynch_Write_Dgram_Result::event void    const [virtual]
 

Event associated with the OVERLAPPED structure.

Reimplemented from ACE_WIN32_Asynch_Result.

Definition at line 3485 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::event.

03486 {
03487   return ACE_WIN32_Asynch_Result::event ();
03488 }

int ACE_WIN32_Asynch_Write_Dgram_Result::flags void    const [virtual]
 

The flags using in the write.

Implements ACE_Asynch_Write_Dgram_Result_Impl.

Definition at line 3443 of file WIN32_Asynch_IO.cpp.

References flags_.

03444 {
03445   return this->flags_;
03446 }

ACE_HANDLE ACE_WIN32_Asynch_Write_Dgram_Result::handle void    const [virtual]
 

I/O handle used for writing.

Implements ACE_Asynch_Write_Dgram_Result_Impl.

Definition at line 3449 of file WIN32_Asynch_IO.cpp.

References handle_.

Referenced by ACE_WIN32_Asynch_Write_Dgram::send.

03450 {
03451   return this->handle_;
03452 }

ACE_Message_Block * ACE_WIN32_Asynch_Write_Dgram_Result::message_block void    const [virtual]
 

Message block which contains the sent data.

Implements ACE_Asynch_Write_Dgram_Result_Impl.

Definition at line 3437 of file WIN32_Asynch_IO.cpp.

References message_block_.

03438 {
03439   return this->message_block_;
03440 }

u_long ACE_WIN32_Asynch_Write_Dgram_Result::offset void    const [virtual]
 

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

Reimplemented from ACE_WIN32_Asynch_Result.

Definition at line 3491 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::offset.

03492 {
03493   return ACE_WIN32_Asynch_Result::offset ();
03494 }

u_long ACE_WIN32_Asynch_Write_Dgram_Result::offset_high void    const [virtual]
 

Offset_high associated with the OVERLAPPED structure.

Reimplemented from ACE_WIN32_Asynch_Result.

Definition at line 3497 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::offset_high.

03498 {
03499   return ACE_WIN32_Asynch_Result::offset_high ();
03500 }

int ACE_WIN32_Asynch_Write_Dgram_Result::post_completion ACE_Proactor_Impl   proactor [virtual]
 

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

Reimplemented from ACE_WIN32_Asynch_Result.

Definition at line 3515 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::post_completion.

03516 {
03517   return ACE_WIN32_Asynch_Result::post_completion (proactor);
03518 }

int ACE_WIN32_Asynch_Write_Dgram_Result::priority void    const [virtual]
 

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

Reimplemented from ACE_WIN32_Asynch_Result.

Definition at line 3503 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::priority.

03504 {
03505   return ACE_WIN32_Asynch_Result::priority ();
03506 }

int ACE_WIN32_Asynch_Write_Dgram_Result::signal_number void    const [virtual]
 

No-op. Returns 0.

Reimplemented from ACE_WIN32_Asynch_Result.

Definition at line 3509 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::signal_number.

03510 {
03511   return ACE_WIN32_Asynch_Result::signal_number ();
03512 }

int ACE_WIN32_Asynch_Write_Dgram_Result::success void    const [virtual]
 

Did the operation succeed?

Reimplemented from ACE_WIN32_Asynch_Result.

Definition at line 3467 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::success.

Referenced by complete.

03468 {
03469   return ACE_WIN32_Asynch_Result::success ();
03470 }


Friends And Related Function Documentation

friend class ACE_WIN32_Asynch_Write_Dgram [friend]
 

Factory class willl have special permissions.

Definition at line 1767 of file WIN32_Asynch_IO.h.

friend class ACE_WIN32_Proactor [friend]
 

Proactor class has special permission.

Reimplemented from ACE_WIN32_Asynch_Result.

Definition at line 1770 of file WIN32_Asynch_IO.h.


Member Data Documentation

size_t ACE_WIN32_Asynch_Write_Dgram_Result::bytes_to_write_ [protected]
 

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

Definition at line 1851 of file WIN32_Asynch_IO.h.

Referenced by bytes_to_write.

int ACE_WIN32_Asynch_Write_Dgram_Result::flags_ [protected]
 

The flags using in the write.

Definition at line 1857 of file WIN32_Asynch_IO.h.

Referenced by flags, and ACE_WIN32_Asynch_Write_Dgram::send.

ACE_HANDLE ACE_WIN32_Asynch_Write_Dgram_Result::handle_ [protected]
 

I/O handle used for writing.

Definition at line 1860 of file WIN32_Asynch_IO.h.

Referenced by handle.

ACE_Message_Block* ACE_WIN32_Asynch_Write_Dgram_Result::message_block_ [protected]
 

Message block used for the send.

Definition at line 1854 of file WIN32_Asynch_IO.h.

Referenced by complete, and message_block.


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