ACE_POSIX_Proactor Class Reference

POSIX implementation of the Proactor. More...

#include <POSIX_Proactor.h>

Inheritance diagram for ACE_POSIX_Proactor:

Inheritance graph
[legend]
Collaboration diagram for ACE_POSIX_Proactor:

Collaboration graph
[legend]
List of all members.

Public Types

enum  Proactor_Type {
  PROACTOR_POSIX = 0, PROACTOR_AIOCB = 1, PROACTOR_SIG = 2, PROACTOR_SUN = 3,
  PROACTOR_CB = 4
}
enum  SystemType {
  ACE_OS_UNDEFINED = 0x0000, ACE_OS_WIN = 0x0100, ACE_OS_WIN_NT = ACE_OS_WIN | 0x0001, ACE_OS_WIN_2000 = ACE_OS_WIN | 0x0002,
  ACE_OS_SUN = 0x0200, ACE_OS_SUN_55 = ACE_OS_SUN | 0x0001, ACE_OS_SUN_56 = ACE_OS_SUN | 0x0002, ACE_OS_SUN_57 = ACE_OS_SUN | 0x0004,
  ACE_OS_SUN_58 = ACE_OS_SUN | 0x0008, ACE_OS_HPUX = 0x0400, ACE_OS_HPUX_11 = ACE_OS_HPUX | 0x0001, ACE_OS_LINUX = 0x0800,
  ACE_OS_FREEBSD = 0x1000, ACE_OS_IRIX = 0x2000, ACE_OS_OPENBSD = 0x4000
}
enum  Opcode { ACE_OPCODE_READ = 1, ACE_OPCODE_WRITE = 2 }

Public Member Functions

virtual Proactor_Type get_impl_type (void)
virtual ~ACE_POSIX_Proactor (void)
 Virtual destructor.

virtual int close (void)
 Close down the Proactor.

virtual int handle_events (ACE_Time_Value &wait_time)=0
virtual int handle_events (void)=0
virtual int post_completion (ACE_POSIX_Asynch_Result *result)=0
virtual int start_aio (ACE_POSIX_Asynch_Result *result, Opcode op)=0
virtual int cancel_aio (ACE_HANDLE h)=0
ACE_Asynch_Pseudo_Taskget_asynch_pseudo_task ()
 Task to process pseudo-asynchronous operations.

virtual int register_handle (ACE_HANDLE handle, const void *completion_key)
 This function is a no-op function for Unix systems. Returns 0.

int wake_up_dispatch_threads (void)
 This is a no-op on POSIX platforms. Returns 0.

int close_dispatch_threads (int wait)
 This is a no-op on POSIX platforms. Returns 0.

size_t number_of_threads (void) const
 This is a no-op on POSIX platforms. Returns 0.

void number_of_threads (size_t threads)
 Set number of thread used as a parameter to CreatIoCompletionPort.

virtual ACE_HANDLE get_handle (void) const
 This is a no-op in POSIX. Returns ACE_INVALID_HANDLE.

virtual ACE_Asynch_Read_Stream_Implcreate_asynch_read_stream (void)
 Create the correct implementation class for doing Asynch_Read_Stream.

virtual ACE_Asynch_Read_Stream_Result_Implcreate_asynch_read_stream_result (const ACE_Handler::Proxy_Ptr &handler_proxy, ACE_HANDLE handle, ACE_Message_Block &message_block, size_t bytes_to_read, const void *act, ACE_HANDLE event=ACE_INVALID_HANDLE, int priority=0, int signal_number=ACE_SIGRTMIN)
 Create the correct implementation class for ACE_Asynch_Read_Stream::Result class.

virtual ACE_Asynch_Write_Stream_Implcreate_asynch_write_stream (void)
 Create the correct implementation class for doing Asynch_Write_Stream.

virtual ACE_Asynch_Write_Stream_Result_Implcreate_asynch_write_stream_result (const ACE_Handler::Proxy_Ptr &handler_proxy, ACE_HANDLE handle, ACE_Message_Block &message_block, size_t bytes_to_write, const void *act, ACE_HANDLE event=ACE_INVALID_HANDLE, int priority=0, int signal_number=ACE_SIGRTMIN)
 Create the correct implementation class for ACE_Asynch_Write_Stream::Result.

virtual ACE_Asynch_Read_File_Implcreate_asynch_read_file (void)
 Create the correct implementation class for doing Asynch_Read_File.

virtual ACE_Asynch_Read_File_Result_Implcreate_asynch_read_file_result (const ACE_Handler::Proxy_Ptr &handler_proxy, ACE_HANDLE handle, ACE_Message_Block &message_block, size_t bytes_to_read, const void *act, u_long offset, u_long offset_high, ACE_HANDLE event=ACE_INVALID_HANDLE, int priority=0, int signal_number=ACE_SIGRTMIN)
 Create the correct implementation class for ACE_Asynch_Read_File::Result.

virtual ACE_Asynch_Write_File_Implcreate_asynch_write_file (void)
 Create the correct implementation class for doing Asynch_Write_File.

virtual ACE_Asynch_Write_File_Result_Implcreate_asynch_write_file_result (const ACE_Handler::Proxy_Ptr &handler_proxy, 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=ACE_INVALID_HANDLE, int priority=0, int signal_number=ACE_SIGRTMIN)
 Create the correct implementation class for ACE_Asynch_Write_File::Result.

