00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #ifndef ACE_CDR_STREAM_H
00041 #define ACE_CDR_STREAM_H
00042
00043 #include "ace/pre.h"
00044
00045 #include "ace/CDR_Base.h"
00046
00047 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00048 # pragma once
00049 #endif
00050
00051 #include "ace/SStringfwd.h"
00052 #include "ace/Message_Block.h"
00053
00054 #if defined (GEN_OSTREAM_OPS)
00055 #include "ace/streams.h"
00056 #endif
00057
00058 #if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1)
00059 #include "Monitor_Size.h"
00060 #endif
00061
00062
00063 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00064
00065 class ACE_Char_Codeset_Translator;
00066 class ACE_WChar_Codeset_Translator;
00067
00068 class ACE_InputCDR;
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084 class ACE_Export ACE_OutputCDR
00085 {
00086 public:
00087
00088
00089
00090
00091
00092 friend class ACE_Char_Codeset_Translator;
00093 friend class ACE_WChar_Codeset_Translator;
00094 friend class ACE_InputCDR;
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113 ACE_OutputCDR (size_t size = 0,
00114 int byte_order = ACE_CDR::BYTE_ORDER_NATIVE,
00115 ACE_Allocator* buffer_allocator = 0,
00116 ACE_Allocator* data_block_allocator = 0,
00117 ACE_Allocator* message_block_allocator = 0,
00118 size_t memcpy_tradeoff = ACE_DEFAULT_CDR_MEMCPY_TRADEOFF,
00119 ACE_CDR::Octet major_version = ACE_CDR_GIOP_MAJOR_VERSION,
00120 ACE_CDR::Octet minor_version = ACE_CDR_GIOP_MINOR_VERSION);
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133 ACE_OutputCDR (char *data,
00134 size_t size,
00135 int byte_order = ACE_CDR::BYTE_ORDER_NATIVE,
00136 ACE_Allocator* buffer_allocator = 0,
00137 ACE_Allocator* data_block_allocator = 0,
00138 ACE_Allocator* message_block_allocator = 0,
00139 size_t memcpy_tradeoff = ACE_DEFAULT_CDR_MEMCPY_TRADEOFF,
00140 ACE_CDR::Octet giop_major_version = ACE_CDR_GIOP_MAJOR_VERSION,
00141 ACE_CDR::Octet giop_minor_version = ACE_CDR_GIOP_MINOR_VERSION);
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154 ACE_OutputCDR (ACE_Data_Block *data_block,
00155 int byte_order = ACE_CDR::BYTE_ORDER_NATIVE,
00156 ACE_Allocator* message_block_allocator = 0,
00157 size_t memcpy_tradeoff = ACE_DEFAULT_CDR_MEMCPY_TRADEOFF,
00158 ACE_CDR::Octet giop_major_version = ACE_CDR_GIOP_MAJOR_VERSION,
00159 ACE_CDR::Octet giop_minor_version = ACE_CDR_GIOP_MINOR_VERSION);
00160
00161
00162
00163 ACE_OutputCDR (ACE_Message_Block *data,
00164 int byte_order = ACE_CDR::BYTE_ORDER_NATIVE,
00165 size_t memcpy_tradeoff = ACE_DEFAULT_CDR_MEMCPY_TRADEOFF,
00166 ACE_CDR::Octet giop_major_version = ACE_CDR_GIOP_MAJOR_VERSION,
00167 ACE_CDR::Octet giop_minor_version = ACE_CDR_GIOP_MINOR_VERSION);
00168
00169
00170 ~ACE_OutputCDR (void);
00171
00172
00173
00174
00175
00176
00177
00178 struct ACE_Export from_boolean
00179 {
00180 explicit from_boolean (ACE_CDR::Boolean b);
00181 ACE_CDR::Boolean val_;
00182 };
00183
00184 struct ACE_Export from_octet
00185 {
00186 explicit from_octet (ACE_CDR::Octet o);
00187 ACE_CDR::Octet val_;
00188 };
00189
00190 struct ACE_Export from_char
00191 {
00192 explicit from_char (ACE_CDR::Char c);
00193 ACE_CDR::Char val_;
00194 };
00195
00196 struct ACE_Export from_wchar
00197 {
00198 explicit from_wchar (ACE_CDR::WChar wc);
00199 ACE_CDR::WChar val_;
00200 };
00201
00202 struct ACE_Export from_string
00203 {
00204 from_string (ACE_CDR::Char* s,
00205 ACE_CDR::ULong b,
00206 ACE_CDR::Boolean nocopy = 0);
00207 from_string (const ACE_CDR::Char* s,
00208 ACE_CDR::ULong b,
00209 ACE_CDR::Boolean nocopy = 0);
00210 ACE_CDR::Char *val_;
00211 ACE_CDR::ULong bound_;
00212 ACE_CDR::Boolean nocopy_;
00213 };
00214
00215 struct ACE_Export from_wstring
00216 {
00217 from_wstring (ACE_CDR::WChar* ws,
00218 ACE_CDR::ULong b,
00219 ACE_CDR::Boolean nocopy = 0);
00220 from_wstring (const ACE_CDR::WChar* ws,
00221 ACE_CDR::ULong b,
00222 ACE_CDR::Boolean nocopy = 0);
00223 ACE_CDR::WChar *val_;
00224 ACE_CDR::ULong bound_;
00225 ACE_CDR::Boolean nocopy_;
00226 };
00227
00228
00229
00230
00231
00232
00233 ACE_CDR::Boolean write_boolean (ACE_CDR::Boolean x);
00234 ACE_CDR::Boolean write_char (ACE_CDR::Char x);
00235 ACE_CDR::Boolean write_wchar (ACE_CDR::WChar x);
00236 ACE_CDR::Boolean write_octet (ACE_CDR::Octet x);
00237 ACE_CDR::Boolean write_short (ACE_CDR::Short x);
00238 ACE_CDR::Boolean write_ushort (ACE_CDR::UShort x);
00239 ACE_CDR::Boolean write_long (ACE_CDR::Long x);
00240 ACE_CDR::Boolean write_ulong (ACE_CDR::ULong x);
00241 ACE_CDR::Boolean write_longlong (const ACE_CDR::LongLong &x);
00242 ACE_CDR::Boolean write_ulonglong (const ACE_CDR::ULongLong &x);
00243 ACE_CDR::Boolean write_float (ACE_CDR::Float x);
00244 ACE_CDR::Boolean write_double (const ACE_CDR::Double &x);
00245 ACE_CDR::Boolean write_longdouble (const ACE_CDR::LongDouble &x);
00246
00247
00248 ACE_CDR::Boolean write_string (const ACE_CDR::Char *x);
00249 ACE_CDR::Boolean write_string (ACE_CDR::ULong len,
00250 const ACE_CDR::Char *x);
00251 ACE_CDR::Boolean write_string (const ACE_CString &x);
00252 ACE_CDR::Boolean write_wstring (const ACE_CDR::WChar *x);
00253 ACE_CDR::Boolean write_wstring (ACE_CDR::ULong length,
00254 const ACE_CDR::WChar *x);
00255
00256
00257
00258
00259
00260
00261 ACE_CDR::Boolean write_boolean_array (const ACE_CDR::Boolean *x,
00262 ACE_CDR::ULong length);
00263 ACE_CDR::Boolean write_char_array (const ACE_CDR::Char *x,
00264 ACE_CDR::ULong length);
00265 ACE_CDR::Boolean write_wchar_array (const ACE_CDR::WChar* x,
00266 ACE_CDR::ULong length);
00267 ACE_CDR::Boolean write_octet_array (const ACE_CDR::Octet* x,
00268 ACE_CDR::ULong length);
00269 ACE_CDR::Boolean write_short_array (const ACE_CDR::Short *x,
00270 ACE_CDR::ULong length);
00271 ACE_CDR::Boolean write_ushort_array (const ACE_CDR::UShort *x,
00272 ACE_CDR::ULong length);
00273 ACE_CDR::Boolean write_long_array (const ACE_CDR::Long *x,
00274 ACE_CDR::ULong length);
00275 ACE_CDR::Boolean write_ulong_array (const ACE_CDR::ULong *x,
00276 ACE_CDR::ULong length);
00277 ACE_CDR::Boolean write_longlong_array (const ACE_CDR::LongLong* x,
00278 ACE_CDR::ULong length);
00279 ACE_CDR::Boolean write_ulonglong_array (const ACE_CDR::ULongLong *x,
00280 ACE_CDR::ULong length);
00281 ACE_CDR::Boolean write_float_array (const ACE_CDR::Float *x,
00282 ACE_CDR::ULong length);
00283 ACE_CDR::Boolean write_double_array (const ACE_CDR::Double *x,
00284 ACE_CDR::ULong length);
00285 ACE_CDR::Boolean write_longdouble_array (const ACE_CDR::LongDouble* x,
00286 ACE_CDR::ULong length);
00287
00288
00289
00290 ACE_CDR::Boolean write_octet_array_mb (const ACE_Message_Block* mb);
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319 char* write_long_placeholder (void);
00320 char* write_short_placeholder (void);
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338 ACE_CDR::Boolean replace (ACE_CDR::Long x, char* loc);
00339 ACE_CDR::Boolean replace (ACE_CDR::Short x, char* loc);
00340
00341
00342
00343
00344
00345
00346 ACE_CDR::Boolean append_boolean (ACE_InputCDR &);
00347 ACE_CDR::Boolean append_char (ACE_InputCDR &);
00348 ACE_CDR::Boolean append_wchar (ACE_InputCDR &);
00349 ACE_CDR::Boolean append_octet (ACE_InputCDR &);
00350 ACE_CDR::Boolean append_short (ACE_InputCDR &);
00351 ACE_CDR::Boolean append_ushort (ACE_InputCDR &);
00352 ACE_CDR::Boolean append_long (ACE_InputCDR &);
00353 ACE_CDR::Boolean append_ulong (ACE_InputCDR &);
00354 ACE_CDR::Boolean append_longlong (ACE_InputCDR &);
00355 ACE_CDR::Boolean append_ulonglong (ACE_InputCDR &);
00356 ACE_CDR::Boolean append_float (ACE_InputCDR &);
00357 ACE_CDR::Boolean append_double (ACE_InputCDR &);
00358 ACE_CDR::Boolean append_longdouble (ACE_InputCDR &);
00359
00360 ACE_CDR::Boolean append_wstring (ACE_InputCDR &);
00361 ACE_CDR::Boolean append_string (ACE_InputCDR &);
00362
00363
00364
00365
00366
00367
00368 bool good_bit (void) const;
00369
00370
00371 void reset (void);
00372
00373
00374 size_t total_length (void) const;
00375
00376
00377
00378
00379
00380
00381 const ACE_Message_Block *begin (void) const;
00382
00383
00384 const ACE_Message_Block *end (void) const;
00385
00386
00387 const ACE_Message_Block *current (void) const;
00388
00389
00390
00391
00392
00393
00394
00395
00396 int consolidate (void);
00397
00398
00399
00400
00401
00402
00403 const char *buffer (void) const;
00404
00405
00406
00407
00408
00409
00410 size_t length (void) const;
00411
00412
00413
00414
00415
00416
00417
00418 int align_write_ptr (size_t alignment);
00419
00420
00421 ACE_Char_Codeset_Translator *char_translator (void) const;
00422 ACE_WChar_Codeset_Translator *wchar_translator (void) const;
00423
00424
00425 void char_translator (ACE_Char_Codeset_Translator *);
00426
00427 void wchar_translator (ACE_WChar_Codeset_Translator *);
00428
00429
00430
00431 static void wchar_maxbytes (size_t max_bytes);
00432
00433
00434 static size_t wchar_maxbytes (void);
00435
00436
00437
00438
00439
00440
00441 size_t current_alignment (void) const;
00442
00443 void current_alignment (size_t current_alignment);
00444
00445
00446
00447
00448
00449
00450
00451 int adjust (size_t size,
00452 char *&buf);
00453
00454
00455
00456 int adjust (size_t size,
00457 size_t align,
00458 char *&buf);
00459
00460
00461
00462
00463
00464 bool do_byte_swap (void) const;
00465
00466
00467
00468 int byte_order (void) const;
00469
00470
00471
00472
00473
00474 void reset_byte_order (int byte_order);
00475
00476
00477 void set_version (ACE_CDR::Octet major, ACE_CDR::Octet minor);
00478
00479
00480 void get_version (ACE_CDR::Octet &major, ACE_CDR::Octet &minor);
00481
00482 #if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1)
00483
00484 void register_monitor (const char* id);
00485 void unregister_monitor (void);
00486 #endif
00487
00488 private:
00489
00490
00491
00492 ACE_Message_Block* find (char* loc);
00493
00494
00495 ACE_OutputCDR (const ACE_OutputCDR& rhs);
00496 ACE_OutputCDR& operator= (const ACE_OutputCDR& rhs);
00497
00498 ACE_CDR::Boolean write_1 (const ACE_CDR::Octet *x);
00499 ACE_CDR::Boolean write_2 (const ACE_CDR::UShort *x);
00500 ACE_CDR::Boolean write_4 (const ACE_CDR::ULong *x);
00501 ACE_CDR::Boolean write_8 (const ACE_CDR::ULongLong *x);
00502 ACE_CDR::Boolean write_16 (const ACE_CDR::LongDouble *x);
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516 ACE_CDR::Boolean write_array (const void *x,
00517 size_t size,
00518 size_t align,
00519 ACE_CDR::ULong length);
00520
00521
00522 ACE_CDR::Boolean write_wchar_array_i (const ACE_CDR::WChar* x,
00523 ACE_CDR::ULong length);
00524
00525
00526
00527
00528
00529
00530
00531
00532 int grow_and_adjust (size_t size,
00533 size_t align,
00534 char *&buf);
00535
00536 private:
00537
00538 ACE_Message_Block start_;
00539
00540
00541 ACE_Message_Block *current_;
00542
00543 #if !defined (ACE_LACKS_CDR_ALIGNMENT)
00544
00545
00546
00547
00548
00549
00550
00551
00552 size_t current_alignment_;
00553 #endif
00554
00555
00556
00557
00558
00559
00560
00561 bool current_is_writable_;
00562
00563
00564
00565
00566
00567
00568
00569
00570
00571
00572 bool do_byte_swap_;
00573
00574
00575 bool good_bit_;
00576
00577
00578 size_t const memcpy_tradeoff_;
00579
00580 #if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1)
00581 ACE::Monitor_Control::Size_Monitor *monitor_;
00582 #endif
00583
00584 protected:
00585
00586 ACE_CDR::Octet major_version_;
00587 ACE_CDR::Octet minor_version_;
00588
00589
00590 ACE_Char_Codeset_Translator *char_translator_;
00591 ACE_WChar_Codeset_Translator *wchar_translator_;
00592
00593
00594
00595
00596
00597
00598
00599
00600
00601
00602 static size_t wchar_maxbytes_;
00603 };
00604
00605
00606
00607
00608
00609
00610
00611
00612
00613
00614
00615
00616
00617
00618
00619
00620
00621
00622
00623 class ACE_Export ACE_InputCDR
00624 {
00625 public:
00626
00627
00628 friend class ACE_Char_Codeset_Translator;
00629 friend class ACE_WChar_Codeset_Translator;
00630
00631
00632
00633
00634
00635
00636
00637
00638 ACE_InputCDR (const char *buf,
00639 size_t bufsiz,
00640 int byte_order = ACE_CDR::BYTE_ORDER_NATIVE,
00641 ACE_CDR::Octet major_version = ACE_CDR_GIOP_MAJOR_VERSION,
00642 ACE_CDR::Octet minor_version = ACE_CDR_GIOP_MINOR_VERSION);
00643
00644
00645
00646 ACE_InputCDR (size_t bufsiz,
00647 int byte_order = ACE_CDR::BYTE_ORDER_NATIVE,
00648 ACE_CDR::Octet major_version = ACE_CDR_GIOP_MAJOR_VERSION,
00649 ACE_CDR::Octet minor_version = ACE_CDR_GIOP_MINOR_VERSION);
00650
00651
00652
00653
00654
00655
00656
00657
00658
00659 ACE_InputCDR (const ACE_Message_Block *data,
00660 int byte_order = ACE_CDR::BYTE_ORDER_NATIVE,
00661 ACE_CDR::Octet major_version = ACE_CDR_GIOP_MAJOR_VERSION,
00662 ACE_CDR::Octet minor_version = ACE_CDR_GIOP_MINOR_VERSION,
00663 ACE_Lock* lock = 0);
00664
00665
00666
00667
00668 ACE_InputCDR (ACE_Data_Block *data,
00669 ACE_Message_Block::Message_Flags flag = 0,
00670 int byte_order = ACE_CDR::BYTE_ORDER_NATIVE,
00671 ACE_CDR::Octet major_version = ACE_CDR_GIOP_MAJOR_VERSION,
00672 ACE_CDR::Octet minor_version = ACE_CDR_GIOP_MINOR_VERSION);
00673
00674
00675
00676
00677
00678 ACE_InputCDR (ACE_Data_Block *data,
00679 ACE_Message_Block::Message_Flags flag,
00680 size_t read_pointer_position,
00681 size_t write_pointer_position,
00682 int byte_order = ACE_CDR::BYTE_ORDER_NATIVE,
00683 ACE_CDR::Octet major_version = ACE_CDR_GIOP_MAJOR_VERSION,
00684 ACE_CDR::Octet minor_version = ACE_CDR_GIOP_MINOR_VERSION);
00685
00686
00687
00688
00689
00690
00691 ACE_InputCDR (const ACE_InputCDR& rhs);
00692
00693 ACE_InputCDR& operator= (const ACE_InputCDR& rhs);
00694
00695
00696
00697 ACE_InputCDR (const ACE_InputCDR& rhs,
00698 size_t size,
00699 ACE_CDR::Long offset);
00700
00701
00702
00703 ACE_InputCDR (const ACE_InputCDR& rhs,
00704 size_t size);
00705
00706
00707 ACE_InputCDR (const ACE_OutputCDR& rhs,
00708 ACE_Allocator* buffer_allocator = 0,
00709 ACE_Allocator* data_block_allocator = 0,
00710 ACE_Allocator* message_block_allocator = 0);
00711
00712
00713
00714
00715 struct ACE_Export Transfer_Contents
00716 {
00717 Transfer_Contents (ACE_InputCDR &rhs);
00718
00719 ACE_InputCDR &rhs_;
00720 };
00721
00722 ACE_InputCDR (Transfer_Contents rhs);
00723
00724
00725 ~ACE_InputCDR (void);
00726
00727
00728
00729
00730
00731 struct ACE_Export to_boolean
00732 {
00733 explicit to_boolean (ACE_CDR::Boolean &b);
00734 ACE_CDR::Boolean &ref_;
00735 };
00736
00737 struct ACE_Export to_char
00738 {
00739 explicit to_char (ACE_CDR::Char &c);
00740 ACE_CDR::Char &ref_;
00741 };
00742
00743 struct ACE_Export to_wchar
00744 {
00745 explicit to_wchar (ACE_CDR::WChar &wc);
00746 ACE_CDR::WChar &ref_;
00747 };
00748
00749 struct ACE_Export to_octet
00750 {
00751 explicit to_octet (ACE_CDR::Octet &o);
00752 ACE_CDR::Octet &ref_;
00753 };
00754
00755 struct ACE_Export to_string
00756 {
00757
00758
00759
00760
00761
00762 to_string (ACE_CDR::Char *&s,
00763 ACE_CDR::ULong b);
00764 to_string (const ACE_CDR::Char *&s,
00765 ACE_CDR::ULong b);
00766 const ACE_CDR::Char *&val_;
00767 ACE_CDR::ULong bound_;
00768 };
00769
00770 struct ACE_Export to_wstring
00771 {
00772
00773
00774
00775 to_wstring (ACE_CDR::WChar *&ws,
00776 ACE_CDR::ULong b);
00777 to_wstring (const ACE_CDR::WChar *&ws,
00778 ACE_CDR::ULong b);
00779 const ACE_CDR::WChar *&val_;
00780 ACE_CDR::ULong bound_;
00781 };
00782
00783
00784
00785
00786
00787
00788 ACE_CDR::Boolean read_boolean (ACE_CDR::Boolean& x);
00789 ACE_CDR::Boolean read_char (ACE_CDR::Char &x);
00790 ACE_CDR::Boolean read_wchar (ACE_CDR::WChar& x);
00791 ACE_CDR::Boolean read_octet (ACE_CDR::Octet& x);
00792 ACE_CDR::Boolean read_short (ACE_CDR::Short &x);
00793 ACE_CDR::Boolean read_ushort (ACE_CDR::UShort &x);
00794 ACE_CDR::Boolean read_long (ACE_CDR::Long &x);
00795 ACE_CDR::Boolean read_ulong (ACE_CDR::ULong &x);
00796 ACE_CDR::Boolean read_longlong (ACE_CDR::LongLong& x);
00797 ACE_CDR::Boolean read_ulonglong (ACE_CDR::ULongLong& x);
00798 ACE_CDR::Boolean read_float (ACE_CDR::Float &x);
00799 ACE_CDR::Boolean read_double (ACE_CDR::Double &x);
00800 ACE_CDR::Boolean read_longdouble (ACE_CDR::LongDouble &x);
00801
00802 ACE_CDR::Boolean read_string (ACE_CDR::Char *&x);
00803 ACE_CDR::Boolean read_string (ACE_CString &x);
00804 ACE_CDR::Boolean read_wstring (ACE_CDR::WChar*& x);
00805
00806
00807
00808
00809
00810
00811
00812
00813 ACE_CDR::Boolean read_boolean_array (ACE_CDR::Boolean* x,
00814 ACE_CDR::ULong length);
00815 ACE_CDR::Boolean read_char_array (ACE_CDR::Char *x,
00816 ACE_CDR::ULong length);
00817 ACE_CDR::Boolean read_wchar_array (ACE_CDR::WChar* x,
00818 ACE_CDR::ULong length);
00819 ACE_CDR::Boolean read_octet_array (ACE_CDR::Octet* x,
00820 ACE_CDR::ULong length);
00821 ACE_CDR::Boolean read_short_array (ACE_CDR::Short *x,
00822 ACE_CDR::ULong length);
00823 ACE_CDR::Boolean read_ushort_array (ACE_CDR::UShort *x,
00824 ACE_CDR::ULong length);
00825 ACE_CDR::Boolean read_long_array (ACE_CDR::Long *x,
00826 ACE_CDR::ULong length);
00827 ACE_CDR::Boolean read_ulong_array (ACE_CDR::ULong *x,
00828 ACE_CDR::ULong length);
00829 ACE_CDR::Boolean read_longlong_array (ACE_CDR::LongLong* x,
00830 ACE_CDR::ULong length);
00831 ACE_CDR::Boolean read_ulonglong_array (ACE_CDR::ULongLong* x,
00832 ACE_CDR::ULong length);
00833 ACE_CDR::Boolean read_float_array (ACE_CDR::Float *x,
00834 ACE_CDR::ULong length);
00835 ACE_CDR::Boolean read_double_array (ACE_CDR::Double *x,
00836 ACE_CDR::ULong length);
00837 ACE_CDR::Boolean read_longdouble_array (ACE_CDR::LongDouble* x,
00838 ACE_CDR::ULong length);
00839
00840
00841
00842
00843
00844
00845 ACE_CDR::Boolean skip_boolean (void);
00846 ACE_CDR::Boolean skip_char (void);
00847 ACE_CDR::Boolean skip_wchar (void);
00848 ACE_CDR::Boolean skip_octet (void);
00849 ACE_CDR::Boolean skip_short (void);
00850 ACE_CDR::Boolean skip_ushort (void);
00851 ACE_CDR::Boolean skip_long (void);
00852 ACE_CDR::Boolean skip_ulong (void);
00853 ACE_CDR::Boolean skip_longlong (void);
00854 ACE_CDR::Boolean skip_ulonglong (void);
00855 ACE_CDR::Boolean skip_float (void);
00856 ACE_CDR::Boolean skip_double (void);
00857 ACE_CDR::Boolean skip_longdouble (void);
00858
00859
00860
00861
00862
00863
00864
00865 ACE_CDR::Boolean skip_wstring (void);
00866 ACE_CDR::Boolean skip_string (void);
00867
00868
00869
00870
00871
00872 ACE_CDR::Boolean skip_bytes (size_t n);
00873
00874
00875 bool good_bit (void) const;
00876
00877
00878
00879
00880
00881
00882
00883
00884 const ACE_Message_Block* start (void) const;
00885
00886
00887
00888
00889
00890
00891
00892
00893
00894 int grow (size_t newsize);
00895
00896
00897
00898
00899
00900
00901 void reset_byte_order (int byte_order);
00902
00903
00904
00905 void reset (const ACE_Message_Block *data,
00906 int byte_order);
00907
00908
00909 ACE_Message_Block *steal_contents (void);
00910
00911
00912
00913 void steal_from (ACE_InputCDR &cdr);
00914
00915
00916
00917
00918
00919
00920 void exchange_data_blocks (ACE_InputCDR &cdr);
00921
00922
00923
00924
00925
00926
00927
00928
00929 ACE_Data_Block* clone_from (ACE_InputCDR &cdr);
00930
00931
00932
00933 void reset_contents (void);
00934
00935
00936 char* rd_ptr (void);
00937
00938
00939 char* wr_ptr (void);
00940
00941
00942 size_t length (void) const;
00943
00944
00945
00946
00947
00948
00949
00950
00951 int align_read_ptr (size_t alignment);
00952
00953
00954
00955 bool do_byte_swap (void) const;
00956
00957
00958
00959 int byte_order (void) const;
00960
00961
00962 ACE_Char_Codeset_Translator *char_translator (void) const;
00963 ACE_WChar_Codeset_Translator *wchar_translator (void) const;
00964
00965
00966 void char_translator (ACE_Char_Codeset_Translator *);
00967 void wchar_translator (ACE_WChar_Codeset_Translator *);
00968
00969
00970
00971
00972
00973
00974
00975 int adjust (size_t size,
00976 char *&buf);
00977
00978
00979
00980 int adjust (size_t size,
00981 size_t align,
00982 char *&buf);
00983
00984
00985 void set_version (ACE_CDR::Octet major, ACE_CDR::Octet minor);
00986
00987
00988 void get_version (ACE_CDR::Octet &major, ACE_CDR::Octet &minor);
00989
00990 #if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1)
00991
00992 void register_monitor (const char* id);
00993 void unregister_monitor (void);
00994 #endif
00995
00996 protected:
00997
00998
00999
01000 ACE_Message_Block start_;
01001
01002
01003
01004 bool do_byte_swap_;
01005
01006
01007 bool good_bit_;
01008
01009
01010 ACE_CDR::Octet major_version_;
01011 ACE_CDR::Octet minor_version_;
01012
01013
01014 ACE_Char_Codeset_Translator *char_translator_;
01015 ACE_WChar_Codeset_Translator *wchar_translator_;
01016
01017 #if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1)
01018 ACE::Monitor_Control::Size_Monitor *monitor_;
01019 #endif
01020
01021 private:
01022
01023 ACE_CDR::Boolean read_1 (ACE_CDR::Octet *x);
01024 ACE_CDR::Boolean read_2 (ACE_CDR::UShort *x);
01025 ACE_CDR::Boolean read_4 (ACE_CDR::ULong *x);
01026 ACE_CDR::Boolean read_8 (ACE_CDR::ULongLong *x);
01027 ACE_CDR::Boolean read_16 (ACE_CDR::LongDouble *x);
01028
01029
01030
01031
01032
01033
01034
01035
01036
01037
01038
01039
01040
01041
01042
01043
01044
01045
01046
01047
01048 ACE_CDR::Boolean read_array (void* x,
01049 size_t size,
01050 size_t align,
01051 ACE_CDR::ULong length);
01052
01053
01054
01055
01056
01057
01058
01059 ACE_CDR::Boolean read_wchar_array_i (ACE_CDR::WChar * x,
01060 ACE_CDR::ULong length);
01061
01062
01063 void rd_ptr (size_t offset);
01064
01065
01066 char* end (void);
01067 };
01068
01069
01070
01071
01072
01073
01074
01075
01076
01077
01078
01079
01080
01081
01082
01083
01084
01085 class ACE_Export ACE_Char_Codeset_Translator
01086 {
01087 public:
01088 virtual ~ACE_Char_Codeset_Translator ();
01089
01090
01091
01092 virtual ACE_CDR::Boolean read_char (ACE_InputCDR&,
01093 ACE_CDR::Char&) = 0;
01094
01095
01096
01097 virtual ACE_CDR::Boolean read_string (ACE_InputCDR&,
01098 ACE_CDR::Char *&) = 0;
01099
01100
01101
01102 virtual ACE_CDR::Boolean read_char_array (ACE_InputCDR&,
01103 ACE_CDR::Char*,
01104 ACE_CDR::ULong) = 0;
01105
01106
01107
01108 virtual ACE_CDR::Boolean write_char (ACE_OutputCDR&,
01109 ACE_CDR::Char) = 0;
01110
01111
01112
01113 virtual ACE_CDR::Boolean write_string (ACE_OutputCDR&,
01114 ACE_CDR::ULong,
01115 const ACE_CDR::Char*) = 0;
01116
01117
01118
01119 virtual ACE_CDR::Boolean write_char_array (ACE_OutputCDR&,
01120 const ACE_CDR::Char*,
01121 ACE_CDR::ULong) = 0;
01122
01123 virtual ACE_CDR::ULong ncs () = 0;
01124 virtual ACE_CDR::ULong tcs () = 0;
01125 protected:
01126
01127
01128 ACE_CDR::Boolean read_1 (ACE_InputCDR& input,
01129 ACE_CDR::Octet *x);
01130 ACE_CDR::Boolean write_1 (ACE_OutputCDR& output,
01131 const ACE_CDR::Octet *x);
01132
01133
01134
01135 ACE_CDR::Boolean read_array (ACE_InputCDR& input,
01136 void* x,
01137 size_t size,
01138 size_t align,
01139 ACE_CDR::ULong length);
01140
01141
01142
01143
01144
01145
01146
01147 ACE_CDR::Boolean write_array (ACE_OutputCDR& output,
01148 const void *x,
01149 size_t size,
01150 size_t align,
01151 ACE_CDR::ULong length);
01152
01153
01154
01155
01156
01157
01158
01159
01160 int adjust (ACE_OutputCDR& out,
01161 size_t size,
01162 size_t align,
01163 char *&buf);
01164
01165
01166 void good_bit (ACE_OutputCDR& out, bool bit);
01167
01168
01169 ACE_CDR::Octet major_version (ACE_InputCDR& input);
01170 ACE_CDR::Octet minor_version (ACE_InputCDR& input);
01171 ACE_CDR::Octet major_version (ACE_OutputCDR& output);
01172 ACE_CDR::Octet minor_version (ACE_OutputCDR& output);
01173 };
01174
01175
01176
01177
01178
01179
01180
01181
01182
01183
01184
01185
01186
01187 class ACE_Export ACE_WChar_Codeset_Translator
01188 {
01189 public:
01190 virtual ~ACE_WChar_Codeset_Translator ();
01191
01192 virtual ACE_CDR::Boolean read_wchar (ACE_InputCDR&,
01193 ACE_CDR::WChar&) = 0;
01194 virtual ACE_CDR::Boolean read_wstring (ACE_InputCDR&,
01195 ACE_CDR::WChar *&) = 0;
01196 virtual ACE_CDR::Boolean read_wchar_array (ACE_InputCDR&,
01197 ACE_CDR::WChar*,
01198 ACE_CDR::ULong) = 0;
01199 virtual ACE_CDR::Boolean write_wchar (ACE_OutputCDR&,
01200 ACE_CDR::WChar) = 0;
01201 virtual ACE_CDR::Boolean write_wstring (ACE_OutputCDR&,
01202 ACE_CDR::ULong,
01203 const ACE_CDR::WChar*) = 0;
01204 virtual ACE_CDR::Boolean write_wchar_array (ACE_OutputCDR&,
01205 const ACE_CDR::WChar*,
01206 ACE_CDR::ULong) = 0;
01207
01208 virtual ACE_CDR::ULong ncs () = 0;
01209 virtual ACE_CDR::ULong tcs () = 0;
01210 protected:
01211
01212
01213 ACE_CDR::Boolean read_1 (ACE_InputCDR& input,
01214 ACE_CDR::Octet *x);
01215 ACE_CDR::Boolean read_2 (ACE_InputCDR& input,
01216 ACE_CDR::UShort *x);
01217 ACE_CDR::Boolean read_4 (ACE_InputCDR& input,
01218 ACE_CDR::ULong *x);
01219 ACE_CDR::Boolean write_1 (ACE_OutputCDR& output,
01220 const ACE_CDR::Octet *x);
01221 ACE_CDR::Boolean write_2 (ACE_OutputCDR& output,
01222 const ACE_CDR::UShort *x);
01223 ACE_CDR::Boolean write_4 (ACE_OutputCDR& output,
01224 const ACE_CDR::ULong *x);
01225
01226
01227
01228 ACE_CDR::Boolean read_array (ACE_InputCDR& input,
01229 void* x,
01230 size_t size,
01231 size_t align,
01232 ACE_CDR::ULong length);
01233
01234
01235
01236
01237
01238
01239
01240 ACE_CDR::Boolean write_array (ACE_OutputCDR& output,
01241 const void *x,
01242 size_t size,
01243 size_t align,
01244 ACE_CDR::ULong length);
01245
01246
01247
01248
01249
01250
01251
01252
01253 int adjust (ACE_OutputCDR& out,
01254 size_t size,
01255 size_t align,
01256 char *&buf);
01257
01258
01259 void good_bit (ACE_OutputCDR& out, bool bit);
01260
01261
01262 ACE_CDR::Octet major_version (ACE_InputCDR& input);
01263 ACE_CDR::Octet minor_version (ACE_InputCDR& input);
01264 ACE_CDR::Octet major_version (ACE_OutputCDR& output);
01265 ACE_CDR::Octet minor_version (ACE_OutputCDR& output);
01266
01267 };
01268
01269
01270
01271 extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os,
01272 const ACE_CString &x);
01273
01274 extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is,
01275 ACE_CString &x);
01276
01277
01278 ACE_END_VERSIONED_NAMESPACE_DECL
01279
01280 #if defined (__ACE_INLINE__)
01281 # include "ace/CDR_Stream.inl"
01282 #else
01283
01284 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
01285
01286
01287 extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os,
01288 ACE_CDR::Char x);
01289
01290
01291 extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os,
01292 ACE_CDR::Short x);
01293 extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os,
01294 ACE_CDR::UShort x);
01295 extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os,
01296 ACE_CDR::Long x);
01297 extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os,
01298 ACE_CDR::ULong x);
01299 extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os,
01300 ACE_CDR::LongLong x);
01301 extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os,
01302 ACE_CDR::ULongLong x);
01303 extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR& os,
01304 ACE_CDR::LongDouble x);
01305 extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os,
01306 ACE_CDR::Float x);
01307 extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os,
01308 ACE_CDR::Double x);
01309
01310
01311
01312 extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os,
01313 ACE_OutputCDR::from_boolean x);
01314 extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os,
01315 ACE_OutputCDR::from_char x);
01316 extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os,
01317 ACE_OutputCDR::from_wchar x);
01318 extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os,
01319 ACE_OutputCDR::from_octet x);
01320 extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os,
01321 ACE_OutputCDR::from_string x);
01322 extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os,
01323 ACE_OutputCDR::from_wstring x);
01324 extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os,
01325 const ACE_CDR::Char* x);
01326 extern ACE_Export ACE_CDR::Boolean operator<< (ACE_OutputCDR &os,
01327 const ACE_CDR::WChar* x);
01328
01329
01330 extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is,
01331 ACE_CDR::Char &x);
01332
01333
01334 extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is,
01335 ACE_CDR::Short &x);
01336 extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is,
01337 ACE_CDR::UShort &x);
01338 extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is,
01339 ACE_CDR::Long &x);
01340 extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is,
01341 ACE_CDR::ULong &x);
01342 extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is,
01343 ACE_CDR::LongLong &x);
01344 extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is,
01345 ACE_CDR::ULongLong &x);
01346 extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is,
01347 ACE_CDR::LongDouble &x);
01348 extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is,
01349 ACE_CDR::Float &x);
01350 extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is,
01351 ACE_CDR::Double &x);
01352
01353
01354
01355 extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is,
01356 ACE_InputCDR::to_boolean x);
01357 extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is,
01358 ACE_InputCDR::to_char x);
01359 extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is,
01360 ACE_InputCDR::to_wchar x);
01361 extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is,
01362 ACE_InputCDR::to_octet x);
01363 extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is,
01364 ACE_InputCDR::to_string x);
01365 extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is,
01366 ACE_InputCDR::to_wstring x);
01367 extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is,
01368 ACE_CDR::Char*& x);
01369 extern ACE_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &is,
01370 ACE_CDR::WChar*& x);
01371
01372 ACE_END_VERSIONED_NAMESPACE_DECL
01373
01374 #endif
01375
01376 #if defined (GEN_OSTREAM_OPS)
01377
01378 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
01379
01380
01381
01382
01383
01384 ACE_Export std::ostream& operator<< (std::ostream &os,
01385 ACE_OutputCDR::from_boolean x);
01386
01387 ACE_Export std::ostream& operator<< (std::ostream &os,
01388 ACE_OutputCDR::from_char x);
01389
01390 ACE_Export std::ostream& operator<< (std::ostream &os,
01391 ACE_OutputCDR::from_wchar x);
01392
01393 ACE_Export std::ostream& operator<< (std::ostream &os,
01394 ACE_OutputCDR::from_octet x);
01395
01396 ACE_END_VERSIONED_NAMESPACE_DECL
01397
01398 #endif
01399
01400 #include "ace/post.h"
01401
01402 #endif