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