virtual ACE_Asynch_Read_Dgram_Implcreate_asynch_read_dgram (void)
virtual ACE_Asynch_Read_Dgram_Result_Implcreate_asynch_read_dgram_result (const ACE_Handler::Proxy_Ptr &handler_proxy, ACE_HANDLE handle, ACE_Message_Block *message_block, size_t bytes_to_read, int flags, int protocol_family, const void *act, ACE_HANDLE event=ACE_INVALID_HANDLE, int priority=0, int signal_number=ACE_SIGRTMIN)
 Create the correct implementation class for ACE_Asynch_Read_Dgram::Result.

virtual ACE_Asynch_Write_Dgram_Implcreate_asynch_write_dgram (void)
virtual ACE_Asynch_Write_Dgram_Result_Implcreate_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=ACE_INVALID_HANDLE, int priority=0, int signal_number=ACE_SIGRTMIN)
 Create the correct implementation class for ACE_Asynch_Write_Dgram::Result.

virtual ACE_Asynch_Accept_Implcreate_asynch_accept (void)
 Create the correct implementation class for doing Asynch_Accept.

virtual ACE_Asynch_Accept_Result_Implcreate_asynch_accept_result (const ACE_Handler::Proxy_Ptr &handler_proxy, ACE_HANDLE listen_handle, ACE_HANDLE accept_handle, ACE_Message_Block &message_block, size_t bytes_to_read, const void *act, ACE_HANDLE event=ACE_INVALID_HANDLE, int priority=0, int signal_number=ACE_SIGRTMIN)
 Create the correct implementation class for ACE_Asynch_Accept::Result.

virtual ACE_Asynch_Connect_Implcreate_asynch_connect (void)
 Create the correct implementation class for doing Asynch_Connect.

virtual ACE_Asynch_Connect_Result_Implcreate_asynch_connect_result (const ACE_Handler::Proxy_Ptr &handler_proxy, ACE_HANDLE connect_handle, const void *act, ACE_HANDLE event=ACE_INVALID_HANDLE, int priority=0, int signal_number=ACE_SIGRTMIN)
 Create the correct implementation class for ACE_Asynch_Connect::Result.

virtual ACE_Asynch_Transmit_File_Implcreate_asynch_transmit_file (void)
 Create the correct implementation class for doing Asynch_Transmit_File.

virtual ACE_Asynch_Transmit_File_Result_Implcreate_asynch_transmit_file_result (const ACE_Handler::Proxy_Ptr &handler_proxy, ACE_HANDLE socket, ACE_HANDLE file, ACE_Asynch_Transmit_File::Header_And_Trailer *header_and_trailer, size_t bytes_to_write, u_long offset, u_long offset_high, size_t bytes_per_send, u_long flags, const void *act, ACE_HANDLE event=ACE_INVALID_HANDLE, int priority=0, int signal_number=ACE_SIGRTMIN)
 Create the correct implementation class for ACE_Asynch_Transmit_File::Result.

virtual ACE_Asynch_Result_Implcreate_asynch_timer (const ACE_Handler::Proxy_Ptr &handler_proxy, const void *act, const ACE_Time_Value &tv, ACE_HANDLE event=ACE_INVALID_HANDLE, int priority=0, int signal_number=ACE_SIGRTMIN)

Protected Member Functions

 ACE_POSIX_Proactor (void)
 Constructor.

void application_specific_code (ACE_POSIX_Asynch_Result *asynch_result, size_t bytes_transferred, const void *completion_key, u_long error)
virtual int post_wakeup_completions (int how_many)

Protected Attributes

ACE_Handler wakeup_handler_
int os_id_

Private Attributes

ACE_Asynch_Pseudo_Task pseudo_task_
 Task to process pseudo-asynchronous accept/connect.


Detailed Description

POSIX implementation of the Proactor.

There are two different strategies by which Proactor can get to know the completion of operations. One is based on Asynchronous I/O Control Blocks (AIOCB) where a list of AIOCBs are stored and completion status of the corresponding operations are queried on them. The other one is based on POSIX Real Time signals. This class abstracts out the common code needed for both the strategies. and specialize this class for each strategy.

Definition at line 55 of file POSIX_Proactor.h.


Member Enumeration Documentation

enum ACE_POSIX_Proactor::Opcode
 

Enumeration values:
ACE_OPCODE_READ 
ACE_OPCODE_WRITE 

Definition at line 96 of file POSIX_Proactor.h.

00096               {
00097     ACE_OPCODE_READ = 1,
00098     ACE_OPCODE_WRITE = 2
00099   };

enum ACE_POSIX_Proactor::Proactor_Type
 

Enumeration values:
PROACTOR_POSIX  Base class type.
PROACTOR_AIOCB  Aio_suspend() based.
PROACTOR_SIG  Signals notifications.
PROACTOR_SUN  SUN specific aiowait().
PROACTOR_CB  Callback notifications.

Definition at line 58 of file POSIX_Proactor.h.

