ACE_Handler Class Reference

This base class defines the interface for receiving the results of asynchronous operations. More...

#include <Asynch_IO.h>

Inheritance diagram for ACE_Handler:

Inheritance graph
[legend]
Collaboration diagram for ACE_Handler:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ACE_Refcounted_Auto_Ptr<
Proxy, ACE_SYNCH_MUTEX > 
Proxy_Ptr

Public Member Functions

 ACE_Handler (void)
 A do nothing constructor.

 ACE_Handler (ACE_Proactor *p)
 A do nothing constructor which allows proactor to be set to <p>.

virtual ~ACE_Handler (void)
 Virtual destruction.

virtual void handle_read_stream (const ACE_Asynch_Read_Stream::Result &result)
virtual void handle_write_dgram (const ACE_Asynch_Write_Dgram::Result &result)
virtual void handle_read_dgram (const ACE_Asynch_Read_Dgram::Result &result)
virtual void handle_write_stream (const ACE_Asynch_Write_Stream::Result &result)
virtual void handle_read_file (const ACE_Asynch_Read_File::Result &result)
virtual void handle_write_file (const ACE_Asynch_Write_File::Result &result)
virtual void handle_accept (const ACE_Asynch_Accept::Result &result)
 This method will be called when an asynchronous accept completes.

virtual void handle_connect (const ACE_Asynch_Connect::Result &result)
 This method will be called when an asynchronous connect completes.

virtual void handle_transmit_file (const ACE_Asynch_Transmit_File::Result &result)
virtual void handle_time_out (const ACE_Time_Value &tv, const void *act=0)
virtual void handle_wakeup (void)
ACE_Proactorproactor (void)
 Get the proactor associated with this handler.

void proactor (ACE_Proactor *p)
 Set the proactor.

virtual ACE_HANDLE handle (void) const
virtual void handle (ACE_HANDLE)
 Set the ACE_HANDLE value for this Handler.

Proxy_Ptrproxy (void)

Protected Attributes

ACE_Proactorproactor_
 The proactor associated with this handler.

ACE_HANDLE handle_
 The ACE_HANDLE in use with this handler.

ACE_Refcounted_Auto_Ptr< Proxy,
ACE_SYNCH_MUTEX > 
proxy_
 Refers to proxy for this handler.


Detailed Description

This base class defines the interface for receiving the results of asynchronous operations.

Subclasses of this class will fill in appropriate methods.

Definition at line 1513 of file Asynch_IO.h.


Member Typedef Documentation

typedef ACE_Refcounted_Auto_Ptr<Proxy, ACE_SYNCH_MUTEX> ACE_Handler::Proxy_Ptr
 

Definition at line 1606 of file Asynch_IO.h.

