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 Member Functions

size_t bytes_to_write (void) const
ACE_Message_Blockmessage_block (void) const
 Message block which contains the sent data.

int flags (void) const
 The flags using in the write.

ACE_HANDLE handle (void) const
 I/O handle used for writing.

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

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

int success (void) const
 Did the operation succeed?

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

ACE_HANDLE event (void) const
 Event associated with the OVERLAPPED structure.

u_long offset (void) const
 This really make sense only when doing file I/O.

u_long offset_high (void) const
 Offset_high associated with the OVERLAPPED structure.

int priority (void) const
int signal_number (void) const
 No-op. Returns 0.

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


Protected Member Functions

 ACE_WIN32_Asynch_Write_Dgram_Result (const ACE_Handler::Proxy_Ptr &handler_proxy, 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)
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.

virtual ~ACE_WIN32_Asynch_Write_Dgram_Result (void)
 Destructor.


Protected Attributes

size_t bytes_to_write_
ACE_Message_Blockmessage_block_
 Message block used for the send.

int flags_
 The flags using in the write.

ACE_HANDLE handle_
 I/O handle used for writing.


Friends

class ACE_WIN32_Asynch_Write_Dgram
 Factory class willl have special permissions.

class ACE_WIN32_Proactor
 Proactor class has special permission.


Detailed Description

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

Definition at line 1753 of file WIN32_Asynch_IO.h.


Constructor & Destructor Documentation

ACE_WIN32_Asynch_Write_Dgram_Result::ACE_WIN32_Asynch_Write_Dgram_Result const ACE_Handler::Proxy_Ptr handler_proxy,
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 3516 of file WIN32_Asynch_IO.cpp.

References ACE_Handler::Proxy_Ptr.

03526   : ACE_Asynch_Result_Impl (),
03527     ACE_Asynch_Write_Dgram_Result_Impl(),
03528     ACE_WIN32_Asynch_Result (handler_proxy,
03529                              act,
03530                              event,
03531                              0,
03532                              0,
03533                              priority,
03534                              signal_number),
03535     bytes_to_write_ (bytes_to_write),
03536     message_block_ (message_block),
03537     flags_ (flags),
03538     handle_ (handle)
03539 {
03540 }

ACE_WIN32_Asynch_Write_Dgram_Result::~ACE_WIN32_Asynch_Write_Dgram_Result void   )  [protected, virtual]
 

Destructor.

Definition at line 3578 of file WIN32_Asynch_IO.cpp.

03579 {
03580 }


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 3457 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::act().

03458 {
03459   return ACE_WIN32_Asynch_Result::act ();
03460 }

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 3427 of file WIN32_Asynch_IO.cpp.

03428 {
03429   return this->bytes_to_write_;
03430 }

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 3451 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::bytes_transferred().

03452 {
03453   return ACE_WIN32_Asynch_Result::bytes_transferred ();
03454 }

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 3543 of file WIN32_Asynch_IO.cpp.

References ACE_Message_Block::cont(), ACE_Refcounted_Auto_Ptr< X, ACE_LOCK >::get(), ACE_Handler::handle_write_dgram(), ACE_Message_Block::length(), and ACE_Message_Block::rd_ptr().

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

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 3469 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::completion_key().

03470 {
03471   return ACE_WIN32_Asynch_Result::completion_key ();
03472 }

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 3475 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::error().

03476 {
03477   return ACE_WIN32_Asynch_Result::error ();
03478 }

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 3481 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::event().

03482 {
03483   return ACE_WIN32_Asynch_Result::event ();
03484 }

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 3439 of file WIN32_Asynch_IO.cpp.

03440 {
03441   return this->flags_;
03442 }

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 3445 of file WIN32_Asynch_IO.cpp.

Referenced by ACE_WIN32_Asynch_Write_Dgram::send().

03446 {
03447   return this->handle_;
03448 }

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 3433 of file WIN32_Asynch_IO.cpp.

03434 {
03435   return this->message_block_;
03436 }

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 3487 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::offset().

03488 {
03489   return ACE_WIN32_Asynch_Result::offset ();
03490 }

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 3493 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::offset_high().

03494 {
03495   return ACE_WIN32_Asynch_Result::offset_high ();
03496 }

int ACE_WIN32_Asynch_Write_Dgram_Result::post_completion ACE_Proactor_Impl proactor  )  [virtual]
 

Post to the Proactor's completion port.

Reimplemented from ACE_WIN32_Asynch_Result.

Definition at line 3511 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::post_completion().

03512 {
03513   return ACE_WIN32_Asynch_Result::post_completion (proactor);
03514 }

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 3499 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::priority().

03500 {
03501   return ACE_WIN32_Asynch_Result::priority ();
03502 }

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 3505 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::signal_number().

03506 {
03507   return ACE_WIN32_Asynch_Result::signal_number ();
03508 }

int ACE_WIN32_Asynch_Write_Dgram_Result::success void   )  const [virtual]
 

Did the operation succeed?

Reimplemented from ACE_WIN32_Asynch_Result.

Definition at line 3463 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::success().

03464 {
03465   return ACE_WIN32_Asynch_Result::success ();
03466 }


Friends And Related Function Documentation

friend class ACE_WIN32_Asynch_Write_Dgram [friend]
 

Factory class willl have special permissions.

Definition at line 1757 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 1760 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 1841 of file WIN32_Asynch_IO.h.

int ACE_WIN32_Asynch_Write_Dgram_Result::flags_ [protected]
 

The flags using in the write.

Definition at line 1847 of file WIN32_Asynch_IO.h.

Referenced by 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 1850 of file WIN32_Asynch_IO.h.

ACE_Message_Block* ACE_WIN32_Asynch_Write_Dgram_Result::message_block_ [protected]
 

Message block used for the send.

Definition at line 1844 of file WIN32_Asynch_IO.h.


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 11:33:17 2006 for ACE by doxygen 1.3.6