00059   {
00060     /// Base class type
00061     PROACTOR_POSIX  = 0,
00062 
00063     /// Aio_suspend() based
00064     PROACTOR_AIOCB  = 1,
00065 
00066     /// Signals notifications
00067     PROACTOR_SIG    = 2,
00068 
00069     /// SUN specific aiowait()
00070     PROACTOR_SUN    = 3,
00071 
00072     /// Callback notifications
00073     PROACTOR_CB     = 4
00074   };

enum ACE_POSIX_Proactor::SystemType
 

Enumeration values:
ACE_OS_UNDEFINED 
ACE_OS_WIN 
ACE_OS_WIN_NT 
ACE_OS_WIN_2000 
ACE_OS_SUN 
ACE_OS_SUN_55 
ACE_OS_SUN_56 
ACE_OS_SUN_57 
ACE_OS_SUN_58 
ACE_OS_HPUX 
ACE_OS_HPUX_11 
ACE_OS_LINUX 
ACE_OS_FREEBSD 
ACE_OS_IRIX 
ACE_OS_OPENBSD 

Definition at line 77 of file POSIX_Proactor.h.

00078   {
00079     ACE_OS_UNDEFINED= 0x0000,
00080     ACE_OS_WIN      = 0x0100,          // for future
00081     ACE_OS_WIN_NT   = ACE_OS_WIN | 0x0001,
00082     ACE_OS_WIN_2000 = ACE_OS_WIN | 0x0002,
00083     ACE_OS_SUN      = 0x0200,          // Sun Solaris family
00084     ACE_OS_SUN_55   = ACE_OS_SUN | 0x0001,
00085     ACE_OS_SUN_56   = ACE_OS_SUN | 0x0002,
00086     ACE_OS_SUN_57   = ACE_OS_SUN | 0x0004,
00087     ACE_OS_SUN_58   = ACE_OS_SUN | 0x0008,
00088     ACE_OS_HPUX     = 0x0400,          // HPUX family
00089     ACE_OS_HPUX_11  = ACE_OS_HPUX | 0x0001,
00090     ACE_OS_LINUX    = 0x0800,          // Linux family
00091     ACE_OS_FREEBSD  = 0x1000,          // FreeBSD family
00092     ACE_OS_IRIX     = 0x2000,          // SGI IRIX family
00093     ACE_OS_OPENBSD  = 0x4000           // OpenBSD familty
00094   };


Constructor & Destructor Documentation

ACE_POSIX_Proactor::~ACE_POSIX_Proactor void   )  [virtual]
 

Virtual destructor.

Definition at line 100 of file POSIX_Proactor.cpp.

References close().

00101 {
00102   this->close ();
00103 }

ACE_POSIX_Proactor::ACE_POSIX_Proactor void   )  [protected]
 

Constructor.

Definition at line 61 of file POSIX_Proactor.cpp.

References ACE_OS_HPUX, ACE_OS_IRIX, ACE_OS_OPENBSD, ACE_OS_SUN, ACE_OS_SUN_56, ACE_OS_SUN_57, ACE_OS_SUN_58, os_id_, ACE_OS::strcasecmp(), and ACE_OS::sysinfo().

00062   :  os_id_ (ACE_OS_UNDEFINED)
00063 {
00064 #if defined(sun)
00065 
00066   os_id_ = ACE_OS_SUN; // set family
00067 
00068   char Buf [32];
00069 
00070   ::memset(Buf,0,sizeof(Buf));
00071 
00072   ACE_OS::sysinfo (SI_RELEASE , Buf, sizeof(Buf)-1);
00073 
00074   if (ACE_OS::strcasecmp (Buf , "5.6") == 0)
00075     os_id_ = ACE_OS_SUN_56;
00076   else if (ACE_OS::strcasecmp (Buf , "5.7") == 0)
00077     os_id_ = ACE_OS_SUN_57;
00078   else if (ACE_OS::strcasecmp (Buf , "5.8") == 0)
00079     os_id_ = ACE_OS_SUN_58;
00080 
00081 #elif defined(HPUX)
00082 
00083   os_id_ = ACE_OS_HPUX;   // set family
00084 
00085 #elif defined(__sgi)
00086 
00087   os_id_ = ACE_OS_IRIX;   // set family
00088 
00089 #elif defined(__OpenBSD)
00090 
00091   os_id_ = ACE_OS_OPENBSD; // set family
00092 
00093   // do the same
00094 
00095 //#else defined (LINUX, __FreeBSD__ ...)
00096 //setup here os_id_
00097 #endif
00098 }


Member Function Documentation

void ACE_POSIX_Proactor::application_specific_code ACE_POSIX_Asynch_Result asynch_result,
size_t  bytes_transferred,
const void *  completion_key,
u_long  error
[protected]
 

Protect against structured exceptions caused by user code when dispatching handles. The is not very useful compared to that can be associated each asynchronous operation. is implemented right now for the POSIX Proators.

Definition at line 557 of file POSIX_Proactor.cpp.

References ACE_SEH_FINALLY, ACE_SEH_TRY, and ACE_Asynch_Result_Impl::complete().

Referenced by ACE_POSIX_AIOCB_Proactor::handle_events_i(), and ACE_POSIX_CB_Proactor::handle_events_i().

