00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef ACE_ASYNCH_IO_IMPL_H
00024 #define ACE_ASYNCH_IO_IMPL_H
00025 #include "ace/pre.h"
00026
00027 #include "ace/config-all.h"
00028
00029 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00030 #pragma once
00031 #endif
00032
00033 #if (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) || (defined (ACE_HAS_AIO_CALLS))
00034
00035
00036
00037 #include "ace/Asynch_IO.h"
00038
00039 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00040
00041
00042 class ACE_Proactor_Impl;
00043
00044
00045
00046
00047
00048
00049
00050
00051 class ACE_Export ACE_Asynch_Result_Impl
00052 {
00053 public:
00054 virtual ~ACE_Asynch_Result_Impl (void);
00055
00056
00057 virtual size_t bytes_transferred (void) const = 0;
00058
00059
00060 virtual const void *act (void) const = 0;
00061
00062
00063 virtual int success (void) const = 0;
00064
00065
00066
00067 virtual const void *completion_key (void) const = 0;
00068
00069
00070 virtual u_long error (void) const = 0;
00071
00072
00073 virtual ACE_HANDLE event (void) const = 0;
00074
00075
00076 virtual u_long offset (void) const = 0;
00077 virtual u_long offset_high (void) const = 0;
00078
00079
00080 virtual int priority (void) const = 0;
00081
00082
00083
00084
00085
00086
00087
00088 virtual int signal_number (void) const = 0;
00089
00090
00091
00092
00093
00094
00095 virtual void complete (size_t bytes_transferred,
00096 int success,
00097 const void *completion_key,
00098 u_long error = 0) = 0;
00099
00100
00101 virtual int post_completion (ACE_Proactor_Impl *proactor) = 0;
00102
00103 protected:
00104
00105 ACE_Asynch_Result_Impl (void);
00106 };
00107
00108
00109
00110
00111
00112
00113
00114
00115 class ACE_Export ACE_Asynch_Operation_Impl
00116 {
00117 public:
00118 virtual ~ACE_Asynch_Operation_Impl (void);
00119
00120
00121
00122
00123
00124
00125
00126 virtual int open (const ACE_Handler::Proxy_Ptr &handler_proxy,
00127 ACE_HANDLE handle,
00128 const void *completion_key,
00129 ACE_Proactor *proactor) = 0;
00130
00131
00132
00133
00134
00135
00136 virtual int cancel (void) = 0;
00137
00138
00139
00140
00141 virtual ACE_Proactor* proactor (void) const = 0;
00142
00143 protected:
00144
00145 ACE_Asynch_Operation_Impl (void);
00146 };
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156 class ACE_Export ACE_Asynch_Read_Stream_Impl : public virtual ACE_Asynch_Operation_Impl
00157 {
00158 public:
00159 virtual ~ACE_Asynch_Read_Stream_Impl (void);
00160
00161
00162
00163 virtual int read (ACE_Message_Block &message_block,
00164 size_t bytes_to_read,
00165 const void *act,
00166 int priority,
00167 int signal_number) = 0;
00168
00169 #if (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE))
00170
00171
00172
00173
00174 virtual int readv (ACE_Message_Block &message_block,
00175 size_t bytes_to_read,
00176 const void *act,
00177 int priority,
00178 int signal_number) = 0;
00179 #endif
00180
00181 protected:
00182
00183 ACE_Asynch_Read_Stream_Impl (void);
00184 };
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194 class ACE_Export ACE_Asynch_Read_Stream_Result_Impl : public virtual ACE_Asynch_Result_Impl
00195 {
00196 public:
00197 virtual ~ACE_Asynch_Read_Stream_Result_Impl (void);
00198
00199
00200
00201 virtual size_t bytes_to_read (void) const = 0;
00202
00203
00204 virtual ACE_Message_Block &message_block (void) const = 0;
00205
00206
00207 virtual ACE_HANDLE handle (void) const = 0;
00208
00209 protected:
00210
00211 ACE_Asynch_Read_Stream_Result_Impl (void);
00212 };
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222 class ACE_Export ACE_Asynch_Write_Stream_Impl : public virtual ACE_Asynch_Operation_Impl
00223 {
00224 public:
00225 virtual ~ACE_Asynch_Write_Stream_Impl (void);
00226
00227
00228
00229 virtual int write (ACE_Message_Block &message_block,
00230 size_t bytes_to_write,
00231 const void *act,
00232 int priority,
00233 int signal_number) = 0;
00234
00235 #if (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE))
00236
00237
00238
00239
00240 virtual int writev (ACE_Message_Block &message_block,
00241 size_t bytes_to_write,
00242 const void *act,
00243 int priority,
00244 int signal_number) = 0;
00245 #endif
00246
00247 protected:
00248
00249 ACE_Asynch_Write_Stream_Impl (void);
00250 };
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260 class ACE_Export ACE_Asynch_Write_Stream_Result_Impl : public virtual ACE_Asynch_Result_Impl
00261 {
00262 public:
00263 virtual ~ACE_Asynch_Write_Stream_Result_Impl (void);
00264
00265
00266
00267 virtual size_t bytes_to_write (void) const = 0;
00268
00269
00270 virtual ACE_Message_Block &message_block (void) const = 0;
00271
00272
00273 virtual ACE_HANDLE handle (void) const = 0;
00274
00275 protected:
00276
00277 ACE_Asynch_Write_Stream_Result_Impl (void);
00278 };
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288 class ACE_Export ACE_Asynch_Read_File_Impl : public virtual ACE_Asynch_Read_Stream_Impl
00289 {
00290 public:
00291 virtual ~ACE_Asynch_Read_File_Impl (void);
00292
00293
00294
00295
00296
00297
00298 virtual int read (ACE_Message_Block &message_block,
00299 size_t bytes_to_read,
00300 u_long offset,
00301 u_long offset_high,
00302 const void *act,
00303 int priority,
00304 int signal_number) = 0;
00305
00306 #if (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE))
00307
00308
00309
00310
00311
00312
00313 virtual int readv (ACE_Message_Block &message_block,
00314 size_t bytes_to_read,
00315 u_long offset,
00316 u_long offset_high,
00317 const void *act,
00318 int priority,
00319 int signal_number) = 0;
00320 #endif
00321
00322
00323
00324 virtual int read (ACE_Message_Block &message_block,
00325 size_t bytes_to_read,
00326 const void *act,
00327 int priority,
00328 int signal_number) = 0;
00329
00330 #if (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE))
00331
00332
00333
00334
00335 virtual int readv (ACE_Message_Block &message_block,
00336 size_t bytes_to_read,
00337 const void *act,
00338 int priority,
00339 int signal_number) = 0;
00340 #endif
00341
00342 protected:
00343
00344 ACE_Asynch_Read_File_Impl (void);
00345 };
00346
00347
00348
00349
00350
00351
00352
00353
00354 class ACE_Export ACE_Asynch_Read_File_Result_Impl : public virtual ACE_Asynch_Read_Stream_Result_Impl
00355 {
00356 public:
00357
00358 virtual ~ACE_Asynch_Read_File_Result_Impl (void);
00359
00360 protected:
00361
00362 ACE_Asynch_Read_File_Result_Impl (void);
00363 };
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373 class ACE_Export ACE_Asynch_Write_File_Impl : public virtual ACE_Asynch_Write_Stream_Impl
00374 {
00375 public:
00376 virtual ~ACE_Asynch_Write_File_Impl (void);
00377
00378
00379
00380
00381
00382
00383 virtual int write (ACE_Message_Block &message_block,
00384 size_t bytes_to_write,
00385 u_long offset,
00386 u_long offset_high,
00387 const void *act,
00388 int priority,
00389 int signal_number) = 0;
00390
00391 #if (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE))
00392
00393
00394
00395
00396
00397
00398 virtual int writev (ACE_Message_Block &message_block,
00399 size_t bytes_to_write,
00400 u_long offset,
00401 u_long offset_high,
00402 const void *act,
00403 int priority,
00404 int signal_number) = 0;
00405 #endif
00406
00407
00408
00409 virtual int write (ACE_Message_Block &message_block,
00410 size_t bytes_to_write,
00411 const void *act,
00412 int priority,
00413 int signal_number) = 0;
00414
00415 #if (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE))
00416
00417
00418
00419
00420 virtual int writev (ACE_Message_Block &message_block,
00421 size_t bytes_to_write,
00422 const void *act,
00423 int priority,
00424 int signal_number) = 0;
00425 #endif
00426
00427 protected:
00428
00429 ACE_Asynch_Write_File_Impl (void);
00430 };
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440 class ACE_Export ACE_Asynch_Write_File_Result_Impl : public virtual ACE_Asynch_Write_Stream_Result_Impl
00441 {
00442 public:
00443 virtual ~ACE_Asynch_Write_File_Result_Impl (void);
00444
00445 protected:
00446
00447 ACE_Asynch_Write_File_Result_Impl (void);
00448 };
00449
00450
00451
00452
00453
00454
00455
00456
00457
00458 class ACE_Export ACE_Asynch_Accept_Impl : public virtual ACE_Asynch_Operation_Impl
00459 {
00460 public:
00461 virtual ~ACE_Asynch_Accept_Impl (void);
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474 virtual int accept (ACE_Message_Block &message_block,
00475 size_t bytes_to_read,
00476 ACE_HANDLE accept_handle,
00477 const void *act,
00478 int priority,
00479 int signal_number,
00480 int addr_family) = 0;
00481
00482 protected:
00483
00484 ACE_Asynch_Accept_Impl (void);
00485 };
00486
00487
00488
00489
00490
00491
00492
00493
00494
00495 class ACE_Export ACE_Asynch_Accept_Result_Impl : public virtual ACE_Asynch_Result_Impl
00496 {
00497 public:
00498 virtual ~ACE_Asynch_Accept_Result_Impl (void);
00499
00500
00501
00502 virtual size_t bytes_to_read (void) const = 0;
00503
00504
00505 virtual ACE_Message_Block &message_block (void) const = 0;
00506
00507
00508 virtual ACE_HANDLE listen_handle (void) const = 0;
00509
00510
00511 virtual ACE_HANDLE accept_handle (void) const = 0;
00512
00513 protected:
00514
00515 ACE_Asynch_Accept_Result_Impl (void);
00516 };
00517
00518
00519
00520
00521
00522
00523
00524
00525
00526
00527 class ACE_Export ACE_Asynch_Connect_Impl : public virtual ACE_Asynch_Operation_Impl
00528 {
00529 public:
00530 virtual ~ACE_Asynch_Connect_Impl (void);
00531
00532
00533
00534
00535 virtual int connect (ACE_HANDLE connect_handle,
00536 const ACE_Addr & remote_sap,
00537 const ACE_Addr & local_sap,
00538 int reuse_addr,
00539 const void *act,
00540 int priority,
00541 int signal_number) = 0;
00542
00543 protected:
00544
00545 ACE_Asynch_Connect_Impl (void);
00546 };
00547
00548
00549
00550
00551
00552
00553
00554
00555
00556 class ACE_Export ACE_Asynch_Connect_Result_Impl : public virtual ACE_Asynch_Result_Impl
00557 {
00558 public:
00559 virtual ~ACE_Asynch_Connect_Result_Impl (void);
00560
00561
00562 virtual ACE_HANDLE connect_handle (void) const = 0;
00563
00564 protected:
00565
00566 ACE_Asynch_Connect_Result_Impl (void);
00567 };
00568
00569
00570
00571
00572
00573
00574
00575
00576
00577
00578 class ACE_Asynch_Transmit_File_Impl : public virtual ACE_Asynch_Operation_Impl
00579 {
00580 public:
00581 virtual ~ACE_Asynch_Transmit_File_Impl (void);
00582
00583
00584 virtual int transmit_file (ACE_HANDLE file,
00585 ACE_Asynch_Transmit_File::Header_And_Trailer *header_and_trailer,
00586 size_t bytes_to_write,
00587 u_long offset,
00588 u_long offset_high,
00589 size_t bytes_per_send,
00590 u_long flags,
00591 const void *act,
00592 int priority,
00593 int signal_number) = 0;
00594
00595 protected:
00596
00597 ACE_Asynch_Transmit_File_Impl (void);
00598 };
00599
00600
00601
00602
00603
00604
00605
00606
00607
00608 class ACE_Export ACE_Asynch_Transmit_File_Result_Impl : public virtual ACE_Asynch_Result_Impl
00609 {
00610 public:
00611 virtual ~ACE_Asynch_Transmit_File_Result_Impl (void);
00612
00613
00614 virtual ACE_HANDLE socket (void) const = 0;
00615
00616
00617 virtual ACE_HANDLE file (void) const = 0;
00618
00619
00620 virtual ACE_Asynch_Transmit_File::Header_And_Trailer *header_and_trailer (void) const = 0;
00621
00622
00623
00624 virtual size_t bytes_to_write (void) const = 0;
00625
00626
00627
00628 virtual size_t bytes_per_send (void) const = 0;
00629
00630
00631 virtual u_long flags (void) const = 0;
00632
00633 protected:
00634
00635 ACE_Asynch_Transmit_File_Result_Impl (void);
00636 };
00637
00638
00639
00640
00641
00642
00643
00644
00645
00646
00647 class ACE_Export ACE_Asynch_Read_Dgram_Impl : public virtual ACE_Asynch_Operation_Impl
00648 {
00649 public:
00650 virtual ~ACE_Asynch_Read_Dgram_Impl (void);
00651
00652
00653
00654
00655
00656
00657
00658
00659
00660
00661
00662
00663
00664
00665
00666
00667
00668
00669
00670
00671
00672
00673
00674
00675
00676
00677
00678 virtual ssize_t recv (ACE_Message_Block *message_block,
00679 size_t &number_of_bytes_recvd,
00680 int flags,
00681 int protocol_family,
00682 const void *act,
00683 int priority,
00684 int signal_number) = 0;
00685
00686 protected:
00687
00688 ACE_Asynch_Read_Dgram_Impl (void);
00689 };
00690
00691
00692
00693
00694
00695
00696
00697
00698
00699 class ACE_Export ACE_Asynch_Read_Dgram_Result_Impl : public virtual ACE_Asynch_Result_Impl
00700 {
00701 public:
00702 virtual ~ACE_Asynch_Read_Dgram_Result_Impl (void);
00703
00704
00705 virtual ACE_Message_Block *message_block (void) const = 0;
00706
00707
00708
00709 virtual size_t bytes_to_read (void) const = 0;
00710
00711
00712 virtual int remote_address (ACE_Addr& addr) const = 0;
00713
00714
00715 virtual int flags (void) const = 0;
00716
00717
00718 virtual ACE_HANDLE handle (void) const = 0;
00719
00720 protected:
00721
00722 ACE_Asynch_Read_Dgram_Result_Impl (void);
00723 };
00724
00725
00726
00727
00728
00729
00730
00731
00732
00733 class ACE_Export ACE_Asynch_Write_Dgram_Impl : public virtual ACE_Asynch_Operation_Impl
00734 {
00735 public:
00736 virtual ~ACE_Asynch_Write_Dgram_Impl (void);
00737
00738
00739
00740
00741
00742
00743
00744
00745
00746
00747
00748
00749
00750
00751
00752
00753
00754
00755
00756
00757
00758
00759
00760
00761
00762
00763
00764 virtual ssize_t send (ACE_Message_Block *message_block,
00765 size_t &number_of_bytes_sent,
00766 int flags,
00767 const ACE_Addr &addr,
00768 const void *act,
00769 int priority,
00770 int signal_number) = 0;
00771
00772 protected:
00773
00774 ACE_Asynch_Write_Dgram_Impl (void);
00775 };
00776
00777
00778
00779
00780
00781
00782
00783
00784
00785 class ACE_Export ACE_Asynch_Write_Dgram_Result_Impl : public virtual ACE_Asynch_Result_Impl
00786 {
00787 public:
00788 virtual ~ACE_Asynch_Write_Dgram_Result_Impl (void);
00789
00790
00791
00792 virtual size_t bytes_to_write (void) const = 0;
00793
00794
00795 virtual ACE_Message_Block *message_block (void) const = 0;
00796
00797
00798 virtual int flags (void) const = 0;
00799
00800
00801 virtual ACE_HANDLE handle (void) const = 0;
00802
00803 protected:
00804
00805 ACE_Asynch_Write_Dgram_Result_Impl (void);
00806 };
00807
00808 ACE_END_VERSIONED_NAMESPACE_DECL
00809
00810 #if defined (__ACE_INLINE__)
00811 #include "ace/Asynch_IO_Impl.inl"
00812 #endif
00813
00814 #endif
00815 #include "ace/post.h"
00816 #endif