00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef ACE_PROACTOR_IMPL_H
00016 #define ACE_PROACTOR_IMPL_H
00017 #include "ace/pre.h"
00018
00019 #include "ace/config-all.h"
00020
00021 #if ((defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) || (defined (ACE_HAS_AIO_CALLS)))
00022
00023
00024 #include "ace/OS.h"
00025
00026 #include "ace/Asynch_IO.h"
00027 #include "ace/Reactor.h"
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 class ACE_Export ACE_Proactor_Impl : public ACE_Event_Handler
00041 {
00042
00043 public:
00044
00045 virtual ~ACE_Proactor_Impl (void) {}
00046
00047
00048 virtual int close (void) = 0;
00049
00050
00051
00052 virtual int register_handle (ACE_HANDLE handle,
00053 const void *completion_key) = 0;
00054
00055
00056
00057
00058
00059
00060
00061 virtual int handle_events (ACE_Time_Value &wait_time) = 0;
00062
00063
00064
00065
00066
00067
00068
00069
00070 virtual int handle_events (void) = 0;
00071
00072
00073 virtual int wake_up_dispatch_threads (void) = 0;
00074
00075
00076 virtual int close_dispatch_threads (int wait) = 0;
00077
00078
00079 virtual size_t number_of_threads (void) const = 0;
00080
00081
00082 virtual void number_of_threads (size_t threads) = 0;
00083
00084
00085 virtual ACE_HANDLE get_handle (void) const = 0;
00086
00087
00088
00089
00090
00091
00092
00093
00094 virtual ACE_Asynch_Read_Stream_Impl *create_asynch_read_stream (void) = 0;
00095
00096
00097 virtual ACE_Asynch_Write_Stream_Impl *create_asynch_write_stream (void) = 0;
00098
00099
00100 virtual ACE_Asynch_Read_File_Impl *create_asynch_read_file (void) = 0;
00101
00102
00103 virtual ACE_Asynch_Write_File_Impl *create_asynch_write_file (void) = 0;
00104
00105
00106 virtual ACE_Asynch_Accept_Impl *create_asynch_accept (void) = 0;
00107
00108
00109 virtual ACE_Asynch_Connect_Impl *create_asynch_connect (void) = 0;
00110
00111
00112 virtual ACE_Asynch_Transmit_File_Impl *create_asynch_transmit_file (void) = 0;
00113
00114
00115
00116 virtual ACE_Asynch_Read_Dgram_Impl *create_asynch_read_dgram (void) = 0;
00117
00118
00119
00120 virtual ACE_Asynch_Write_Dgram_Impl *create_asynch_write_dgram (void) = 0;
00121
00122
00123
00124
00125
00126
00127
00128
00129 virtual ACE_Asynch_Read_Stream_Result_Impl *create_asynch_read_stream_result (ACE_Handler &handler,
00130 ACE_HANDLE handle,
00131 ACE_Message_Block &message_block,
00132 size_t bytes_to_read,
00133 const void* act,
00134 ACE_HANDLE event = ACE_INVALID_HANDLE,
00135 int priority = 0,
00136 int signal_number = ACE_SIGRTMIN) = 0;
00137
00138
00139 virtual ACE_Asynch_Write_Stream_Result_Impl *create_asynch_write_stream_result (ACE_Handler &handler,
00140 ACE_HANDLE handle,
00141 ACE_Message_Block &message_block,
00142 size_t bytes_to_write,
00143 const void* act,
00144 ACE_HANDLE event = ACE_INVALID_HANDLE,
00145 int priority = 0,
00146 int signal_number = ACE_SIGRTMIN) = 0;
00147
00148
00149 virtual ACE_Asynch_Read_File_Result_Impl *create_asynch_read_file_result (ACE_Handler &handler,
00150 ACE_HANDLE handle,
00151 ACE_Message_Block &message_block,
00152 size_t bytes_to_read,
00153 const void* act,
00154 u_long offset,
00155 u_long offset_high,
00156 ACE_HANDLE event = ACE_INVALID_HANDLE,
00157 int priority = 0,
00158 int signal_number = ACE_SIGRTMIN) = 0;
00159
00160
00161 virtual ACE_Asynch_Write_File_Result_Impl *create_asynch_write_file_result (ACE_Handler &handler,
00162 ACE_HANDLE handle,
00163 ACE_Message_Block &message_block,
00164 size_t bytes_to_write,
00165 const void* act,
00166 u_long offset,
00167 u_long offset_high,
00168 ACE_HANDLE event = ACE_INVALID_HANDLE,
00169 int priority = 0,
00170 int signal_number = ACE_SIGRTMIN) = 0;
00171
00172
00173 virtual ACE_Asynch_Read_Dgram_Result_Impl *create_asynch_read_dgram_result (ACE_Handler &handler,
00174 ACE_HANDLE handle,
00175 ACE_Message_Block *message_block,
00176 size_t bytes_to_read,
00177 int flags,
00178 int protocol_family,
00179 const void* act,
00180 ACE_HANDLE event = ACE_INVALID_HANDLE,
00181 int priority = 0,
00182 int signal_number = ACE_SIGRTMIN) = 0;
00183
00184
00185 virtual ACE_Asynch_Write_Dgram_Result_Impl *create_asynch_write_dgram_result (ACE_Handler &handler,
00186 ACE_HANDLE handle,
00187 ACE_Message_Block *message_block,
00188 size_t bytes_to_write,
00189 int flags,
00190 const void* act,
00191 ACE_HANDLE event = ACE_INVALID_HANDLE,
00192 int priority = 0,
00193 int signal_number = ACE_SIGRTMIN) = 0;
00194
00195
00196 virtual ACE_Asynch_Accept_Result_Impl *create_asynch_accept_result (ACE_Handler &handler,
00197 ACE_HANDLE listen_handle,
00198 ACE_HANDLE accept_handle,
00199 ACE_Message_Block &message_block,
00200 size_t bytes_to_read,
00201 const void* act,
00202 ACE_HANDLE event = ACE_INVALID_HANDLE,
00203 int priority = 0,
00204 int signal_number = ACE_SIGRTMIN) = 0;
00205
00206
00207 virtual ACE_Asynch_Connect_Result_Impl *create_asynch_connect_result (ACE_Handler &handler,
00208 ACE_HANDLE connect_handle,
00209 const void* act,
00210 ACE_HANDLE event = ACE_INVALID_HANDLE,
00211 int priority = 0,
00212 int signal_number = ACE_SIGRTMIN) = 0;
00213
00214
00215 virtual ACE_Asynch_Transmit_File_Result_Impl *create_asynch_transmit_file_result (ACE_Handler &handler,
00216 ACE_HANDLE socket,
00217 ACE_HANDLE file,
00218 ACE_Asynch_Transmit_File::Header_And_Trailer *header_and_trailer,
00219 size_t bytes_to_write,
00220 u_long offset,
00221 u_long offset_high,
00222 size_t bytes_per_send,
00223 u_long flags,
00224 const void *act,
00225 ACE_HANDLE event = ACE_INVALID_HANDLE,
00226 int priority = 0,
00227 int signal_number = ACE_SIGRTMIN) = 0;
00228
00229
00230
00231
00232
00233
00234 virtual ACE_Asynch_Result_Impl *create_asynch_timer (ACE_Handler &handler,
00235 const void *act,
00236 const ACE_Time_Value &tv,
00237 ACE_HANDLE event = ACE_INVALID_HANDLE,
00238 int priority = 0,
00239 int signal_number = 0) = 0;
00240
00241
00242
00243
00244
00245
00246 virtual int post_wakeup_completions (int how_many) = 0;
00247 };
00248
00249 #endif
00250 #include "ace/post.h"
00251 #endif