00561 {
00562   ACE_SEH_TRY
00563     {
00564       // Call completion hook
00565       asynch_result->complete (bytes_transferred,
00566                                error ? 0 : 1,
00567                                0, // No completion key.
00568                                error);
00569     }
00570   ACE_SEH_FINALLY
00571     {
00572       // This is crucial to prevent memory leaks
00573       delete asynch_result;
00574     }
00575 }

virtual int ACE_POSIX_Proactor::cancel_aio ACE_HANDLE  h  )  [pure virtual]
 

Implemented in ACE_POSIX_AIOCB_Proactor.

Referenced by ACE_POSIX_Asynch_Operation::cancel().

int ACE_POSIX_Proactor::close void   )  [virtual]
 

Close down the Proactor.

Implements ACE_Proactor_Impl.

Reimplemented in ACE_POSIX_AIOCB_Proactor.

Definition at line 106 of file POSIX_Proactor.cpp.

Referenced by ~ACE_POSIX_Proactor().

00107 {
00108   return 0;
00109 }

int ACE_POSIX_Proactor::close_dispatch_threads int  wait  )  [virtual]
 

This is a no-op on POSIX platforms. Returns 0.

@

Implements ACE_Proactor_Impl.

Definition at line 127 of file POSIX_Proactor.cpp.

00128 {
00129   return 0;
00130 }

ACE_Asynch_Accept_Impl * ACE_POSIX_Proactor::create_asynch_accept void   )  [virtual]
 

Create the correct implementation class for doing Asynch_Accept.

Implements ACE_Proactor_Impl.

Definition at line 386 of file POSIX_Proactor.cpp.

References ACE_NEW_RETURN.

00387 {
00388   ACE_Asynch_Accept_Impl *implementation = 0;
00389   ACE_NEW_RETURN (implementation,
00390                   ACE_POSIX_Asynch_Accept (this),
00391                   0);
00392 
00393   return implementation;
00394 }

ACE_Asynch_Accept_Result_Impl * ACE_POSIX_Proactor::create_asynch_accept_result const ACE_Handler::Proxy_Ptr handler_proxy,
ACE_HANDLE  listen_handle,
ACE_HANDLE  accept_handle,
ACE_Message_Block message_block,
size_t  bytes_to_read,
const void *  act,
ACE_HANDLE  event = ACE_INVALID_HANDLE,
int  priority = 0,
int  signal_number = ACE_SIGRTMIN
[virtual]
 

Create the correct implementation class for ACE_Asynch_Accept::Result.

Implements ACE_Proactor_Impl.

Definition at line 398 of file POSIX_Proactor.cpp.

References ACE_NEW_RETURN, and ACE_Handler::Proxy_Ptr.

00407 {
00408   ACE_Asynch_Accept_Result_Impl *implementation;
00409   ACE_NEW_RETURN (implementation,
00410                   ACE_POSIX_Asynch_Accept_Result (handler_proxy,
00411                                                   listen_handle,
00412                                                   accept_handle,
00413                                                   message_block,
00414                                                   bytes_to_read,
00415                                                   act,
00416                                                   event,
00417                                                   priority,
00418                                                   signal_number),
00419                   0);
00420   return implementation;
00421 }

ACE_Asynch_Connect_Impl * ACE_POSIX_Proactor::create_asynch_connect void   )  [virtual]
 

Create the correct implementation class for doing Asynch_Connect.

Implements ACE_Proactor_Impl.

Definition at line 425 of file POSIX_Proactor.cpp.

References ACE_NEW_RETURN.

00426 {
00427   ACE_Asynch_Connect_Impl *implementation = 0;
00428   ACE_NEW_RETURN (implementation,
00429                   ACE_POSIX_Asynch_Connect (this),
00430                   0);
00431 
00432   return implementation;
00433 }

ACE_Asynch_Connect_Result_Impl * ACE_POSIX_Proactor::create_asynch_connect_result const ACE_Handler::Proxy_Ptr handler_proxy,
ACE_HANDLE  connect_handle,
const void *  act,
ACE_HANDLE  event = ACE_INVALID_HANDLE,
int  priority = 0,
int  signal_number = ACE_SIGRTMIN
[virtual]
 

Create the correct implementation class for ACE_Asynch_Connect::Result.

Implements ACE_Proactor_Impl.

Definition at line 437 of file POSIX_Proactor.cpp.

References ACE_NEW_RETURN, and ACE_Handler::Proxy_Ptr.

00443 {
00444   ACE_Asynch_Connect_Result_Impl *implementation;
00445   ACE_NEW_RETURN (implementation,
00446                   ACE_POSIX_Asynch_Connect_Result (handler_proxy,
00447                                                    connect_handle,
00448                                                    act,
00449                                                    event,
00450                                                    priority,
00451                                                    signal_number),
00452                   0);
00453   return implementation;
00454 }

ACE_Asynch_Read_Dgram_Impl * ACE_POSIX_Proactor::create_asynch_read_dgram void   )  [virtual]
 

Create the correct implementation class for doing Asynch_Read_Dgram.

Implements ACE_Proactor_Impl.

Definition at line 305 of file POSIX_Proactor.cpp.

References ACE_NEW_RETURN.

00306 {
00307     ACE_Asynch_Read_Dgram_Impl *implementation = 0;
00308     ACE_NEW_RETURN (implementation,
00309                     ACE_POSIX_Asynch_Read_Dgram (this),
00310                     0);
00311     return implementation;
00312 }

