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