Referenced by ACE_POSIX_Asynch_Accept_Result::ACE_POSIX_Asynch_Accept_Result(), ACE_POSIX_Asynch_Connect_Result::ACE_POSIX_Asynch_Connect_Result(), ACE_POSIX_Asynch_Read_Dgram_Result::ACE_POSIX_Asynch_Read_Dgram_Result(), ACE_POSIX_Asynch_Read_File_Result::ACE_POSIX_Asynch_Read_File_Result(), ACE_POSIX_Asynch_Read_Stream_Result::ACE_POSIX_Asynch_Read_Stream_Result(), ACE_POSIX_Asynch_Result::ACE_POSIX_Asynch_Result(), ACE_POSIX_Asynch_Timer::ACE_POSIX_Asynch_Timer(), ACE_POSIX_Asynch_Transmit_File_Result::ACE_POSIX_Asynch_Transmit_File_Result(), ACE_POSIX_Asynch_Write_Dgram_Result::ACE_POSIX_Asynch_Write_Dgram_Result(), ACE_POSIX_Asynch_Write_File_Result::ACE_POSIX_Asynch_Write_File_Result(), ACE_POSIX_Asynch_Write_Stream_Result::ACE_POSIX_Asynch_Write_Stream_Result(), ACE_POSIX_Wakeup_Completion::ACE_POSIX_Wakeup_Completion(), ACE_WIN32_Asynch_Accept_Result::ACE_WIN32_Asynch_Accept_Result(), ACE_WIN32_Asynch_Connect_Result::ACE_WIN32_Asynch_Connect_Result(), ACE_WIN32_Asynch_Read_Dgram_Result::ACE_WIN32_Asynch_Read_Dgram_Result(), ACE_WIN32_Asynch_Read_File_Result::ACE_WIN32_Asynch_Read_File_Result(), ACE_WIN32_Asynch_Read_Stream_Result::ACE_WIN32_Asynch_Read_Stream_Result(), ACE_WIN32_Asynch_Result::ACE_WIN32_Asynch_Result(), ACE_WIN32_Asynch_Timer::ACE_WIN32_Asynch_Timer(), ACE_WIN32_Asynch_Transmit_File_Result::ACE_WIN32_Asynch_Transmit_File_Result(), ACE_WIN32_Asynch_Write_Dgram_Result::ACE_WIN32_Asynch_Write_Dgram_Result(), ACE_WIN32_Asynch_Write_File_Result::ACE_WIN32_Asynch_Write_File_Result(), ACE_WIN32_Asynch_Write_Stream_Result::ACE_WIN32_Asynch_Write_Stream_Result(), ACE_WIN32_Wakeup_Completion::ACE_WIN32_Wakeup_Completion(), ACE_WIN32_Proactor::create_asynch_accept_result(), ACE_Proactor::create_asynch_accept_result(), ACE_POSIX_Proactor::create_asynch_accept_result(), ACE_WIN32_Proactor::create_asynch_connect_result(), ACE_Proactor::create_asynch_connect_result(), ACE_POSIX_Proactor::create_asynch_connect_result(), ACE_WIN32_Proactor::create_asynch_read_dgram_result(), ACE_Proactor::create_asynch_read_dgram_result(), ACE_POSIX_Proactor::create_asynch_read_dgram_result(), ACE_WIN32_Proactor::create_asynch_read_file_result(), ACE_Proactor::create_asynch_read_file_result(), ACE_POSIX_Proactor::create_asynch_read_file_result(), ACE_WIN32_Proactor::create_asynch_read_stream_result(), ACE_Proactor::create_asynch_read_stream_result(), ACE_POSIX_Proactor::create_asynch_read_stream_result(), ACE_WIN32_Proactor::create_asynch_timer(), ACE_Proactor::create_asynch_timer(), ACE_POSIX_Proactor::create_asynch_timer(), ACE_WIN32_Proactor::create_asynch_transmit_file_result(), ACE_Proactor::create_asynch_transmit_file_result(), ACE_POSIX_Proactor::create_asynch_transmit_file_result(), ACE_WIN32_Proactor::create_asynch_write_dgram_result(), ACE_Proactor::create_asynch_write_dgram_result(), ACE_POSIX_Proactor::create_asynch_write_dgram_result(), ACE_WIN32_Proactor::create_asynch_write_file_result(), ACE_Proactor::create_asynch_write_file_result(), ACE_POSIX_Proactor::create_asynch_write_file_result(), ACE_WIN32_Proactor::create_asynch_write_stream_result(), ACE_Proactor::create_asynch_write_stream_result(), ACE_POSIX_Proactor::create_asynch_write_stream_result(), ACE_WIN32_Asynch_Write_Dgram::open(), ACE_WIN32_Asynch_Read_Dgram::open(), ACE_WIN32_Asynch_Transmit_File::open(), ACE_WIN32_Asynch_Connect::open(), ACE_WIN32_Asynch_Accept::open(), ACE_WIN32_Asynch_Write_File::open(), ACE_WIN32_Asynch_Read_File::open(), ACE_WIN32_Asynch_Write_Stream::open(), ACE_WIN32_Asynch_Read_Stream::open(), ACE_WIN32_Asynch_Operation::open(), ACE_POSIX_Asynch_Connect::open(), ACE_POSIX_Asynch_Accept::open(), and ACE_POSIX_Asynch_Operation::open().


Constructor & Destructor Documentation

ACE_Handler::ACE_Handler void   ) 
 

A do nothing constructor.

Definition at line 989 of file Asynch_IO.cpp.

References ACE_NEW, proxy_, and ACE_Refcounted_Auto_Ptr< Proxy, ACE_SYNCH_MUTEX >::reset().

00990   : proactor_ (0), handle_ (ACE_INVALID_HANDLE)
00991 {
00992   ACE_Handler::Proxy *p;
00993   ACE_NEW (p, ACE_Handler::Proxy (this));
00994   this->proxy_.reset (p);
00995 }