ACE_Asynch_Read_Dgram_Result_Impl * ACE_POSIX_Proactor::create_asynch_read_dgram_result const ACE_Handler::Proxy_Ptr handler_proxy,
ACE_HANDLE  handle,
ACE_Message_Block message_block,
size_t  bytes_to_read,
int  flags,
int  protocol_family,
const void *  act,
ACE_HANDLE  event = ACE_INVALID_HANDLE,
int  priority = 0,
int  signal_number = ACE_SIGRTMIN
[virtual]
 

Create the correct implementation class for ACE_Asynch_Read_Dgram::Result.

Implements ACE_Proactor_Impl.

Definition at line 316 of file POSIX_Proactor.cpp.

References ACE_NEW_RETURN, and ACE_Handler::Proxy_Ptr.

00326 {
00327   ACE_Asynch_Read_Dgram_Result_Impl *implementation=0;
00328   ACE_NEW_RETURN (implementation,
00329                   ACE_POSIX_Asynch_Read_Dgram_Result(handler_proxy,
00330                                                      handle,
00331                                                      message_block,
00332                                                      bytes_to_read,
00333                                                      flags,
00334                                                      protocol_family,
00335                                                      act,
00336                                                      event,
00337                                                      priority,
00338                                                      signal_number),
00339                   0);
00340 
00341   return implementation;
00342 }

ACE_Asynch_Read_File_Impl * ACE_POSIX_Proactor::create_asynch_read_file void   )  [virtual]
 

Create the correct implementation class for doing Asynch_Read_File.

Implements ACE_Proactor_Impl.

Definition at line 225 of file POSIX_Proactor.cpp.

References ACE_NEW_RETURN.

00226 {
00227   ACE_Asynch_Read_File_Impl *implementation = 0;
00228   ACE_NEW_RETURN (implementation,
00229                   ACE_POSIX_Asynch_Read_File (this),
00230                   0);
00231   return  implementation;
00232 }

ACE_Asynch_Read_File_Result_Impl * ACE_POSIX_Proactor::create_asynch_read_file_result const ACE_Handler::Proxy_Ptr handler_proxy,
ACE_HANDLE  handle,
ACE_Message_Block message_block,
size_t  bytes_to_read,
const void *  act,
u_long  offset,
u_long  offset_high,
ACE_HANDLE  event = ACE_INVALID_HANDLE,
int  priority = 0,
int  signal_number = ACE_SIGRTMIN
[virtual]
 

Create the correct implementation class for ACE_Asynch_Read_File::Result.

Implements ACE_Proactor_Impl.

Definition at line 236 of file POSIX_Proactor.cpp.

References ACE_NEW_RETURN, and ACE_Handler::Proxy_Ptr.

00246 {
00247   ACE_Asynch_Read_File_Result_Impl *implementation;
00248   ACE_NEW_RETURN (implementation,
00249                   ACE_POSIX_Asynch_Read_File_Result (handler_proxy,
00250                                                      handle,
00251                                                      message_block,
00252                                                      bytes_to_read,
00253                                                      act,
00254                                                      offset,
00255                                                      offset_high,
00256                                                      event,
00257                                                      priority,
00258                                                      signal_number),
00259                   0);
00260   return implementation;
00261 }

ACE_Asynch_Read_Stream_Impl * ACE_POSIX_Proactor::create_asynch_read_stream void   )  [virtual]
 

Create the correct implementation class for doing Asynch_Read_Stream.

Implements ACE_Proactor_Impl.

Definition at line 153 of file POSIX_Proactor.cpp.

References ACE_NEW_RETURN.

00154 {
00155   ACE_Asynch_Read_Stream_Impl *implementation = 0;
00156   ACE_NEW_RETURN (implementation,
00157                   ACE_POSIX_Asynch_Read_Stream (this),
00158                   0);
00159   return implementation;
00160 }

ACE_Asynch_Read_Stream_Result_Impl * ACE_POSIX_Proactor::create_asynch_read_stream_result const ACE_Handler::Proxy_Ptr handler_proxy,
ACE_HANDLE  handle,
ACE_Message_Block message_block,
size_t  bytes_to_read,
const void *  act,
ACE_HANDLE  event = ACE_INVALID_HANDLE,
int  priority = 0,
int  signal_number = ACE_SIGRTMIN
[virtual]
 

Create the correct implementation class for ACE_Asynch_Read_Stream::Result class.

Implements ACE_Proactor_Impl.

Definition at line 164 of file POSIX_Proactor.cpp.

References ACE_NEW_RETURN, and ACE_Handler::Proxy_Ptr.

00172 {
00173   ACE_Asynch_Read_Stream_Result_Impl *implementation;
00174   ACE_NEW_RETURN (implementation,
00175                   ACE_POSIX_Asynch_Read_Stream_Result (handler_proxy,
00176                                                        handle,
00177                                                        message_block,
00178                                                        bytes_to_read,
00179                                                        act,
00180                                                        event,
00181                                                        priority,
00182                                                        signal_number),
00183                   0);
00184   return implementation;
00185 }

