2 #include "ace/OS_NS_string.h"
3 #include "ace/OS_Memory.h"
5 // ****************************************************************
7 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
9 // implementing the special types
11 ACE_OutputCDR::from_boolean::from_boolean (ACE_CDR::Boolean b)
17 ACE_InputCDR::to_boolean::to_boolean (ACE_CDR::Boolean &b)
23 ACE_OutputCDR::from_octet::from_octet (ACE_CDR::Octet o)
29 ACE_InputCDR::to_octet::to_octet (ACE_CDR::Octet &o)
35 ACE_OutputCDR::from_char::from_char (ACE_CDR::Char c)
41 ACE_InputCDR::to_char::to_char (ACE_CDR::Char &c)
47 ACE_OutputCDR::from_wchar::from_wchar (ACE_CDR::WChar wc)
53 ACE_InputCDR::to_wchar::to_wchar (ACE_CDR::WChar &wc)
59 ACE_OutputCDR::from_string::from_string (ACE_CDR::Char *s,
61 ACE_CDR::Boolean nocopy)
69 ACE_OutputCDR::from_string::from_string (const ACE_CDR::Char *s,
71 ACE_CDR::Boolean nocopy)
72 : val_ (const_cast<ACE_CDR::Char *> (s)),
79 ACE_InputCDR::to_string::to_string (ACE_CDR::Char *&s,
81 : val_ (const_cast<const ACE_CDR::Char *&> (s)),
87 ACE_InputCDR::to_string::to_string (const ACE_CDR::Char *&s,
95 ACE_OutputCDR::from_wstring::from_wstring (ACE_CDR::WChar *ws,
97 ACE_CDR::Boolean nocopy)
105 ACE_OutputCDR::from_wstring::from_wstring (const ACE_CDR::WChar *ws,
107 ACE_CDR::Boolean nocopy)
108 : val_ (const_cast<ACE_CDR::WChar *> (ws)),
115 ACE_InputCDR::to_wstring::to_wstring (ACE_CDR::WChar *&ws,
117 : val_ (const_cast<const ACE_CDR::WChar *&> (ws)),
123 ACE_InputCDR::to_wstring::to_wstring (const ACE_CDR::WChar *&ws,
131 ACE_InputCDR::to_std_string::to_std_string (std::string &s,
139 ACE_OutputCDR::from_std_string::from_std_string (const std::string &ws,
146 #if !defined(ACE_LACKS_STD_WSTRING)
148 ACE_InputCDR::to_std_wstring::to_std_wstring (std::wstring &s,
156 ACE_OutputCDR::from_std_wstring::from_std_wstring (const std::wstring &ws,
165 ACE_InputCDR::to_int8::to_int8 (ACE_CDR::Int8 &ref)
171 ACE_OutputCDR::from_int8::from_int8 (ACE_CDR::Int8 val)
177 ACE_InputCDR::to_uint8::to_uint8 (ACE_CDR::UInt8 &ref)
183 ACE_OutputCDR::from_uint8::from_uint8 (ACE_CDR::UInt8 val)
189 ACE_InputCDR::Transfer_Contents::Transfer_Contents (ACE_InputCDR &rhs)
194 // ****************************************************************
197 ACE_OutputCDR::~ACE_OutputCDR ()
199 if (this->start_.cont () != 0)
201 ACE_Message_Block::release (this->start_.cont ());
202 this->start_.cont (0);
207 #if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1)
208 this->monitor_->remove_ref ();
209 #endif /* ACE_HAS_MONITOR_POINTS==1 */
213 ACE_OutputCDR::reset ()
215 this->current_ = &this->start_;
216 this->current_is_writable_ = true;
217 ACE_CDR::mb_align (&this->start_);
219 #if !defined (ACE_LACKS_CDR_ALIGNMENT)
220 this->current_alignment_ = 0;
221 #endif /* ACE_LACKS_CDR_ALIGNMENT */
223 // It is tempting not to remove the memory, but we need to do so to
224 // release any potential user buffers chained in the continuation
227 ACE_Message_Block * const cont = this->start_.cont ();
230 ACE_Message_Block::release (cont);
231 this->start_.cont (0);
234 #if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1)
235 this->monitor_->receive (this->start_.total_size ());
236 #endif /* ACE_HAS_MONITOR_POINTS==1 */
239 // Encode the CDR stream.
241 ACE_INLINE ACE_CDR::Boolean
242 ACE_OutputCDR::write_octet (ACE_CDR::Octet x)
244 return this->write_1 (&x);
247 ACE_INLINE ACE_CDR::Boolean
248 ACE_OutputCDR::write_boolean (ACE_CDR::Boolean x)
251 static_cast<ACE_CDR::Boolean> (
254 ? static_cast<ACE_CDR::Octet> (1)
255 : static_cast<ACE_CDR::Octet> (0)));
258 ACE_INLINE ACE_CDR::Boolean
259 ACE_OutputCDR::write_char (ACE_CDR::Char x)
261 if (this->char_translator_ == 0)
263 ACE_CDR::Octet temp = static_cast<ACE_CDR::Octet> (x);
264 return this->write_1 (&temp);
266 return this->char_translator_->write_char (*this, x);
269 ACE_INLINE ACE_CDR::Boolean
270 ACE_OutputCDR::write_short (ACE_CDR::Short x)
272 ACE_CDR::UShort temp = static_cast<ACE_CDR::UShort> (x);
273 return this->write_2 (&temp);
276 ACE_INLINE ACE_CDR::Boolean
277 ACE_OutputCDR::write_ushort (ACE_CDR::UShort x)
279 return this->write_2 (&x);
282 ACE_INLINE ACE_CDR::Boolean
283 ACE_OutputCDR::write_long (ACE_CDR::Long x)
285 ACE_CDR::ULong temp = static_cast<ACE_CDR::ULong> (x);
286 return this->write_4 (&temp);
289 ACE_INLINE ACE_CDR::Boolean
290 ACE_OutputCDR::write_ulong (ACE_CDR::ULong x)
292 return this->write_4 (&x);
295 ACE_INLINE ACE_CDR::Boolean
296 ACE_OutputCDR::write_longlong (const ACE_CDR::LongLong &x)
298 void const * const temp = &x;
299 return this->write_8 (reinterpret_cast<ACE_CDR::ULongLong const *> (temp));
302 ACE_INLINE ACE_CDR::Boolean
303 ACE_OutputCDR::write_ulonglong (const ACE_CDR::ULongLong &x)
305 return this->write_8 (&x);
308 ACE_INLINE ACE_CDR::Boolean
309 ACE_OutputCDR::write_float (ACE_CDR::Float x)
311 void const * const temp = &x;
312 return this->write_4 (reinterpret_cast<ACE_CDR::ULong const *> (temp));
315 ACE_INLINE ACE_CDR::Boolean
316 ACE_OutputCDR::write_double (const ACE_CDR::Double &x)
318 void const * const temp = &x;
319 return this->write_8 (reinterpret_cast<ACE_CDR::ULongLong const *> (temp));
322 ACE_INLINE ACE_CDR::Boolean
323 ACE_OutputCDR::write_longdouble (const ACE_CDR::LongDouble &x)
325 return this->write_16 (&x);
328 ACE_INLINE ACE_CDR::Boolean
329 ACE_OutputCDR::write_fixed (const ACE_CDR::Fixed &x)
332 const ACE_CDR::Octet *arr = x.to_octets (n);
333 return this->write_array (arr, ACE_CDR::OCTET_SIZE, ACE_CDR::OCTET_ALIGN, n);
336 ACE_INLINE ACE_CDR::Boolean
337 ACE_OutputCDR::write_string (const ACE_CDR::Char *x)
341 ACE_CDR::ULong const len =
342 static_cast<ACE_CDR::ULong> (ACE_OS::strlen (x));
343 return this->write_string (len, x);
346 return this->write_string (0, 0);
349 ACE_INLINE ACE_CDR::Boolean
350 ACE_OutputCDR::write_wstring (const ACE_CDR::WChar *x)
354 ACE_CDR::ULong const len =
355 static_cast<ACE_CDR::ULong> (ACE_OS::strlen (x));
356 return this->write_wstring (len, x);
359 return this->write_wstring (0, 0);
362 ACE_INLINE ACE_CDR::Boolean
363 ACE_OutputCDR::write_string (const std::string &x)
365 ACE_CDR::ULong const len =
366 static_cast<ACE_CDR::ULong> (x.size ());
367 return this->write_string (len,
368 x.empty () ? 0 : x.c_str ());
371 #if !defined(ACE_LACKS_STD_WSTRING)
372 ACE_INLINE ACE_CDR::Boolean
373 ACE_OutputCDR::write_wstring (const std::wstring &x)
375 ACE_CDR::ULong const len =
376 static_cast<ACE_CDR::ULong> (x.size ());
377 return this->write_wstring (len,
378 x.empty () ? 0 : x.c_str ());
382 ACE_INLINE ACE_CDR::Boolean
383 ACE_OutputCDR::write_int8 (ACE_CDR::Int8 x)
385 return this->write_1 (reinterpret_cast<ACE_CDR::Octet *> (&x));
388 ACE_INLINE ACE_CDR::Boolean
389 ACE_OutputCDR::write_uint8 (ACE_CDR::UInt8 x)
391 return this->write_1 (reinterpret_cast<ACE_CDR::Octet *> (&x));
394 ACE_INLINE ACE_CDR::Boolean
395 ACE_OutputCDR::write_char_array (const ACE_CDR::Char *x,
396 ACE_CDR::ULong length)
398 if (this->char_translator_ == 0)
399 return this->write_array (x,
401 ACE_CDR::OCTET_ALIGN,
403 return this->char_translator_->write_char_array (*this, x, length);
406 ACE_INLINE ACE_CDR::Boolean
407 ACE_OutputCDR::write_wchar_array (const ACE_CDR::WChar* x,
408 ACE_CDR::ULong length)
410 if (this->wchar_translator_)
411 return this->wchar_translator_->write_wchar_array (*this, x, length);
413 if (ACE_OutputCDR::wchar_maxbytes_ == 0)
416 return (this->good_bit_ = false);
419 if (ACE_OutputCDR::wchar_maxbytes_ == sizeof (ACE_CDR::WChar))
420 return this->write_array (x,
421 sizeof (ACE_CDR::WChar),
422 sizeof (ACE_CDR::WChar) == 2
423 ? ACE_CDR::SHORT_ALIGN
424 : ACE_CDR::LONG_ALIGN,
426 return this->write_wchar_array_i (x,length);
429 ACE_INLINE ACE_CDR::Boolean
430 ACE_OutputCDR::write_octet_array (const ACE_CDR::Octet* x,
431 ACE_CDR::ULong length)
433 return this->write_array (x,
435 ACE_CDR::OCTET_ALIGN,
439 ACE_INLINE ACE_CDR::Boolean
440 ACE_OutputCDR::write_short_array (const ACE_CDR::Short *x,
441 ACE_CDR::ULong length)
443 return this->write_array (x,
445 ACE_CDR::SHORT_ALIGN,
449 ACE_INLINE ACE_CDR::Boolean
450 ACE_OutputCDR::write_ushort_array (const ACE_CDR::UShort *x,
451 ACE_CDR::ULong length)
453 return this->write_array (x,
455 ACE_CDR::SHORT_ALIGN,
459 ACE_INLINE ACE_CDR::Boolean
460 ACE_OutputCDR::write_long_array (const ACE_CDR::Long *x,
461 ACE_CDR::ULong length)
463 return this->write_array (x,
469 ACE_INLINE ACE_CDR::Boolean
470 ACE_OutputCDR::write_ulong_array (const ACE_CDR::ULong *x,
471 ACE_CDR::ULong length)
473 return this->write_array (x,
479 ACE_INLINE ACE_CDR::Boolean
480 ACE_OutputCDR::write_longlong_array (const ACE_CDR::LongLong *x,
481 ACE_CDR::ULong length)
483 return this->write_array (x,
484 ACE_CDR::LONGLONG_SIZE,
485 ACE_CDR::LONGLONG_ALIGN,
489 ACE_INLINE ACE_CDR::Boolean
490 ACE_OutputCDR::write_ulonglong_array (const ACE_CDR::ULongLong *x,
491 ACE_CDR::ULong length)
493 return this->write_array (x,
494 ACE_CDR::LONGLONG_SIZE,
495 ACE_CDR::LONGLONG_ALIGN,
499 ACE_INLINE ACE_CDR::Boolean
500 ACE_OutputCDR::write_float_array (const ACE_CDR::Float *x,
501 ACE_CDR::ULong length)
503 return this->write_array (x,
510 ACE_INLINE ACE_CDR::Boolean
511 ACE_OutputCDR::write_double_array (const ACE_CDR::Double *x,
512 ACE_CDR::ULong length)
514 return this->write_array (x,
515 ACE_CDR::LONGLONG_SIZE,
516 ACE_CDR::LONGLONG_ALIGN,
520 ACE_INLINE ACE_CDR::Boolean
521 ACE_OutputCDR::write_longdouble_array (const ACE_CDR::LongDouble* x,
522 ACE_CDR::ULong length)
524 return this->write_array (x,
525 ACE_CDR::LONGDOUBLE_SIZE,
526 ACE_CDR::LONGDOUBLE_ALIGN,
530 ACE_INLINE ACE_CDR::Boolean
531 ACE_OutputCDR::write_int8_array (const ACE_CDR::Int8 *x, ACE_CDR::ULong length)
533 return write_array (x, ACE_CDR::OCTET_SIZE, ACE_CDR::OCTET_ALIGN, length);
536 ACE_INLINE ACE_CDR::Boolean
537 ACE_OutputCDR::write_uint8_array (const ACE_CDR::UInt8 *x, ACE_CDR::ULong length)
539 return write_array (x, ACE_CDR::OCTET_SIZE, ACE_CDR::OCTET_ALIGN, length);
543 ACE_OutputCDR::good_bit () const
545 return this->good_bit_;
549 ACE_OutputCDR::adjust (size_t size,
553 if (!this->current_is_writable_)
554 return this->grow_and_adjust (size, align, buf);
556 #if !defined (ACE_LACKS_CDR_ALIGNMENT)
557 size_t const offset =
558 ACE_align_binary (this->current_alignment_, align)
559 - this->current_alignment_;
561 buf = this->current_->wr_ptr () + offset;
563 buf = this->current_->wr_ptr ();
564 #endif /* ACE_LACKS_CDR_ALIGNMENT */
566 char * const end = buf + size;
568 if (end <= this->current_->end () &&
571 #if !defined (ACE_LACKS_CDR_ALIGNMENT)
572 this->current_alignment_ += offset + size;
573 #endif /* ACE_LACKS_CDR_ALIGNMENT */
574 this->current_->wr_ptr (end);
576 #if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1)
577 this->monitor_->receive (this->total_length ());
578 #endif /* ACE_HAS_MONITOR_POINTS==1 */
583 return this->grow_and_adjust (size, align, buf);
587 ACE_OutputCDR::adjust (size_t size, char*& buf)
589 return this->adjust (size, size, buf);
593 ACE_OutputCDR::set_version (ACE_CDR::Octet major, ACE_CDR::Octet minor)
595 this->major_version_ = major;
596 this->minor_version_ = minor;
600 ACE_OutputCDR::get_version (ACE_CDR::Octet &major, ACE_CDR::Octet &minor)
602 major = this->major_version_;
603 minor = this->minor_version_;
607 ACE_INLINE const ACE_Message_Block*
608 ACE_OutputCDR::begin () const
610 return &this->start_;
613 ACE_INLINE const ACE_Message_Block*
614 ACE_OutputCDR::end () const
616 return this->current_->cont ();
619 ACE_INLINE const ACE_Message_Block*
620 ACE_OutputCDR::current () const
622 return this->current_;
626 ACE_OutputCDR::total_length () const
628 return ACE_CDR::total_length (this->begin (), this->end ());
631 ACE_INLINE const char*
632 ACE_OutputCDR::buffer () const
634 return this->start_.rd_ptr ();
638 ACE_OutputCDR::length () const
640 return this->start_.length ();
644 ACE_OutputCDR::do_byte_swap () const
646 return this->do_byte_swap_;
650 ACE_OutputCDR::byte_order () const
652 if (this->do_byte_swap ())
653 return !ACE_CDR_BYTE_ORDER;
655 return ACE_CDR_BYTE_ORDER;
659 ACE_OutputCDR::reset_byte_order (int byte_order)
661 this->do_byte_swap_ = (byte_order != ACE_CDR_BYTE_ORDER);
665 ACE_OutputCDR::current_alignment () const
667 #if !defined (ACE_LACKS_CDR_ALIGNMENT)
668 return this->current_alignment_;
670 // Default value set to 0
672 #endif /* ACE_LACKS_CDR_ALIGNMENT */
676 ACE_OutputCDR::current_alignment (size_t current_alignment)
678 #if !defined (ACE_LACKS_CDR_ALIGNMENT)
679 this->current_alignment_ = current_alignment;
681 ACE_UNUSED_ARG (current_alignment);
682 #endif /* ACE_LACKS_CDR_ALIGNMENT */
686 ACE_OutputCDR::align_write_ptr (size_t alignment)
688 #if !defined (ACE_LACKS_CDR_ALIGNMENT)
690 return this->adjust (0, alignment, dummy);
692 ACE_UNUSED_ARG (alignment);
693 // A return value of -1 from this function is used
694 // to indicate failure, returning 0
696 #endif /* ACE_LACKS_CDR_ALIGNMENT */
699 ACE_INLINE ACE_Char_Codeset_Translator *
700 ACE_OutputCDR::char_translator () const
702 return this->char_translator_;
705 ACE_INLINE ACE_WChar_Codeset_Translator *
706 ACE_OutputCDR::wchar_translator () const
708 return this->wchar_translator_;
712 ACE_OutputCDR::char_translator (ACE_Char_Codeset_Translator * ctran)
714 this->char_translator_ = ctran;
718 ACE_OutputCDR::wchar_translator (ACE_WChar_Codeset_Translator * wctran)
720 this->wchar_translator_ = wctran;
723 // ****************************************************************
726 ACE_InputCDR::~ACE_InputCDR ()
728 #if defined (ACE_HAS_MONITOR_POINTS) && (ACE_HAS_MONITOR_POINTS == 1)
729 this->monitor_->remove_ref ();
730 #endif /* ACE_HAS_MONITOR_POINTS==1 */
733 ACE_INLINE ACE_CDR::Boolean
734 ACE_InputCDR::read_octet (ACE_CDR::Octet& x)
736 return this->read_1 (&x);
739 ACE_INLINE ACE_CDR::Boolean
740 ACE_InputCDR::read_boolean (ACE_CDR::Boolean& x)
742 ACE_CDR::Octet tmp = 0;
743 (void) this->read_octet (tmp);
744 x = tmp ? true : false;
745 return this->good_bit_;
748 ACE_INLINE ACE_CDR::Boolean
749 ACE_InputCDR::read_char (ACE_CDR::Char &x)
751 if (this->char_translator_ == 0)
754 return this->read_1 (reinterpret_cast<ACE_CDR::Octet*> (temp));
756 return this->char_translator_->read_char (*this, x);
760 ACE_INLINE ACE_CDR::Boolean
761 ACE_InputCDR::read_short (ACE_CDR::Short &x)
764 return this->read_2 (reinterpret_cast<ACE_CDR::UShort*> (temp));
767 ACE_INLINE ACE_CDR::Boolean
768 ACE_InputCDR::read_ushort (ACE_CDR::UShort &x)
770 return this->read_2 (&x);
774 ACE_INLINE ACE_CDR::Boolean
775 ACE_InputCDR::read_long (ACE_CDR::Long &x)
778 return this->read_4 (reinterpret_cast<ACE_CDR::ULong*> (temp));
782 ACE_INLINE ACE_CDR::Boolean
783 ACE_InputCDR::read_ulong (ACE_CDR::ULong &x)
785 return this->read_4 (&x);
789 ACE_INLINE ACE_CDR::Boolean
790 ACE_InputCDR::read_longlong (ACE_CDR::LongLong &x)
793 return this->read_8 (reinterpret_cast<ACE_CDR::ULongLong*> (temp));
796 ACE_INLINE ACE_CDR::Boolean
797 ACE_InputCDR::read_ulonglong (ACE_CDR::ULongLong &x)
799 return this->read_8 (&x);
802 ACE_INLINE ACE_CDR::Boolean
803 ACE_InputCDR::read_float (ACE_CDR::Float &x)
806 return this->read_4 (reinterpret_cast<ACE_CDR::ULong*> (temp));
809 ACE_INLINE ACE_CDR::Boolean
810 ACE_InputCDR::read_double (ACE_CDR::Double &x)
813 return this->read_8 (reinterpret_cast<ACE_CDR::ULongLong*> (temp));
816 ACE_INLINE ACE_CDR::Boolean
817 ACE_InputCDR::read_longdouble (ACE_CDR::LongDouble &x)
819 return this->read_16 (&x);
822 ACE_INLINE ACE_CDR::Boolean
823 ACE_InputCDR::read_fixed (ACE_CDR::Fixed &x)
825 ACE_CDR::Octet a[16];
826 for (int i = 0; i < 16; ++i)
828 if (!this->read_1 (a + i))
830 const unsigned low = a[i] & 0xf;
831 if (low == ACE_CDR::Fixed::POSITIVE ||
832 low == ACE_CDR::Fixed::NEGATIVE)
834 x = ACE_CDR::Fixed::from_octets (a, i + 1);
842 ACE_INLINE ACE_CDR::Boolean
843 ACE_InputCDR::read_int8 (ACE_CDR::Int8 &x)
845 return read_1 (reinterpret_cast<ACE_CDR::Octet *>(&x));
848 ACE_INLINE ACE_CDR::Boolean
849 ACE_InputCDR::read_uint8 (ACE_CDR::UInt8 &x)
851 return read_1 (reinterpret_cast<ACE_CDR::Octet *>(&x));
855 ACE_InputCDR::length () const
857 return this->start_.length ();
860 ACE_INLINE ACE_CDR::Boolean
861 ACE_InputCDR::read_char_array (ACE_CDR::Char* x,
862 ACE_CDR::ULong length)
864 // Make sure the length of the array isn't greater than the length of
866 if (length > this->length ())
868 this->good_bit_ = false;
872 if (this->char_translator_ == 0)
873 return this->read_array (x,
875 ACE_CDR::OCTET_ALIGN,
877 return this->char_translator_->read_char_array (*this, x, length);
880 ACE_INLINE ACE_CDR::Boolean
881 ACE_InputCDR::read_wchar_array (ACE_CDR::WChar* x,
882 ACE_CDR::ULong length)
884 // Make sure the length of the array isn't greater than the length of
886 if (length * ACE_OutputCDR::wchar_maxbytes_ > this->length ())
888 this->good_bit_ = false;
892 if (this->wchar_translator_ != 0)
893 return this->wchar_translator_->read_wchar_array (*this, x, length);
894 if (ACE_OutputCDR::wchar_maxbytes_ != sizeof (ACE_CDR::WChar))
895 return this->read_wchar_array_i (x, length);
896 return this->read_array (x,
897 sizeof (ACE_CDR::WChar),
898 sizeof (ACE_CDR::WChar) == 2
899 ? ACE_CDR::SHORT_ALIGN
900 : ACE_CDR::LONG_ALIGN,
904 ACE_INLINE ACE_CDR::Boolean
905 ACE_InputCDR::read_octet_array (ACE_CDR::Octet* x,
906 ACE_CDR::ULong length)
908 // Make sure the length of the array isn't greater than the length of
910 if (length * ACE_CDR::OCTET_SIZE > this->length ())
912 this->good_bit_ = false;
916 return this->read_array (x,
918 ACE_CDR::OCTET_ALIGN,
922 ACE_INLINE ACE_CDR::Boolean
923 ACE_InputCDR::read_short_array (ACE_CDR::Short *x,
924 ACE_CDR::ULong length)
926 // Make sure the length of the array isn't greater than the length of
928 if (length * ACE_CDR::SHORT_SIZE > this->length ())
930 this->good_bit_ = false;
934 return this->read_array (x,
936 ACE_CDR::SHORT_ALIGN,
940 ACE_INLINE ACE_CDR::Boolean
941 ACE_InputCDR::read_ushort_array (ACE_CDR::UShort *x,
942 ACE_CDR::ULong length)
944 // Make sure the length of the array isn't greater than the length of
946 if (length * ACE_CDR::SHORT_SIZE > this->length ())
948 this->good_bit_ = false;
952 return this->read_array (x,
954 ACE_CDR::SHORT_ALIGN,
958 ACE_INLINE ACE_CDR::Boolean
959 ACE_InputCDR::read_long_array (ACE_CDR::Long *x,
960 ACE_CDR::ULong length)
962 // Make sure the length of the array isn't greater than the length of
964 if (length * ACE_CDR::LONG_SIZE > this->length ())
966 this->good_bit_ = false;
970 return this->read_array (x,
976 ACE_INLINE ACE_CDR::Boolean
977 ACE_InputCDR::read_ulong_array (ACE_CDR::ULong *x,
978 ACE_CDR::ULong length)
980 // Make sure the length of the array isn't greater than the length of
982 if (length * ACE_CDR::LONG_SIZE > this->length ())
984 this->good_bit_ = false;
988 return this->read_array (x,
994 ACE_INLINE ACE_CDR::Boolean
995 ACE_InputCDR::read_longlong_array (ACE_CDR::LongLong *x,
996 ACE_CDR::ULong length)
998 // Make sure the length of the array isn't greater than the length of
1000 if (length * ACE_CDR::LONGLONG_SIZE > this->length ())
1002 this->good_bit_ = false;
1006 return this->read_array (x,
1007 ACE_CDR::LONGLONG_SIZE,
1008 ACE_CDR::LONGLONG_ALIGN,
1012 ACE_INLINE ACE_CDR::Boolean
1013 ACE_InputCDR::read_ulonglong_array (ACE_CDR::ULongLong *x,
1014 ACE_CDR::ULong length)
1016 // Make sure the length of the array isn't greater than the length of
1018 if (length * ACE_CDR::LONGLONG_SIZE > this->length ())
1020 this->good_bit_ = false;
1024 return this->read_array (x,
1025 ACE_CDR::LONGLONG_SIZE,
1026 ACE_CDR::LONGLONG_ALIGN,
1030 ACE_INLINE ACE_CDR::Boolean
1031 ACE_InputCDR::read_float_array (ACE_CDR::Float *x,
1032 ACE_CDR::ULong length)
1034 // Make sure the length of the array isn't greater than the length of
1036 if (length * ACE_CDR::LONG_SIZE > this->length ())
1038 this->good_bit_ = false;
1042 return this->read_array (x,
1044 ACE_CDR::LONG_ALIGN,
1049 ACE_INLINE ACE_CDR::Boolean
1050 ACE_InputCDR::read_double_array (ACE_CDR::Double *x,
1051 ACE_CDR::ULong length)
1053 // Make sure the length of the array isn't greater than the length of
1055 if (length * ACE_CDR::LONGLONG_SIZE > this->length ())
1057 this->good_bit_ = false;
1061 return this->read_array (x,
1062 ACE_CDR::LONGLONG_SIZE,
1063 ACE_CDR::LONGLONG_ALIGN,
1067 ACE_INLINE ACE_CDR::Boolean
1068 ACE_InputCDR::read_longdouble_array (ACE_CDR::LongDouble* x,
1069 ACE_CDR::ULong length)
1071 // Make sure the length of the array isn't greater than the length of
1073 if (length * ACE_CDR::LONGDOUBLE_SIZE > this->length ())
1075 this->good_bit_ = false;
1078 return this->read_array (x,
1079 ACE_CDR::LONGDOUBLE_SIZE,
1080 ACE_CDR::LONGDOUBLE_ALIGN,
1084 ACE_INLINE ACE_CDR::Boolean
1085 ACE_InputCDR::read_int8_array (ACE_CDR::Int8 *x, ACE_CDR::ULong length)
1087 if (length * ACE_CDR::OCTET_SIZE > this->length ())
1089 this->good_bit_ = false;
1093 return read_array (x, ACE_CDR::OCTET_SIZE, ACE_CDR::OCTET_ALIGN, length);
1096 ACE_INLINE ACE_CDR::Boolean
1097 ACE_InputCDR::read_uint8_array (ACE_CDR::UInt8 *x, ACE_CDR::ULong length)
1099 if (length * ACE_CDR::OCTET_SIZE > this->length ())
1101 this->good_bit_ = false;
1105 return read_array (x, ACE_CDR::OCTET_SIZE, ACE_CDR::OCTET_ALIGN, length);
1108 ACE_INLINE ACE_CDR::Boolean
1109 ACE_InputCDR::skip_octet ()
1112 return this->read_1 (&x);
1115 ACE_INLINE ACE_CDR::Boolean
1116 ACE_InputCDR::skip_char ()
1118 return this->skip_octet (); // sizeof (Char) == sizeof (Octet)
1121 ACE_INLINE ACE_CDR::Boolean
1122 ACE_InputCDR::skip_boolean ()
1124 return this->skip_octet () && this->good_bit_;
1127 ACE_INLINE ACE_CDR::Boolean
1128 ACE_InputCDR::skip_ushort ()
1131 return this->read_2 (&x);
1134 ACE_INLINE ACE_CDR::Boolean
1135 ACE_InputCDR::skip_short ()
1137 return this->skip_ushort ();
1140 ACE_INLINE ACE_CDR::Boolean
1141 ACE_InputCDR::skip_ulong ()
1144 return this->read_4 (&x);
1147 ACE_INLINE ACE_CDR::Boolean
1148 ACE_InputCDR::skip_long ()
1150 return this->skip_ulong (); // sizeof (Long) == sizeof (ULong)
1153 ACE_INLINE ACE_CDR::Boolean
1154 ACE_InputCDR::skip_ulonglong ()
1156 ACE_CDR::ULongLong x;
1157 return this->read_8 (&x);
1160 ACE_INLINE ACE_CDR::Boolean
1161 ACE_InputCDR::skip_longlong ()
1163 return this->skip_ulonglong (); // sizeof (LongLong) == sizeof (ULongLong)
1166 ACE_INLINE ACE_CDR::Boolean
1167 ACE_InputCDR::skip_float ()
1169 return this->skip_ulong (); // sizeof(Float) == sizeof (ULong)
1172 ACE_INLINE ACE_CDR::Boolean
1173 ACE_InputCDR::skip_double ()
1175 return this->skip_ulonglong (); // sizeof(Double) == sizeof (ULongLong)
1178 ACE_INLINE ACE_CDR::Boolean
1179 ACE_InputCDR::skip_longdouble ()
1181 ACE_CDR::LongDouble x;
1182 return this->read_16 (&x);
1185 ACE_INLINE ACE_CDR::Boolean
1186 ACE_InputCDR::skip_fixed ()
1188 for (int i = 0; i < 16; ++i)
1191 if (!this->read_1 (&x))
1193 const unsigned low = x & 0xf;
1194 if (low == 0xc || low == 0xd)
1201 ACE_InputCDR::end ()
1203 return this->start_.end ();
1207 ACE_InputCDR::rd_ptr (size_t offset)
1209 this->start_.rd_ptr (offset);
1213 ACE_InputCDR::rd_ptr ()
1215 return this->start_.rd_ptr ();
1219 ACE_InputCDR::wr_ptr ()
1221 return this->start_.wr_ptr ();
1225 ACE_InputCDR::adjust (size_t size,
1229 #if !defined (ACE_LACKS_CDR_ALIGNMENT)
1230 buf = ACE_ptr_align_binary (this->rd_ptr (), align);
1232 buf = this->rd_ptr ();
1233 #endif /* ACE_LACKS_CDR_ALIGNMENT */
1235 char * const end = buf + size;
1236 if (end <= this->wr_ptr ())
1238 this->start_.rd_ptr (end);
1242 this->good_bit_ = false;
1244 #if defined (ACE_LACKS_CDR_ALIGNMENT)
1245 ACE_UNUSED_ARG (align);
1246 #endif /* ACE_LACKS_CDR_ALIGNMENT */
1250 ACE_InputCDR::adjust (size_t size,
1253 return this->adjust (size, size, buf);
1256 ACE_INLINE const ACE_Message_Block*
1257 ACE_InputCDR::start () const
1259 return &this->start_;
1263 ACE_InputCDR::good_bit () const
1265 return this->good_bit_;
1268 // ****************************************************************
1270 ACE_INLINE ACE_CDR::Boolean
1271 operator<< (ACE_OutputCDR &os, ACE_CDR::Char x)
1274 return os.good_bit ();
1277 ACE_INLINE ACE_CDR::Boolean
1278 operator<< (ACE_OutputCDR &os, ACE_CDR::Short x)
1281 return os.good_bit ();
1284 ACE_INLINE ACE_CDR::Boolean
1285 operator<< (ACE_OutputCDR &os, ACE_CDR::UShort x)
1287 os.write_ushort (x);
1288 return os.good_bit ();
1291 ACE_INLINE ACE_CDR::Boolean
1292 operator<< (ACE_OutputCDR &os, ACE_CDR::Long x)
1295 return os.good_bit ();
1298 ACE_INLINE ACE_CDR::Boolean
1299 operator<< (ACE_OutputCDR &os, ACE_CDR::ULong x)
1302 return os.good_bit ();
1305 ACE_INLINE ACE_CDR::Boolean
1306 operator<< (ACE_OutputCDR &os, ACE_CDR::LongLong x)
1308 os.write_longlong (x);
1309 return os.good_bit ();
1312 ACE_INLINE ACE_CDR::Boolean
1313 operator<< (ACE_OutputCDR &os, ACE_CDR::ULongLong x)
1315 os.write_ulonglong (x);
1316 return os.good_bit ();
1319 ACE_INLINE ACE_CDR::Boolean
1320 operator<< (ACE_OutputCDR &os, ACE_CDR::LongDouble x)
1322 os.write_longdouble (x);
1323 return os.good_bit ();
1326 ACE_INLINE ACE_CDR::Boolean
1327 operator<< (ACE_OutputCDR &os, ACE_CDR::Float x)
1330 return os.good_bit ();
1333 ACE_INLINE ACE_CDR::Boolean
1334 operator<< (ACE_OutputCDR &os, ACE_CDR::Double x)
1336 os.write_double (x);
1337 return os.good_bit ();
1340 ACE_INLINE ACE_CDR::Boolean
1341 operator<< (ACE_OutputCDR &os, const ACE_CDR::Fixed &x)
1344 return os.good_bit ();
1347 ACE_INLINE ACE_CDR::Boolean
1348 operator<< (ACE_OutputCDR &os, const ACE_CDR::Char *x)
1350 os.write_string (x);
1351 return os.good_bit ();
1354 ACE_INLINE ACE_CDR::Boolean
1355 operator<< (ACE_OutputCDR &os, const ACE_CDR::WChar *x)
1357 os.write_wstring (x);
1358 return os.good_bit ();
1361 ACE_INLINE ACE_CDR::Boolean
1362 operator<< (ACE_OutputCDR &os, ACE_OutputCDR::from_std_string x)
1364 ACE_CDR::ULong const len = static_cast<ACE_CDR::ULong> (x.val_.size ());
1366 os.write_string (len, x.val_.c_str ());
1367 return (os.good_bit () && (!x.bound_ || len <= x.bound_));
1370 #if !defined(ACE_LACKS_STD_WSTRING)
1371 ACE_INLINE ACE_CDR::Boolean
1372 operator<< (ACE_OutputCDR &os, ACE_OutputCDR::from_std_wstring x)
1374 ACE_CDR::ULong const len = static_cast<ACE_CDR::ULong> (x.val_.size ());
1376 os.write_wstring (len, x.val_.c_str ());
1377 return (os.good_bit () && (!x.bound_ || len <= x.bound_));
1381 ACE_INLINE ACE_CDR::Boolean
1382 operator<< (ACE_OutputCDR &os, const std::string& x)
1384 os.write_string (x);
1385 return os.good_bit ();
1388 #if !defined(ACE_LACKS_STD_WSTRING)
1389 ACE_INLINE ACE_CDR::Boolean
1390 operator<< (ACE_OutputCDR &os, const std::wstring& x)
1392 os.write_wstring (x);
1393 return os.good_bit ();
1397 // The following use the helper classes
1398 ACE_INLINE ACE_CDR::Boolean
1399 operator<< (ACE_OutputCDR &os, ACE_OutputCDR::from_boolean x)
1401 (void) os.write_boolean (x.val_);
1402 return os.good_bit ();
1405 ACE_INLINE ACE_CDR::Boolean
1406 operator<< (ACE_OutputCDR &os, ACE_OutputCDR::from_char x)
1408 os.write_char (x.val_);
1409 return os.good_bit ();
1412 ACE_INLINE ACE_CDR::Boolean
1413 operator<< (ACE_OutputCDR &os, ACE_OutputCDR::from_wchar x)
1415 os.write_wchar (x.val_);
1416 return os.good_bit ();
1419 ACE_INLINE ACE_CDR::Boolean
1420 operator<< (ACE_OutputCDR &os, ACE_OutputCDR::from_octet x)
1422 os.write_octet (x.val_);
1423 return os.good_bit ();
1426 ACE_INLINE ACE_CDR::Boolean
1427 operator<< (ACE_OutputCDR &os, ACE_OutputCDR::from_string x)
1429 ACE_CDR::ULong len = 0;
1433 len = static_cast<ACE_CDR::ULong> (ACE_OS::strlen (x.val_));
1436 os.write_string (len, x.val_);
1437 return (os.good_bit () && (!x.bound_ || len <= x.bound_));
1440 ACE_INLINE ACE_CDR::Boolean
1441 operator<< (ACE_OutputCDR &os, ACE_OutputCDR::from_wstring x)
1443 ACE_CDR::ULong len = 0;
1447 len = static_cast<ACE_CDR::ULong> (ACE_OS::strlen (x.val_));
1450 os.write_wstring (len, x.val_);
1451 return (os.good_bit () && (!x.bound_ || len <= x.bound_));
1454 ACE_INLINE ACE_CDR::Boolean
1455 operator<< (ACE_OutputCDR &os, ACE_OutputCDR::from_uint8 x)
1457 os.write_uint8 (x.val_);
1458 return os.good_bit ();
1461 ACE_INLINE ACE_CDR::Boolean
1462 operator<< (ACE_OutputCDR &os, ACE_OutputCDR::from_int8 x)
1464 os.write_int8 (x.val_);
1465 return os.good_bit ();
1468 // ****************************************************************
1470 ACE_INLINE ACE_CDR::Boolean
1471 operator>> (ACE_InputCDR &is, ACE_CDR::Char &x)
1473 return is.read_char (x) && is.good_bit ();
1476 ACE_INLINE ACE_CDR::Boolean
1477 operator>> (ACE_InputCDR &is, ACE_CDR::Short &x)
1479 return is.read_short (x) && is.good_bit ();
1482 ACE_INLINE ACE_CDR::Boolean
1483 operator>> (ACE_InputCDR &is, ACE_CDR::UShort &x)
1485 return is.read_ushort (x) && is.good_bit ();
1488 ACE_INLINE ACE_CDR::Boolean
1489 operator>>(ACE_InputCDR &is, ACE_CDR::Long &x)
1491 return is.read_long (x) && is.good_bit ();
1494 ACE_INLINE ACE_CDR::Boolean
1495 operator>> (ACE_InputCDR &is, ACE_CDR::ULong &x)
1497 return is.read_ulong (x) && is.good_bit ();
1500 ACE_INLINE ACE_CDR::Boolean
1501 operator>> (ACE_InputCDR& is, ACE_CDR::LongLong &x)
1503 return is.read_longlong (x) && is.good_bit ();
1506 ACE_INLINE ACE_CDR::Boolean
1507 operator>> (ACE_InputCDR& is, ACE_CDR::ULongLong &x)
1509 return is.read_ulonglong (x) && is.good_bit ();
1512 ACE_INLINE ACE_CDR::Boolean
1513 operator>> (ACE_InputCDR& is, ACE_CDR::LongDouble &x)
1515 return is.read_longdouble (x) && is.good_bit ();
1518 ACE_INLINE ACE_CDR::Boolean
1519 operator>> (ACE_InputCDR &is, ACE_CDR::Float &x)
1521 return is.read_float (x) && is.good_bit ();
1524 ACE_INLINE ACE_CDR::Boolean
1525 operator>> (ACE_InputCDR &is, ACE_CDR::Double &x)
1527 return is.read_double (x) && is.good_bit ();
1530 ACE_INLINE ACE_CDR::Boolean
1531 operator>> (ACE_InputCDR &is, ACE_CDR::Fixed &x)
1533 return is.read_fixed (x) && is.good_bit ();
1536 ACE_INLINE ACE_CDR::Boolean
1537 operator>> (ACE_InputCDR &is, ACE_CDR::Char *&x)
1539 return is.read_string (x) && is.good_bit ();
1542 ACE_INLINE ACE_CDR::Boolean
1543 operator>> (ACE_InputCDR &is, ACE_CDR::WChar *&x)
1545 return is.read_wstring (x) && is.good_bit ();
1548 ACE_INLINE ACE_CDR::Boolean
1549 operator>> (ACE_InputCDR &is, std::string& x)
1551 return is.read_string (x) && is.good_bit ();
1554 #if !defined(ACE_LACKS_STD_WSTRING)
1555 ACE_INLINE ACE_CDR::Boolean
1556 operator>> (ACE_InputCDR &is, std::wstring& x)
1558 return is.read_wstring (x) && is.good_bit ();
1562 // The following use the helper classes
1563 ACE_INLINE ACE_CDR::Boolean
1564 operator>> (ACE_InputCDR &is, ACE_InputCDR::to_boolean x)
1566 return is.read_boolean (x.ref_);
1569 ACE_INLINE ACE_CDR::Boolean
1570 operator>> (ACE_InputCDR &is, ACE_InputCDR::to_char x)
1572 return is.read_char (x.ref_) && is.good_bit ();
1575 ACE_INLINE ACE_CDR::Boolean
1576 operator>> (ACE_InputCDR &is, ACE_InputCDR::to_wchar x)
1578 return is.read_wchar (x.ref_) && is.good_bit ();
1581 ACE_INLINE ACE_CDR::Boolean
1582 operator>> (ACE_InputCDR &is, ACE_InputCDR::to_octet x)
1584 return is.read_octet (x.ref_) && is.good_bit ();
1587 ACE_INLINE ACE_CDR::Boolean
1588 operator>> (ACE_InputCDR &is, ACE_InputCDR::to_string x)
1590 // check if the bounds are satisfied
1592 (is.read_string (const_cast<char *&> (x.val_))
1595 || ACE_OS::strlen (x.val_) <= x.bound_));
1598 ACE_INLINE ACE_CDR::Boolean
1599 operator>> (ACE_InputCDR &is, ACE_InputCDR::to_wstring x)
1601 // check if the bounds are satisfied
1603 (is.read_wstring (const_cast<ACE_CDR::WChar *&> (x.val_))
1606 || ACE_OS::strlen (x.val_) <= x.bound_));
1609 ACE_INLINE ACE_CDR::Boolean
1610 operator>> (ACE_InputCDR &is, ACE_InputCDR::to_std_string x)
1612 // check if the bounds are satisfied
1614 (is.read_string (x.val_)
1617 || static_cast<ACE_CDR::ULong> (x.val_.size ()) <= x.bound_));
1620 #if !defined(ACE_LACKS_STD_WSTRING)
1621 ACE_INLINE ACE_CDR::Boolean
1622 operator>> (ACE_InputCDR &is, ACE_InputCDR::to_std_wstring x)
1624 // check if the bounds are satisfied
1626 (is.read_wstring (x.val_)
1629 || static_cast<ACE_CDR::ULong> (x.val_.size ()) <= x.bound_));
1633 ACE_INLINE ACE_CDR::Boolean
1634 operator>> (ACE_InputCDR &is, ACE_InputCDR::to_uint8 x)
1636 return is.read_uint8 (x.ref_) && is.good_bit ();
1639 ACE_INLINE ACE_CDR::Boolean
1640 operator>> (ACE_InputCDR &is, ACE_InputCDR::to_int8 x)
1642 return is.read_int8 (x.ref_) && is.good_bit ();
1645 // ***************************************************************************
1646 // We must define these methods here because they use the "read_*" inlined
1647 // methods of the ACE_InputCDR class
1648 // ***************************************************************************
1650 ACE_INLINE ACE_CDR::Boolean
1651 ACE_OutputCDR::append_boolean (ACE_InputCDR &stream)
1654 return stream.read_boolean (x) ? this->write_boolean (x) : false;
1657 ACE_INLINE ACE_CDR::Boolean
1658 ACE_OutputCDR::append_char (ACE_InputCDR &stream)
1661 return stream.read_char (x) ? this->write_char (x) : false;
1664 ACE_INLINE ACE_CDR::Boolean
1665 ACE_OutputCDR::append_wchar (ACE_InputCDR &stream)
1668 return stream.read_wchar (x) ? this->write_wchar (x) : false;
1671 ACE_INLINE ACE_CDR::Boolean
1672 ACE_OutputCDR::append_octet (ACE_InputCDR &stream)
1675 return stream.read_octet (x) ? this->write_octet (x) : false;
1678 ACE_INLINE ACE_CDR::Boolean
1679 ACE_OutputCDR::append_short (ACE_InputCDR &stream)
1682 return stream.read_short (x) ? this->write_short (x) : false;
1685 ACE_INLINE ACE_CDR::Boolean
1686 ACE_OutputCDR::append_ushort (ACE_InputCDR &stream)
1689 return stream.read_ushort (x) ? this->write_ushort (x) : false;
1692 ACE_INLINE ACE_CDR::Boolean
1693 ACE_OutputCDR::append_long (ACE_InputCDR &stream)
1696 return stream.read_long (x) ? this->write_long (x) : false;
1699 ACE_INLINE ACE_CDR::Boolean
1700 ACE_OutputCDR::append_ulong (ACE_InputCDR &stream)
1703 return stream.read_ulong (x) ? this->write_ulong (x) : false;
1706 ACE_INLINE ACE_CDR::Boolean
1707 ACE_OutputCDR::append_longlong (ACE_InputCDR &stream)
1709 ACE_CDR::LongLong x;
1710 return stream.read_longlong (x) ? this->write_longlong (x) : false;
1713 ACE_INLINE ACE_CDR::Boolean
1714 ACE_OutputCDR::append_ulonglong (ACE_InputCDR &stream)
1716 ACE_CDR::ULongLong x;
1717 return stream.read_ulonglong (x) ? this->write_ulonglong (x) : false;
1720 ACE_INLINE ACE_CDR::Boolean
1721 ACE_OutputCDR::append_float (ACE_InputCDR &stream)
1724 return stream.read_float (x) ? this->write_float (x) : false;
1727 ACE_INLINE ACE_CDR::Boolean
1728 ACE_OutputCDR::append_double (ACE_InputCDR &stream)
1731 return stream.read_double (x) ? this->write_double (x) : false;
1734 ACE_INLINE ACE_CDR::Boolean
1735 ACE_OutputCDR::append_longdouble (ACE_InputCDR &stream)
1737 ACE_CDR::LongDouble x;
1738 return stream.read_longdouble (x) ? this->write_longdouble (x) : false;
1741 ACE_INLINE ACE_CDR::Boolean
1742 ACE_OutputCDR::append_fixed (ACE_InputCDR &stream)
1745 return stream.read_fixed (x) ? this->write_fixed (x) : false;
1748 ACE_INLINE ACE_CDR::Boolean
1749 ACE_OutputCDR::append_string (ACE_InputCDR &stream)
1751 ACE_CDR::Char *x = 0;
1752 ACE_CDR::Boolean const flag =
1753 (stream.read_string (x) ? this->write_string (x) : false);
1754 #if defined (ACE_HAS_ALLOC_HOOKS)
1755 ACE_Allocator::instance()->free(x);
1758 #endif /* ACE_HAS_ALLOC_HOOKS */
1762 ACE_INLINE ACE_CDR::Boolean
1763 ACE_OutputCDR::append_wstring (ACE_InputCDR &stream)
1765 ACE_CDR::WChar *x = 0;
1766 ACE_CDR::Boolean const flag =
1767 (stream.read_wstring (x) ? this->write_wstring (x) : false);
1768 #if defined (ACE_HAS_ALLOC_HOOKS)
1769 ACE_Allocator::instance()->free(x);
1772 #endif /* ACE_HAS_ALLOC_HOOKS */
1777 ACE_InputCDR::reset_byte_order (int byte_order)
1779 this->do_byte_swap_ = (byte_order != ACE_CDR_BYTE_ORDER);
1783 ACE_InputCDR::do_byte_swap () const
1785 return this->do_byte_swap_;
1789 ACE_InputCDR::byte_order () const
1791 return this->do_byte_swap () ? !ACE_CDR_BYTE_ORDER : ACE_CDR_BYTE_ORDER;
1795 ACE_InputCDR::align_read_ptr (size_t alignment)
1797 #if !defined (ACE_LACKS_CDR_ALIGNMENT)
1798 char *buf = ACE_ptr_align_binary (this->rd_ptr (),
1801 char *buf = this->rd_ptr ();
1802 #endif /* ACE_LACKS_CDR_ALIGNMENT */
1804 if (buf <= this->wr_ptr ())
1806 this->start_.rd_ptr (buf);
1810 this->good_bit_ = false;
1815 ACE_InputCDR::set_version (ACE_CDR::Octet major, ACE_CDR::Octet minor)
1817 this->major_version_ = major;
1818 this->minor_version_ = minor;
1822 ACE_InputCDR::get_version (ACE_CDR::Octet &major, ACE_CDR::Octet &minor)
1824 major = this->major_version_;
1825 minor = this->minor_version_;
1828 ACE_INLINE ACE_Char_Codeset_Translator *
1829 ACE_InputCDR::char_translator () const
1831 return this->char_translator_;
1834 ACE_INLINE ACE_WChar_Codeset_Translator *
1835 ACE_InputCDR::wchar_translator () const
1837 return this->wchar_translator_;
1842 ACE_InputCDR::char_translator (ACE_Char_Codeset_Translator * ctran)
1844 this->char_translator_ = ctran;
1848 ACE_InputCDR::wchar_translator (ACE_WChar_Codeset_Translator * wctran)
1850 this->wchar_translator_ = wctran;
1853 // ****************************************************************
1855 ACE_INLINE ACE_CDR::Boolean
1856 ACE_Char_Codeset_Translator::read_1 (ACE_InputCDR& input,
1859 return input.read_1 (x);
1862 ACE_INLINE ACE_CDR::Boolean
1863 ACE_Char_Codeset_Translator::write_1 (ACE_OutputCDR& output,
1864 const ACE_CDR::Octet *x)
1866 return output.write_1 (x);
1869 ACE_INLINE ACE_CDR::Boolean
1870 ACE_Char_Codeset_Translator::read_array (ACE_InputCDR& in,
1874 ACE_CDR::ULong length)
1876 return in.read_array (x, size, align, length);
1879 ACE_INLINE ACE_CDR::Boolean
1880 ACE_Char_Codeset_Translator::write_array (ACE_OutputCDR& out,
1884 ACE_CDR::ULong length)
1886 return out.write_array(x, size, align, length);
1890 ACE_Char_Codeset_Translator::adjust (ACE_OutputCDR& out,
1895 return out.adjust(size, align, buf);
1899 ACE_Char_Codeset_Translator::good_bit (ACE_OutputCDR& out, bool bit)
1901 out.good_bit_ = bit;
1904 ACE_INLINE ACE_CDR::Octet
1905 ACE_Char_Codeset_Translator::major_version (ACE_InputCDR& input)
1907 return input.major_version_;
1910 ACE_INLINE ACE_CDR::Octet
1911 ACE_Char_Codeset_Translator::minor_version (ACE_InputCDR& input)
1913 return input.minor_version_;
1916 ACE_INLINE ACE_CDR::Octet
1917 ACE_Char_Codeset_Translator::major_version (ACE_OutputCDR& output)
1919 return output.major_version_;
1922 ACE_INLINE ACE_CDR::Octet
1923 ACE_Char_Codeset_Translator::minor_version (ACE_OutputCDR& output)
1925 return output.minor_version_;
1928 // ****************************************************************
1930 ACE_INLINE ACE_CDR::Boolean
1931 ACE_WChar_Codeset_Translator::read_1 (ACE_InputCDR& input,
1934 return input.read_1 (x);
1937 ACE_INLINE ACE_CDR::Boolean
1938 ACE_WChar_Codeset_Translator::read_2 (ACE_InputCDR& input,
1941 return input.read_2 (x);
1944 ACE_INLINE ACE_CDR::Boolean
1945 ACE_WChar_Codeset_Translator::read_4 (ACE_InputCDR& input,
1948 return input.read_4 (x);
1951 ACE_INLINE ACE_CDR::Boolean
1952 ACE_WChar_Codeset_Translator::write_1 (ACE_OutputCDR& output,
1953 const ACE_CDR::Octet *x)
1955 return output.write_1 (x);
1958 ACE_INLINE ACE_CDR::Boolean
1959 ACE_WChar_Codeset_Translator::write_2 (ACE_OutputCDR& output,
1960 const ACE_CDR::UShort *x)
1962 return output.write_2 (x);
1965 ACE_INLINE ACE_CDR::Boolean
1966 ACE_WChar_Codeset_Translator::write_4 (ACE_OutputCDR& output,
1967 const ACE_CDR::ULong *x)
1969 return output.write_4 (x);
1972 ACE_INLINE ACE_CDR::Boolean
1973 ACE_WChar_Codeset_Translator::read_array (ACE_InputCDR& in,
1977 ACE_CDR::ULong length)
1979 return in.read_array (x, size, align, length);
1982 ACE_INLINE ACE_CDR::Boolean
1983 ACE_WChar_Codeset_Translator::write_array (ACE_OutputCDR& out,
1987 ACE_CDR::ULong length)
1989 return out.write_array(x, size, align, length);
1993 ACE_WChar_Codeset_Translator::adjust (ACE_OutputCDR& out,
1998 return out.adjust(size, align, buf);
2002 ACE_WChar_Codeset_Translator::good_bit (ACE_OutputCDR& out, bool bit)
2004 out.good_bit_ = bit;
2007 ACE_INLINE ACE_CDR::Octet
2008 ACE_WChar_Codeset_Translator::major_version (ACE_InputCDR& input)
2010 return input.major_version_;
2013 ACE_INLINE ACE_CDR::Octet
2014 ACE_WChar_Codeset_Translator::minor_version (ACE_InputCDR& input)
2016 return input.minor_version_;
2019 ACE_INLINE ACE_CDR::Octet
2020 ACE_WChar_Codeset_Translator::major_version (ACE_OutputCDR& output)
2022 return output.major_version_;
2025 ACE_INLINE ACE_CDR::Octet
2026 ACE_WChar_Codeset_Translator::minor_version (ACE_OutputCDR& output)
2028 return output.minor_version_;
2031 ACE_END_VERSIONED_NAMESPACE_DECL