ACE_Handler::ACE_Handler ACE_Proactor p  ) 
 

A do nothing constructor which allows proactor to be set to <p>.

Definition at line 997 of file Asynch_IO.cpp.

References ACE_NEW, proxy_, and ACE_Refcounted_Auto_Ptr< Proxy, ACE_SYNCH_MUTEX >::reset().

00998   : proactor_ (d), handle_ (ACE_INVALID_HANDLE)
00999 {
01000   ACE_Handler::Proxy *p;
01001   ACE_NEW (p, ACE_Handler::Proxy (this));
01002   this->proxy_.reset (p);
01003 }

ACE_Handler::~ACE_Handler void   )  [virtual]
 

Virtual destruction.

Definition at line 1005 of file Asynch_IO.cpp.

References ACE_Refcounted_Auto_Ptr< Proxy, ACE_SYNCH_MUTEX >::get(), proxy_, and ACE_Handler::Proxy::reset().

01006 {
01007   ACE_Handler::Proxy *p = this->proxy_.get ();
01008   if (p)
01009     p->reset ();
01010 }


Member Function Documentation

void ACE_Handler::handle ACE_HANDLE   )  [virtual]
 

Set the ACE_HANDLE value for this Handler.

Reimplemented in ACE_Asynch_Acceptor< HANDLER >.

Definition at line 1087 of file Asynch_IO.cpp.

References handle_.

01088 {
01089   this->handle_ = h;
01090 }

ACE_HANDLE ACE_Handler::handle void   )  const [virtual]
 

Get the I/O handle used by this {handler}. This method will be called by the ACE_Asynch_* classes when an ACE_INVALID_HANDLE is passed to {open}.

Reimplemented in ACE_Asynch_Acceptor< HANDLER >.

Definition at line 1081 of file Asynch_IO.cpp.

References handle_.

Referenced by ACE_Asynch_Acceptor< HANDLER >::handle(), ACE_WIN32_Asynch_Operation::open(), and ACE_POSIX_Asynch_Operation::open().

01082 {
01083   return this->handle_;
01084 }

void ACE_Handler::handle_accept const ACE_Asynch_Accept::Result result  )  [virtual]
 

This method will be called when an asynchronous accept completes.

Reimplemented in ACE_Asynch_Acceptor< HANDLER >.

Definition at line 1033 of file Asynch_IO.cpp.

Referenced by ACE_WIN32_Asynch_Accept_Result::complete(), and ACE_POSIX_Asynch_Accept_Result::complete().

01034 {
01035 }

void ACE_Handler::handle_connect const ACE_Asynch_Connect::Result result  )  [virtual]
 

This method will be called when an asynchronous connect completes.

Reimplemented in ACE_Asynch_Connector< HANDLER >.

Definition at line 1038 of file Asynch_IO.cpp.

Referenced by ACE_WIN32_Asynch_Connect_Result::complete(), and ACE_POSIX_Asynch_Connect_Result::complete().

01039 {
01040 }

void ACE_Handler::handle_read_dgram const ACE_Asynch_Read_Dgram::Result result  )  [virtual]
 

This method will be called when an asynchronous read completes on a UDP socket.

Definition at line 1028 of file Asynch_IO.cpp.

Referenced by ACE_WIN32_Asynch_Read_Dgram_Result::complete(), and ACE_POSIX_Asynch_Read_Dgram_Result::complete().

01029 {
01030 }

void ACE_Handler::handle_read_file const ACE_Asynch_Read_File::Result result  )  [virtual]
 

This method will be called when an asynchronous read completes on a file.

Reimplemented in ACE_POSIX_Asynch_Transmit_Handler.

Definition at line 1048 of file Asynch_IO.cpp.

Referenced by ACE_WIN32_Asynch_Read_File_Result::complete(), and ACE_POSIX_Asynch_Read_File_Result::complete().

01049 {
01050 }

void ACE_Handler::handle_read_stream const ACE_Asynch_Read_Stream::Result result  )  [virtual]
 

This method will be called when an asynchronous read completes on a stream.

Reimplemented in ACE_AIOCB_Notify_Pipe_Manager.

Definition at line 1013 of file Asynch_IO.cpp.

Referenced by ACE_WIN32_Asynch_Read_Stream_Result::complete(), and ACE_POSIX_Asynch_Read_Stream_Result::complete().

01014 {
01015 }