ACE_Asynch_Result_Impl * ACE_POSIX_Proactor::create_asynch_timer const ACE_Handler::Proxy_Ptr handler_proxy,
const void *  act,
const ACE_Time_Value tv,
ACE_HANDLE  event = ACE_INVALID_HANDLE,
int  priority = 0,
int  signal_number = ACE_SIGRTMIN
[virtual]
 

Create a timer result object which can be used with the Timer mechanism of the Proactor.

Implements ACE_Proactor_Impl.

Definition at line 504 of file POSIX_Proactor.cpp.

References ACE_NEW_RETURN, and ACE_Handler::Proxy_Ptr.

00510 {
00511   ACE_POSIX_Asynch_Timer *implementation;
00512   ACE_NEW_RETURN (implementation,
00513                   ACE_POSIX_Asynch_Timer (handler_proxy,
00514                                           act,
00515                                           tv,
00516                                           event,
00517                                           priority,
00518                                           signal_number),
00519                   0);
00520   return implementation;
00521 }

ACE_Asynch_Transmit_File_Impl * ACE_POSIX_Proactor::create_asynch_transmit_file void   )  [virtual]
 

Create the correct implementation class for doing Asynch_Transmit_File.

Implements ACE_Proactor_Impl.

Definition at line 458 of file POSIX_Proactor.cpp.

References ACE_NEW_RETURN.

00459 {
00460   ACE_Asynch_Transmit_File_Impl *implementation = 0;
00461   ACE_NEW_RETURN (implementation,
00462                   ACE_POSIX_Asynch_Transmit_File (this),
00463                   0);
00464   return implementation;
00465 }

ACE_Asynch_Transmit_File_Result_Impl * ACE_POSIX_Proactor::create_asynch_transmit_file_result const ACE_Handler::Proxy_Ptr handler_proxy,
ACE_HANDLE  socket,
ACE_HANDLE  file,
ACE_Asynch_Transmit_File::Header_And_Trailer header_and_trailer,
size_t  bytes_to_write,
u_long  offset,
u_long  offset_high,
size_t  bytes_per_send,
u_long  flags,
const void *  act,
ACE_HANDLE  event = ACE_INVALID_HANDLE,
int  priority = 0,
int  signal_number = ACE_SIGRTMIN
[virtual]
 

Create the correct implementation class for ACE_Asynch_Transmit_File::Result.

Implements ACE_Proactor_Impl.

Definition at line 469 of file POSIX_Proactor.cpp.

References ACE_NEW_RETURN, and ACE_Handler::Proxy_Ptr.

00482 {
00483   ACE_Asynch_Transmit_File_Result_Impl *implementation;
00484   ACE_NEW_RETURN (implementation,
00485                   ACE_POSIX_Asynch_Transmit_File_Result (handler_proxy,
00486                                                          socket,
00487                                                          file,
00488                                                          header_and_trailer,
00489                                                          bytes_to_write,
00490                                                          offset,
00491                                                          offset_high,
00492                                                          bytes_per_send,
00493                                                          flags,
00494                                                          act,
00495                                                          event,
00496                                                          priority,
00497                                                          signal_number),
00498                   0);
00499   return implementation;
00500 }

ACE_Asynch_Write_Dgram_Impl * ACE_POSIX_Proactor::create_asynch_write_dgram void   )  [virtual]
 

Create the correct implementation class for doing Asynch_Write_Dgram.

Implements ACE_Proactor_Impl.

Definition at line 346 of file POSIX_Proactor.cpp.

References ACE_NEW_RETURN.

00347 {
00348         ACE_Asynch_Write_Dgram_Impl *implementation = 0;
00349         ACE_NEW_RETURN (implementation,
00350                         ACE_POSIX_Asynch_Write_Dgram (this),
00351                         0);
00352 
00353     return implementation;
00354 }

ACE_Asynch_Write_Dgram_Result_Impl * ACE_POSIX_Proactor::create_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 = ACE_INVALID_HANDLE,
int  priority = 0,
int  signal_number = ACE_SIGRTMIN
[virtual]
 

Create the correct implementation class for ACE_Asynch_Write_Dgram::Result.

Implements ACE_Proactor_Impl.

Definition at line 358 of file POSIX_Proactor.cpp.

References ACE_NEW_RETURN, and ACE_Handler::Proxy_Ptr.

00367 {
00368   ACE_Asynch_Write_Dgram_Result_Impl *implementation=0;
00369   ACE_NEW_RETURN (implementation,
00370                   ACE_POSIX_Asynch_Write_Dgram_Result(handler_proxy,
00371                                                       handle,
00372                                                       message_block,
00373                                                       bytes_to_write,
00374                                                       flags,
00375                                                       act,
00376                                                       event,
00377                                                       priority,
00378                                                       signal_number),
00379                   0);
00380 
00381   return implementation;
00382 }

ACE_Asynch_Write_File_Impl * ACE_POSIX_Proactor::create_asynch_write_file void   )  [virtual]
 

Create the correct implementation class for doing Asynch_Write_File.

Implements ACE_Proactor_Impl.

Definition at line 265 of file POSIX_Proactor.cpp.

References ACE_NEW_RETURN.

00266 {
00267   ACE_Asynch_Write_File_Impl *implementation = 0;
00268   ACE_NEW_RETURN (implementation,
00269                   ACE_POSIX_Asynch_Write_File (this),
00270                   0);
00271   return  implementation;
00272 }

