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