void ACE_Handler::handle_time_out const ACE_Time_Value tv,
const void *  act = 0
[virtual]
 

Called when timer expires. {tv} was the requested time value and {act} is the ACT passed when scheduling the timer.

Definition at line 1058 of file Asynch_IO.cpp.

Referenced by ACE_WIN32_Asynch_Timer::complete(), and ACE_POSIX_Asynch_Timer::complete().

01060 {
01061 }

void ACE_Handler::handle_transmit_file const ACE_Asynch_Transmit_File::Result result  )  [virtual]
 

This method will be called when an asynchronous transmit file completes.

Definition at line 1043 of file Asynch_IO.cpp.

Referenced by ACE_WIN32_Asynch_Transmit_File_Result::complete(), and ACE_POSIX_Asynch_Transmit_File_Result::complete().

01044 {
01045 }

void ACE_Handler::handle_wakeup void   )  [virtual]
 

This is method works with the {run_event_loop} of the ACE_Proactor. A special {Wake_Up_Completion} is used to wake up all the threads that are blocking for completions.

Definition at line 1064 of file Asynch_IO.cpp.

Referenced by ACE_WIN32_Wakeup_Completion::complete(), and ACE_POSIX_Wakeup_Completion::complete().

01065 {
01066 }

void ACE_Handler::handle_write_dgram const ACE_Asynch_Write_Dgram::Result result  )  [virtual]
 

This method will be called when an asynchronous write completes on a UDP socket.

Definition at line 1023 of file Asynch_IO.cpp.

Referenced by ACE_WIN32_Asynch_Write_Dgram_Result::complete(), and ACE_POSIX_Asynch_Write_Dgram_Result::complete().

01024 {
01025 }

void ACE_Handler::handle_write_file const ACE_Asynch_Write_File::Result result  )  [virtual]
 

This method will be called when an asynchronous write completes on a file.

Definition at line 1053 of file Asynch_IO.cpp.

Referenced by ACE_WIN32_Asynch_Write_File_Result::complete(), and ACE_POSIX_Asynch_Write_File_Result::complete().

01054 {
01055 }

void ACE_Handler::handle_write_stream const ACE_Asynch_Write_Stream::Result result  )  [virtual]
 

This method will be called when an asynchronous write completes on a stream.

Reimplemented in ACE_POSIX_Asynch_Transmit_Handler.

Definition at line 1018 of file Asynch_IO.cpp.

Referenced by ACE_WIN32_Asynch_Write_Stream_Result::complete(), and ACE_POSIX_Asynch_Write_Stream_Result::complete().

01019 {
01020 }

void ACE_Handler::proactor ACE_Proactor p  ) 
 

Set the proactor.

Definition at line 1075 of file Asynch_IO.cpp.

References proactor_.

01076 {
01077   this->proactor_ = p;
01078 }

ACE_Proactor * ACE_Handler::proactor void   ) 
 

Get the proactor associated with this handler.

Definition at line 1069 of file Asynch_IO.cpp.

References proactor_.

Referenced by ACE_Asynch_Operation::get_proactor(), ACE_Asynch_Connector< HANDLER >::open(), and ACE_Asynch_Acceptor< HANDLER >::open().

01070 {
01071   return this->proactor_;
01072 }

ACE_Refcounted_Auto_Ptr< ACE_Handler::Proxy, ACE_SYNCH_MUTEX > & ACE_Handler::proxy void   ) 
 

Definition at line 1093 of file Asynch_IO.cpp.

References proxy_.

Referenced by ACE_Asynch_Operation::open(), and ACE_Proactor_Handle_Timeout_Upcall::timeout().

01094 {
01095   return this->proxy_;
01096 }


Member Data Documentation

ACE_HANDLE ACE_Handler::handle_ [protected]
 

The ACE_HANDLE in use with this handler.

Definition at line 1615 of file Asynch_IO.h.

Referenced by handle().

ACE_Proactor* ACE_Handler::proactor_ [protected]
 

The proactor associated with this handler.

Definition at line 1612 of file Asynch_IO.h.

Referenced by proactor().

ACE_Refcounted_Auto_Ptr<Proxy, ACE_SYNCH_MUTEX> ACE_Handler::proxy_ [protected]
 

Refers to proxy for this handler.

Definition at line 1618 of file Asynch_IO.h.

Referenced by ACE_Handler(), proxy(), and ~ACE_Handler().


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