ACE_Asynch_Write_File_Result_Impl * ACE_POSIX_Proactor::create_asynch_write_file_result const ACE_Handler::Proxy_Ptr handler_proxy,
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 = ACE_INVALID_HANDLE,
int  priority = 0,
int  signal_number = ACE_SIGRTMIN
[virtual]
 

Create the correct implementation class for ACE_Asynch_Write_File::Result.

Implements ACE_Proactor_Impl.

Definition at line 276 of file POSIX_Proactor.cpp.

References ACE_NEW_RETURN, and ACE_Handler::Proxy_Ptr.

00286 {
00287   ACE_Asynch_Write_File_Result_Impl *implementation;
00288   ACE_NEW_RETURN (implementation,
00289                   ACE_POSIX_Asynch_Write_File_Result (handler_proxy,
00290                                                       handle,
00291                                                       message_block,
00292                                                       bytes_to_write,
00293                                                       act,
00294                                                       offset,
00295                                                       offset_high,
00296                                                       event,
00297                                                       priority,
00298                                                       signal_number),
00299                   0);
00300   return implementation;
00301 }

ACE_Asynch_Write_Stream_Impl * ACE_POSIX_Proactor::create_asynch_write_stream void   )  [virtual]
 

Create the correct implementation class for doing Asynch_Write_Stream.

Implements ACE_Proactor_Impl.

Definition at line 189 of file POSIX_Proactor.cpp.

References ACE_NEW_RETURN.

00190 {
00191   ACE_Asynch_Write_Stream_Impl *implementation = 0;
00192   ACE_NEW_RETURN (implementation,
00193                   ACE_POSIX_Asynch_Write_Stream (this),
00194                   0);
00195   return implementation;
00196 }

ACE_Asynch_Write_Stream_Result_Impl * ACE_POSIX_Proactor::create_asynch_write_stream_result const ACE_Handler::Proxy_Ptr handler_proxy,
ACE_HANDLE  handle,
ACE_Message_Block message_block,
size_t  bytes_to_write,
const void *  act,
ACE_HANDLE  event = ACE_INVALID_HANDLE,
int  priority = 0,
int  signal_number = ACE_SIGRTMIN
[virtual]
 

Create the correct implementation class for ACE_Asynch_Write_Stream::Result.

Implements ACE_Proactor_Impl.

Definition at line 200 of file POSIX_Proactor.cpp.

References ACE_NEW_RETURN, and ACE_Handler::Proxy_Ptr.

00208 {
00209   ACE_Asynch_Write_Stream_Result_Impl *implementation;
00210   ACE_NEW_RETURN (implementation,
00211                   ACE_POSIX_Asynch_Write_Stream_Result (handler_proxy,
00212                                                         handle,
00213                                                         message_block,
00214                                                         bytes_to_write,
00215                                                         act,
00216                                                         event,
00217                                                         priority,
00218                                                         signal_number),
00219                   0);
00220   return implementation;
00221 }

ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE ACE_Asynch_Pseudo_Task & ACE_POSIX_Proactor::get_asynch_pseudo_task  ) 
 

Task to process pseudo-asynchronous operations.

Definition at line 8 of file POSIX_Proactor.inl.

References pseudo_task_.

Referenced by ACE_POSIX_Asynch_Accept::accept(), ACE_POSIX_AIOCB_Proactor::ACE_POSIX_AIOCB_Proactor(), ACE_POSIX_CB_Proactor::ACE_POSIX_CB_Proactor(), ACE_POSIX_Asynch_Connect::cancel(), ACE_POSIX_Asynch_Accept::cancel(), ACE_POSIX_AIOCB_Proactor::close(), ACE_POSIX_Asynch_Connect::close(), ACE_POSIX_Asynch_Accept::close(), ACE_POSIX_Asynch_Connect::connect(), ACE_POSIX_Asynch_Connect::handle_close(), ACE_POSIX_Asynch_Accept::handle_input(), ACE_POSIX_Asynch_Connect::handle_output(), and ACE_POSIX_Asynch_Accept::open().

00009 {
00010   return this->pseudo_task_;
00011 }

ACE_HANDLE ACE_POSIX_Proactor::get_handle void   )  const [virtual]
 

This is a no-op in POSIX. Returns ACE_INVALID_HANDLE.

Implements ACE_Proactor_Impl.

Definition at line 147 of file POSIX_Proactor.cpp.

Referenced by ACE_POSIX_Asynch_Read_Stream::read(), ACE_POSIX_Asynch_Read_Dgram::recv(), ACE_POSIX_Asynch_Write_Dgram::send(), ACE_POSIX_Asynch_Write_File::write(), and ACE_POSIX_Asynch_Write_Stream::write().

00148 {
00149   return ACE_INVALID_HANDLE;
00150 }

ACE_POSIX_Proactor::Proactor_Type ACE_POSIX_Proactor::get_impl_type void   )  [virtual]
 

Reimplemented in ACE_POSIX_CB_Proactor, and ACE_POSIX_AIOCB_Proactor.

Definition at line 596 of file POSIX_Proactor.cpp.

References PROACTOR_POSIX.

00597 {
00598   return PROACTOR_POSIX;
00599 }

