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