virtual int ACE_POSIX_Proactor::handle_events void   )  [pure virtual]
 

Block indefinitely until at least one event is dispatched. Dispatch a single set of events.Return 1 on success i.e., when a completion is dispatched, non-zero (-1) on errors and errno is set accordingly.

Implements ACE_Proactor_Impl.

Implemented in ACE_POSIX_CB_Proactor, and ACE_POSIX_AIOCB_Proactor.

virtual int ACE_POSIX_Proactor::handle_events ACE_Time_Value wait_time  )  [pure virtual]
 

Dispatch a single set of events. If wait_time elapses before any events occur, return 0. Return 1 on success i.e., when a completion is dispatched, non-zero (-1) on errors and errno is set accordingly.

Implements ACE_Proactor_Impl.

Implemented in ACE_POSIX_CB_Proactor, and ACE_POSIX_AIOCB_Proactor.

void ACE_POSIX_Proactor::number_of_threads size_t  threads  )  [virtual]
 

Set number of thread used as a parameter to CreatIoCompletionPort.

Implements ACE_Proactor_Impl.

Definition at line 140 of file POSIX_Proactor.cpp.

00141 {
00142   // @@ Implement it.
00143   ACE_UNUSED_ARG (threads);
00144 }

size_t ACE_POSIX_Proactor::number_of_threads void   )  const [virtual]
 

This is a no-op on POSIX platforms. Returns 0.

@

Implements ACE_Proactor_Impl.

Definition at line 133 of file POSIX_Proactor.cpp.

References ACE_NOTSUP_RETURN.

00134 {
00135   // @@ Implement it.
00136   ACE_NOTSUP_RETURN (0);
00137 }

virtual int ACE_POSIX_Proactor::post_completion ACE_POSIX_Asynch_Result result  )  [pure virtual]
 

Post a result to the completion port of the Proactor. If errors occur, the result will be deleted by this method. If successful, the result will be deleted by the Proactor when the result is removed from the completion port. Therefore, the result should have been dynamically allocated and should be orphaned by the user once this method is called.

Implemented in ACE_POSIX_AIOCB_Proactor.

Referenced by ACE_POSIX_Asynch_Accept::cancel_uncompleted(), ACE_POSIX_Asynch_Accept::handle_input(), ACE_POSIX_Asynch_Result::post_completion(), ACE_POSIX_Asynch_Connect::post_result(), and post_wakeup_completions().

int ACE_POSIX_Proactor::post_wakeup_completions int  how_many  )  [protected, virtual]
 

Post completions to the completion port so that all threads can wake up. This is used in conjunction with the .

Implements ACE_Proactor_Impl.

Definition at line 578 of file POSIX_Proactor.cpp.

References ACE_NEW_RETURN, and post_completion().

00579 {
00580   ACE_POSIX_Wakeup_Completion *wakeup_completion = 0;
00581 
00582   for (int ci = 0; ci < how_many; ci++)
00583     {
00584       ACE_NEW_RETURN
00585         (wakeup_completion,
00586          ACE_POSIX_Wakeup_Completion (this->wakeup_handler_.proxy ()),
00587          -1);
00588       if (this->post_completion (wakeup_completion) == -1)
00589         return -1;
00590     }
00591 
00592   return 0;
00593 }

int ACE_POSIX_Proactor::register_handle ACE_HANDLE  handle,
const void *  completion_key
[virtual]
 

This function is a no-op function for Unix systems. Returns 0.

Implements ACE_Proactor_Impl.

Definition at line 112 of file POSIX_Proactor.cpp.

00114 {
00115   ACE_UNUSED_ARG (handle);
00116   ACE_UNUSED_ARG (completion_key);
00117   return 0;
00118 }

virtual int ACE_POSIX_Proactor::start_aio ACE_POSIX_Asynch_Result result,
Opcode  op
[pure virtual]
 

Referenced by ACE_POSIX_Asynch_Read_File::read(), ACE_POSIX_Asynch_Read_Stream::read(), ACE_POSIX_Asynch_Read_Dgram::recv(), ACE_POSIX_Asynch_Write_Dgram::send(), ACE_POSIX_Asynch_Write_File::write(), and ACE_POSIX_Asynch_Write_Stream::write().

int ACE_POSIX_Proactor::wake_up_dispatch_threads void   )  [virtual]
 

This is a no-op on POSIX platforms. Returns 0.

@

Implements ACE_Proactor_Impl.

Definition at line 121 of file POSIX_Proactor.cpp.

00122 {
00123   return 0;
00124 }


Member Data Documentation

int ACE_POSIX_Proactor::os_id_ [protected]
 

Definition at line 309 of file POSIX_Proactor.h.

Referenced by ACE_POSIX_Proactor().

ACE_Asynch_Pseudo_Task ACE_POSIX_Proactor::pseudo_task_ [private]
 

Task to process pseudo-asynchronous accept/connect.

Definition at line 313 of file POSIX_Proactor.h.

Referenced by get_asynch_pseudo_task().

ACE_Handler ACE_POSIX_Proactor::wakeup_handler_ [protected]
 

Handler to handle the wakeups. This works in conjunction with the <ACE_Proactor::run_event_loop>.

Definition at line 308 of file POSIX_Proactor.h.


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