summaryrefslogtreecommitdiff
path: root/ace/CDR_Stream.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ace/CDR_Stream.cpp')
-rw-r--r--ace/CDR_Stream.cpp340
1 files changed, 169 insertions, 171 deletions
diff --git a/ace/CDR_Stream.cpp b/ace/CDR_Stream.cpp
index 9b313446eed..0f4ed8875fc 100644
--- a/ace/CDR_Stream.cpp
+++ b/ace/CDR_Stream.cpp
@@ -40,7 +40,7 @@
#endif /* ! __ACE_INLINE__ */
int
-ACE_CDR::grow (ACE_Message_Block *mb, size_t minsize)
+CDR::grow (ACE_Message_Block *mb, size_t minsize)
{
// Calculate the new buffer's length; if growing for encode, we
// don't grow in "small" chunks because of the cost.
@@ -53,31 +53,31 @@ ACE_CDR::grow (ACE_Message_Block *mb, size_t minsize)
// TODO The growth strategy should be controlled using
// the ORB parameters....
if (newsize == 0)
- newsize = ACE_CDR::DEFAULT_BUFSIZE;
- else if (size < ACE_CDR::EXP_GROWTH_MAX)
+ newsize = CDR::DEFAULT_BUFSIZE;
+ else if (size < CDR::EXP_GROWTH_MAX)
newsize *= 2;
else
- newsize += ACE_CDR::LINEAR_GROWTH_CHUNK;
+ newsize += CDR::LINEAR_GROWTH_CHUNK;
}
- else if (minsize + ACE_CDR::MAX_ALIGNMENT <= size)
+ else if (minsize + CDR::MAX_ALIGNMENT <= size)
return 0;
else
{
if (newsize == 0)
- newsize = ACE_CDR::DEFAULT_BUFSIZE;
+ newsize = CDR::DEFAULT_BUFSIZE;
- while (newsize < minsize + ACE_CDR::MAX_ALIGNMENT)
+ while (newsize < minsize + CDR::MAX_ALIGNMENT)
{
- if (newsize < ACE_CDR::EXP_GROWTH_MAX)
+ if (newsize < CDR::EXP_GROWTH_MAX)
newsize *= 2;
else
- newsize += ACE_CDR::LINEAR_GROWTH_CHUNK;
+ newsize += CDR::LINEAR_GROWTH_CHUNK;
}
}
ACE_Message_Block tmp (newsize);
- ACE_CDR::mb_align (&tmp);
+ CDR::mb_align (&tmp);
tmp.copy (mb->rd_ptr (), mb->length());
mb->data_block (tmp.data_block ()->duplicate ());
@@ -87,29 +87,15 @@ ACE_CDR::grow (ACE_Message_Block *mb, size_t minsize)
return 0;
}
-size_t
-ACE_CDR::total_length (const ACE_Message_Block* begin,
- const ACE_Message_Block* end)
-{
- size_t l = 0;
- // Compute the total size.
- for (const ACE_Message_Block *i = begin;
- i != end;
- i = i->cont ())
- l += i->length ();
- return l;
-}
-
-
#if defined (NONNATIVE_LONGDOUBLE)
int
-ACE_CDR::LongDouble::operator== (const ACE_CDR::LongDouble &rhs) const
+CDR::LongDouble::operator== (const CDR::LongDouble &rhs) const
{
return ACE_OS::memcmp (this->ld, rhs.ld, 16) == 0;
}
int
-ACE_CDR::LongDouble::operator!= (const ACE_CDR::LongDouble &rhs) const
+CDR::LongDouble::operator!= (const CDR::LongDouble &rhs) const
{
return ACE_OS::memcmp (this->ld, rhs.ld, 16) != 0;
}
@@ -122,7 +108,7 @@ ACE_OutputCDR::ACE_OutputCDR (size_t size,
ACE_Allocator *buffer_allocator,
ACE_Allocator *data_block_allocator,
size_t memcpy_tradeoff)
- : start_ (size ? size : ACE_CDR::DEFAULT_BUFSIZE + ACE_CDR::MAX_ALIGNMENT,
+ : start_ (size ? size : CDR::DEFAULT_BUFSIZE + CDR::MAX_ALIGNMENT,
ACE_Message_Block::MB_DATA,
0,
0,
@@ -136,7 +122,7 @@ ACE_OutputCDR::ACE_OutputCDR (size_t size,
good_bit_ (1),
memcpy_tradeoff_ (memcpy_tradeoff)
{
- ACE_CDR::mb_align (&this->start_);
+ CDR::mb_align (&this->start_);
this->current_ = &this->start_;
}
@@ -160,7 +146,7 @@ ACE_OutputCDR::ACE_OutputCDR (char *data, size_t size,
memcpy_tradeoff_ (memcpy_tradeoff)
{
// We cannot trust the buffer to be properly aligned
- ACE_CDR::mb_align (&this->start_);
+ CDR::mb_align (&this->start_);
this->current_ = &this->start_;
}
@@ -173,26 +159,55 @@ ACE_OutputCDR::ACE_OutputCDR (ACE_Message_Block *data,
memcpy_tradeoff_ (memcpy_tradeoff)
{
// We cannot trust the buffer to be properly aligned
- ACE_CDR::mb_align (&this->start_);
+ CDR::mb_align (&this->start_);
this->current_ = &this->start_;
}
+ACE_OutputCDR::~ACE_OutputCDR (void)
+{
+ if (this->start_.cont () != 0)
+ {
+ ACE_Message_Block::release (this->start_.cont ());
+ this->start_.cont (0);
+ }
+ this->current_ = 0;
+}
+
+void
+ACE_OutputCDR::reset (void)
+{
+ this->current_ = &this->start_;
+ CDR::mb_align (&this->start_);
+}
+
+size_t
+ACE_OutputCDR::total_length (void) const
+{
+ size_t l = 0;
+ // Compute the total size.
+ for (const ACE_Message_Block *i = this->begin ();
+ i != this->end ();
+ i = i->cont ())
+ l += i->length ();
+ return l;
+}
+
int
ACE_OutputCDR::grow_and_adjust (size_t size,
size_t align,
char*& buf)
{
if (this->current_->cont () == 0
- || this->current_->cont ()->size () < size + ACE_CDR::MAX_ALIGNMENT)
+ || this->current_->cont ()->size () < size + CDR::MAX_ALIGNMENT)
{
// Allocate the next block, it must be large enough.
- size_t block_size = ACE_CDR::DEFAULT_BUFSIZE;
- while (block_size < size + ACE_CDR::MAX_ALIGNMENT)
+ size_t block_size = CDR::DEFAULT_BUFSIZE;
+ while (block_size < size + CDR::MAX_ALIGNMENT)
{
- if (block_size < ACE_CDR::EXP_GROWTH_MAX)
+ if (block_size < CDR::EXP_GROWTH_MAX)
block_size *= 2;
else
- block_size += ACE_CDR::LINEAR_GROWTH_CHUNK;
+ block_size += CDR::LINEAR_GROWTH_CHUNK;
}
this->good_bit_ = 0;
ACE_Message_Block* tmp;
@@ -213,12 +228,12 @@ ACE_OutputCDR::grow_and_adjust (size_t size,
// The new block must start with the same alignment as the
// previous block finished.
ptr_arith_t tmpalign =
- ptr_arith_t(tmp->wr_ptr ()) % ACE_CDR::MAX_ALIGNMENT;
+ ptr_arith_t(tmp->wr_ptr ()) % CDR::MAX_ALIGNMENT;
ptr_arith_t curalign =
- ptr_arith_t(this->current_->wr_ptr ()) % ACE_CDR::MAX_ALIGNMENT;
+ ptr_arith_t(this->current_->wr_ptr ()) % CDR::MAX_ALIGNMENT;
int offset = curalign - tmpalign;
if (offset < 0)
- offset += ACE_CDR::MAX_ALIGNMENT;
+ offset += CDR::MAX_ALIGNMENT;
tmp->rd_ptr (offset);
tmp->wr_ptr (tmp->rd_ptr ());
@@ -230,13 +245,13 @@ ACE_OutputCDR::grow_and_adjust (size_t size,
// Now we are ready to set buf..
// recompute the position....
- buf = ptr_align_binary (this->current_->wr_ptr (), align);
+ buf = ptr_align_binary (this->current_->wr_ptr(), align);
this->current_->wr_ptr (buf + size);
return 0;
}
-ACE_CDR::Boolean
-ACE_OutputCDR::write_string (ACE_CDR::ULong len,
+CDR::Boolean
+ACE_OutputCDR::write_string (CDR::ULong len,
const char *x)
{
if (len != 0)
@@ -261,9 +276,9 @@ ACE_OutputCDR::write_string (ACE_CDR::ULong len,
return 0;
}
-ACE_CDR::Boolean
-ACE_OutputCDR::write_wstring (ACE_CDR::ULong len,
- const ACE_CDR::WChar *x)
+CDR::Boolean
+ACE_OutputCDR::write_wstring (CDR::ULong len,
+ const CDR::WChar *x)
{
if (x != 0)
{
@@ -282,7 +297,7 @@ ACE_OutputCDR::write_wstring (ACE_CDR::ULong len,
return 0;
}
-ACE_CDR::Boolean
+CDR::Boolean
ACE_OutputCDR::write_octet_array_mb (const ACE_Message_Block* mb)
{
// If the buffer is small and it fits in the current message
@@ -298,8 +313,8 @@ ACE_OutputCDR::write_octet_array_mb (const ACE_Message_Block* mb)
ACE_Message_Block::DONT_DELETE))
{
if (! this->write_array (i->rd_ptr (),
- ACE_CDR::OCTET_SIZE,
- ACE_CDR::OCTET_ALIGN,
+ CDR::OCTET_SIZE,
+ CDR::OCTET_ALIGN,
length))
{
return 0;
@@ -311,8 +326,8 @@ ACE_OutputCDR::write_octet_array_mb (const ACE_Message_Block* mb)
&& this->current_->wr_ptr () + length < this->current_->end ())
{
if (! this->write_array (i->rd_ptr (),
- ACE_CDR::OCTET_SIZE,
- ACE_CDR::OCTET_ALIGN,
+ CDR::OCTET_SIZE,
+ CDR::OCTET_ALIGN,
length))
{
return 0;
@@ -320,15 +335,12 @@ ACE_OutputCDR::write_octet_array_mb (const ACE_Message_Block* mb)
continue;
}
- ACE_Message_Block* cont =
- new ACE_Message_Block (i->data_block ()->duplicate ());
+ ACE_Message_Block* cont = ACE_Message_Block::duplicate (i);
if (cont != 0)
{
cont->cont (this->current_->cont ());
this->current_->cont (cont);
this->current_ = cont;
- cont->rd_ptr (i->rd_ptr ());
- cont->wr_ptr (i->wr_ptr ());
}
else
{
@@ -339,37 +351,37 @@ ACE_OutputCDR::write_octet_array_mb (const ACE_Message_Block* mb)
return 1;
}
-ACE_CDR::Boolean
-ACE_OutputCDR::write_1 (const ACE_CDR::Octet *x)
+CDR::Boolean
+ACE_OutputCDR::write_1 (const CDR::Octet *x)
{
char *buf;
if (this->adjust (1, buf) == 0)
{
- *ACE_reinterpret_cast(ACE_CDR::Octet*, buf) = *x;
+ *ACE_reinterpret_cast(CDR::Octet*, buf) = *x;
return 1;
}
return 0;
}
-ACE_CDR::Boolean
-ACE_OutputCDR::write_2 (const ACE_CDR::UShort *x)
+CDR::Boolean
+ACE_OutputCDR::write_2 (const CDR::UShort *x)
{
char *buf;
- if (this->adjust (ACE_CDR::SHORT_SIZE, buf) == 0)
+ if (this->adjust (CDR::SHORT_SIZE, buf) == 0)
{
#if !defined (ACE_ENABLE_SWAP_ON_WRITE)
- *ACE_reinterpret_cast(ACE_CDR::UShort*,buf) = *x;
+ *ACE_reinterpret_cast(CDR::UShort*,buf) = *x;
return 1;
#else
if (!this->do_byte_swap_)
{
- *ACE_reinterpret_cast (ACE_CDR::UShort *, buf) = *x;
+ *ACE_reinterpret_cast (CDR::UShort *, buf) = *x;
return 1;
}
else
{
- ACE_CDR::swap_2 (ACE_reinterpret_cast (const char*, x), buf);
+ CDR::swap_2 (ACE_reinterpret_cast (const char*, x), buf);
return 1;
}
#endif /* ACE_ENABLE_SWAP_ON_WRITE */
@@ -378,24 +390,24 @@ ACE_OutputCDR::write_2 (const ACE_CDR::UShort *x)
return 0;
}
-ACE_CDR::Boolean
-ACE_OutputCDR::write_4 (const ACE_CDR::ULong *x)
+CDR::Boolean
+ACE_OutputCDR::write_4 (const CDR::ULong *x)
{
char *buf;
- if (this->adjust (ACE_CDR::LONG_SIZE, buf) == 0)
+ if (this->adjust (CDR::LONG_SIZE, buf) == 0)
{
#if !defined (ACE_ENABLE_SWAP_ON_WRITE)
- *ACE_reinterpret_cast(ACE_CDR::ULong*,buf) = *x;
+ *ACE_reinterpret_cast(CDR::ULong*,buf) = *x;
return 1;
#else
if (!this->do_byte_swap_)
{
- *ACE_reinterpret_cast (ACE_CDR::ULong *, buf) = *x;
+ *ACE_reinterpret_cast (CDR::ULong *, buf) = *x;
return 1;
}
else
{
- ACE_CDR::swap_4 (ACE_reinterpret_cast (const char*, x), buf);
+ CDR::swap_4 (ACE_reinterpret_cast (const char*, x), buf);
return 1;
}
#endif /* ACE_ENABLE_SWAP_ON_WRITE */
@@ -404,24 +416,24 @@ ACE_OutputCDR::write_4 (const ACE_CDR::ULong *x)
return 0;
}
-ACE_CDR::Boolean
-ACE_OutputCDR::write_8 (const ACE_CDR::ULongLong *x)
+CDR::Boolean
+ACE_OutputCDR::write_8 (const CDR::ULongLong *x)
{
char *buf;
- if (this->adjust (ACE_CDR::LONGLONG_SIZE, buf) == 0)
+ if (this->adjust (CDR::LONGLONG_SIZE, buf) == 0)
{
#if !defined (ACE_ENABLE_SWAP_ON_WRITE)
- *ACE_reinterpret_cast(ACE_CDR::ULongLong*,buf) = *x;
+ *ACE_reinterpret_cast(CDR::ULongLong*,buf) = *x;
return 1;
#else
if (!this->do_byte_swap_)
{
- *ACE_reinterpret_cast (ACE_CDR::ULongLong *, buf) = *x;
+ *ACE_reinterpret_cast (CDR::ULongLong *, buf) = *x;
return 1;
}
else
{
- ACE_CDR::swap_8 (ACE_reinterpret_cast (const char*, x), buf);
+ CDR::swap_8 (ACE_reinterpret_cast (const char*, x), buf);
return 1;
}
#endif /* ACE_ENABLE_SWAP_ON_WRITE */
@@ -430,26 +442,26 @@ ACE_OutputCDR::write_8 (const ACE_CDR::ULongLong *x)
return 0;
}
-ACE_CDR::Boolean
-ACE_OutputCDR::write_16 (const ACE_CDR::LongDouble *x)
+CDR::Boolean
+ACE_OutputCDR::write_16 (const CDR::LongDouble *x)
{
char* buf;
- if (this->adjust (ACE_CDR::LONGDOUBLE_SIZE,
- ACE_CDR::LONGDOUBLE_ALIGN,
+ if (this->adjust (CDR::LONGDOUBLE_SIZE,
+ CDR::LONGDOUBLE_ALIGN,
buf) == 0)
{
#if !defined (ACE_ENABLE_SWAP_ON_WRITE)
- *ACE_reinterpret_cast(ACE_CDR::LongDouble*,buf) = *x;
+ *ACE_reinterpret_cast(CDR::LongDouble*,buf) = *x;
return 1;
#else
if (!this->do_byte_swap_)
{
- *ACE_reinterpret_cast (ACE_CDR::LongDouble *, buf) = *x;
+ *ACE_reinterpret_cast (CDR::LongDouble *, buf) = *x;
return 1;
}
else
{
- ACE_CDR::swap_16 (ACE_reinterpret_cast (const char*, x), buf);
+ CDR::swap_16 (ACE_reinterpret_cast (const char*, x), buf);
return 1;
}
#endif /* ACE_ENABLE_SWAP_ON_WRITE */
@@ -458,11 +470,11 @@ ACE_OutputCDR::write_16 (const ACE_CDR::LongDouble *x)
return 0;
}
-ACE_CDR::Boolean
+CDR::Boolean
ACE_OutputCDR::write_array (const void *x,
- size_t size,
- size_t align,
- ACE_CDR::ULong length)
+ size_t size,
+ size_t align,
+ CDR::ULong length)
{
char *buf;
if (this->adjust (size * length, align, buf) == 0)
@@ -471,7 +483,7 @@ ACE_OutputCDR::write_array (const void *x,
ACE_OS::memcpy (buf, x, size*length);
return 1;
#else
- if (!this->do_byte_swap_ || size == 1)
+ if (!this->do_byte_swap_)
{
ACE_OS::memcpy (buf, x, size*length);
return 1;
@@ -484,16 +496,16 @@ ACE_OutputCDR::write_array (const void *x,
switch (size)
{
case 2:
- swapper = ACE_CDR::swap_2;
+ swapper = CDR::swap_2;
break;
case 4:
- swapper = ACE_CDR::swap_4;
+ swapper = CDR::swap_4;
break;
case 8:
- swapper = ACE_CDR::swap_8;
+ swapper = CDR::swap_8;
break;
case 16:
- swapper = ACE_CDR::swap_16;
+ swapper = CDR::swap_16;
break;
default:
// TODO: print something?
@@ -517,17 +529,17 @@ ACE_OutputCDR::write_array (const void *x,
return 0;
}
-ACE_CDR::Boolean
-ACE_OutputCDR::write_boolean_array (const ACE_CDR::Boolean* x,
- ACE_CDR::ULong length)
+CDR::Boolean
+ACE_OutputCDR::write_boolean_array (const CDR::Boolean* x,
+ CDR::ULong length)
{
// It is hard to optimize this, the spec requires that on the wire
// booleans be represented as a byte with value 0 or 1, but in
// memoery it is possible (though very unlikely) that a boolean has
// a non-zero value (different from 1).
// We resort to a simple loop.
- const ACE_CDR::Boolean* end = x + length;
- for (const ACE_CDR::Boolean* i = x; i != end && this->good_bit (); ++i)
+ const CDR::Boolean* end = x + length;
+ for (const CDR::Boolean* i = x; i != end && this->good_bit (); ++i)
{
this->write_boolean (*i);
}
@@ -554,32 +566,14 @@ ACE_InputCDR::ACE_InputCDR (size_t bufsiz,
{
}
-ACE_InputCDR::ACE_InputCDR (const ACE_Message_Block *data,
+ACE_InputCDR::ACE_InputCDR (ACE_Message_Block *data,
int byte_order)
- : start_ (ACE_CDR::total_length (data, 0) + ACE_CDR::MAX_ALIGNMENT),
- // @@ We may need allocators for the previous line, and the size may
- // be a standard ACE_*CDR size...
+ : start_ (data->data_block ()->duplicate ()),
do_byte_swap_ (byte_order != ACE_CDR_BYTE_ORDER),
good_bit_ (1)
{
- // We must copy the contents of <data> into the new buffer, but
- // respecting the alignment.
- ptr_arith_t curalign =
- ptr_arith_t(data->rd_ptr ()) % ACE_CDR::MAX_ALIGNMENT;
- ptr_arith_t tmpalign =
- ptr_arith_t(this->start_.rd_ptr ()) % ACE_CDR::MAX_ALIGNMENT;
- int offset = curalign - tmpalign;
- if (offset < 0)
- offset += ACE_CDR::MAX_ALIGNMENT;
- this->start_.rd_ptr (offset);
- this->start_.wr_ptr (offset);
-
- for (const ACE_Message_Block* i = data;
- i != 0;
- i = i->cont ())
- {
- this->start_.copy (i->rd_ptr (), i->length ());
- }
+ this->start_.rd_ptr (data->rd_ptr ());
+ this->start_.wr_ptr (data->wr_ptr ());
}
ACE_InputCDR::ACE_InputCDR (ACE_Data_Block *data,
@@ -592,7 +586,7 @@ ACE_InputCDR::ACE_InputCDR (ACE_Data_Block *data,
ACE_InputCDR::ACE_InputCDR (const ACE_InputCDR& rhs,
size_t size,
- ACE_CDR::Long offset)
+ CDR::Long offset)
: start_ (rhs.start_.data_block ()->duplicate ()),
do_byte_swap_ (rhs.do_byte_swap_),
good_bit_ (1)
@@ -627,7 +621,7 @@ ACE_InputCDR::ACE_InputCDR (const ACE_InputCDR& rhs,
this->start_.rd_ptr (newpos);
this->start_.wr_ptr (newpos + size);
- ACE_CDR::Octet byte_order;
+ CDR::Octet byte_order;
this->read_octet (byte_order);
this->do_byte_swap_ = (byte_order != ACE_CDR_BYTE_ORDER);
}
@@ -663,7 +657,7 @@ ACE_InputCDR::operator= (const ACE_InputCDR& rhs)
ACE_InputCDR::ACE_InputCDR (const ACE_OutputCDR& rhs,
ACE_Allocator* buffer_allocator,
ACE_Allocator* data_block_allocator)
- : start_ (rhs.total_length () + ACE_CDR::MAX_ALIGNMENT,
+ : start_ (rhs.total_length () + CDR::MAX_ALIGNMENT,
ACE_Message_Block::MB_DATA,
0,
0,
@@ -676,22 +670,26 @@ ACE_InputCDR::ACE_InputCDR (const ACE_OutputCDR& rhs,
do_byte_swap_ (rhs.do_byte_swap_),
good_bit_ (1)
{
- ACE_CDR::mb_align (&this->start_);
+ CDR::mb_align (&this->start_);
for (const ACE_Message_Block *i = rhs.begin ();
i != rhs.end ();
i = i->cont ())
this->start_.copy (i->rd_ptr (), i->length ());
}
-ACE_CDR::Boolean
+ACE_InputCDR::~ACE_InputCDR (void)
+{
+}
+
+CDR::Boolean
ACE_InputCDR::read_string (char *&x)
{
- ACE_CDR::ULong len;
+ CDR::ULong len;
this->read_ulong (len);
if (len > 0)
{
- ACE_NEW_RETURN (x, ACE_CDR::Char[len], 0);
+ ACE_NEW_RETURN (x, CDR::Char[len], 0);
if (this->read_char_array (x, len))
return 1;
delete [] x;
@@ -701,10 +699,10 @@ ACE_InputCDR::read_string (char *&x)
return 0;
}
-ACE_CDR::Boolean
+CDR::Boolean
ACE_InputCDR::read_string (ACE_CString &x)
{
- ACE_CDR::Char *data;
+ CDR::Char *data;
if (this->read_string (data))
{
x = data;
@@ -716,14 +714,14 @@ ACE_InputCDR::read_string (ACE_CString &x)
return 0;
}
-ACE_CDR::Boolean
-ACE_InputCDR::read_wstring (ACE_CDR::WChar*& x)
+CDR::Boolean
+ACE_InputCDR::read_wstring (CDR::WChar*& x)
{
- ACE_CDR::ULong len;
+ CDR::ULong len;
this->read_ulong (len);
if (this->good_bit())
{
- ACE_NEW_RETURN (x, ACE_CDR::WChar[len], 0);
+ ACE_NEW_RETURN (x, CDR::WChar[len], 0);
if (this->read_wchar_array (x, len))
return 1;
@@ -733,11 +731,11 @@ ACE_InputCDR::read_wstring (ACE_CDR::WChar*& x)
return 0;
}
-ACE_CDR::Boolean
+CDR::Boolean
ACE_InputCDR::read_array (void* x,
size_t size,
size_t align,
- ACE_CDR::ULong length)
+ CDR::ULong length)
{
char* buf;
if (this->adjust (size * length, align, buf) == 0)
@@ -757,25 +755,25 @@ ACE_InputCDR::read_array (void* x,
case 2:
for (; target != end; target += size, buf += size)
{
- ACE_CDR::swap_2 (buf, target);
+ CDR::swap_2 (buf, target);
}
break;
case 4:
for (; target != end; target += size, buf += size)
{
- ACE_CDR::swap_4 (buf, target);
+ CDR::swap_4 (buf, target);
}
break;
case 8:
for (; target != end; target += size, buf += size)
{
- ACE_CDR::swap_8 (buf, target);
+ CDR::swap_8 (buf, target);
}
break;
case 16:
for (; target != end; target += size, buf += size)
{
- ACE_CDR::swap_16 (buf, target);
+ CDR::swap_16 (buf, target);
}
break;
default:
@@ -792,28 +790,28 @@ ACE_InputCDR::read_array (void* x,
return 0;
}
-ACE_CDR::Boolean
-ACE_InputCDR::read_boolean_array (ACE_CDR::Boolean *x,
- ACE_CDR::ULong length)
+CDR::Boolean
+ACE_InputCDR::read_boolean_array (CDR::Boolean *x,
+ CDR::ULong length)
{
// It is hard to optimize this, the spec requires that on the wire
// booleans be represented as a byte with value 0 or 1, but in
// memoery it is possible (though very unlikely) that a boolean has
// a non-zero value (different from 1).
// We resort to a simple loop.
- for (ACE_CDR::ULong i = 0; i != length && this->good_bit_; ++i)
+ for (CDR::ULong i = 0; i != length && this->good_bit_; ++i)
{
this->read_boolean (x[i]);
}
return this->good_bit_;
}
-ACE_CDR::Boolean
-ACE_InputCDR::read_1 (ACE_CDR::Octet *x)
+CDR::Boolean
+ACE_InputCDR::read_1 (CDR::Octet *x)
{
if (this->rd_ptr () < this->end ())
{
- *x = *ACE_reinterpret_cast (ACE_CDR::Octet*,this->rd_ptr());
+ *x = *ACE_reinterpret_cast (CDR::Octet*,this->rd_ptr());
this->start_.rd_ptr (1);
return 1;
}
@@ -822,104 +820,104 @@ ACE_InputCDR::read_1 (ACE_CDR::Octet *x)
return 0;
}
-ACE_CDR::Boolean
-ACE_InputCDR::read_2 (ACE_CDR::UShort *x)
+CDR::Boolean
+ACE_InputCDR::read_2 (CDR::UShort *x)
{
char *buf;
- if (this->adjust (ACE_CDR::SHORT_SIZE, buf) == 0)
+ if (this->adjust (CDR::SHORT_SIZE, buf) == 0)
{
#if !defined (ACE_DISABLE_SWAP_ON_READ)
if (!this->do_byte_swap_)
{
- *x = *ACE_reinterpret_cast (ACE_CDR::UShort*, buf);
+ *x = *ACE_reinterpret_cast (CDR::UShort*, buf);
}
else
{
- ACE_CDR::swap_2 (buf, ACE_reinterpret_cast (char*, x));
+ CDR::swap_2 (buf, ACE_reinterpret_cast (char*, x));
}
#else
- *x = *ACE_reinterpret_cast(ACE_CDR::UShort*,buf);
+ *x = *ACE_reinterpret_cast(CDR::UShort*,buf);
#endif /* ACE_DISABLE_SWAP_ON_READ */
return 1;
}
return 0;
}
-ACE_CDR::Boolean
-ACE_InputCDR::read_4 (ACE_CDR::ULong *x)
+CDR::Boolean
+ACE_InputCDR::read_4 (CDR::ULong *x)
{
char *buf;
- if (this->adjust (ACE_CDR::LONG_SIZE, buf) == 0)
+ if (this->adjust (CDR::LONG_SIZE, buf) == 0)
{
#if !defined (ACE_DISABLE_SWAP_ON_READ)
if (!this->do_byte_swap_)
{
- *x = *ACE_reinterpret_cast (ACE_CDR::ULong*, buf);
+ *x = *ACE_reinterpret_cast (CDR::ULong*, buf);
}
else
{
- ACE_CDR::swap_4 (buf, ACE_reinterpret_cast (char*, x));
+ CDR::swap_4 (buf, ACE_reinterpret_cast (char*, x));
}
#else
- *x = *ACE_reinterpret_cast(ACE_CDR::ULong*,buf);
+ *x = *ACE_reinterpret_cast(CDR::ULong*,buf);
#endif /* ACE_DISABLE_SWAP_ON_READ */
return 1;
}
return 0;
}
-ACE_CDR::Boolean
-ACE_InputCDR::read_8 (ACE_CDR::ULongLong *x)
+CDR::Boolean
+ACE_InputCDR::read_8 (CDR::ULongLong *x)
{
char *buf;
- if (this->adjust (ACE_CDR::LONGLONG_SIZE, buf) == 0)
+ if (this->adjust (CDR::LONGLONG_SIZE, buf) == 0)
{
#if !defined (ACE_DISABLE_SWAP_ON_READ)
if (!this->do_byte_swap_)
{
- *x = *ACE_reinterpret_cast (ACE_CDR::ULongLong *, buf);
+ *x = *ACE_reinterpret_cast (CDR::ULongLong *, buf);
}
else
{
- ACE_CDR::swap_8 (buf, ACE_reinterpret_cast (char*, x));
+ CDR::swap_8 (buf, ACE_reinterpret_cast (char*, x));
}
#else
- *x = *ACE_reinterpret_cast(ACE_CDR::ULongLong*,buf);
+ *x = *ACE_reinterpret_cast(CDR::ULongLong*,buf);
#endif /* ACE_DISABLE_SWAP_ON_READ */
return 1;
}
return 0;
}
-ACE_CDR::Boolean
-ACE_InputCDR::read_16 (ACE_CDR::LongDouble *x)
+CDR::Boolean
+ACE_InputCDR::read_16 (CDR::LongDouble *x)
{
char *buf;
- if (this->adjust (ACE_CDR::LONGLONG_SIZE,
- ACE_CDR::LONGLONG_ALIGN,
+ if (this->adjust (CDR::LONGLONG_SIZE,
+ CDR::LONGLONG_ALIGN,
buf) == 0)
{
#if !defined (ACE_DISABLE_SWAP_ON_READ)
if (!this->do_byte_swap_)
{
- *x = *ACE_reinterpret_cast (ACE_CDR::LongDouble *, buf);
+ *x = *ACE_reinterpret_cast (CDR::LongDouble *, buf);
}
else
{
- ACE_CDR::swap_16 (buf, ACE_reinterpret_cast (char*, x));
+ CDR::swap_16 (buf, ACE_reinterpret_cast (char*, x));
}
#else
- *x = *ACE_reinterpret_cast(ACE_CDR::LongDouble*,buf);
+ *x = *ACE_reinterpret_cast(CDR::LongDouble*,buf);
#endif /* ACE_DISABLE_SWAP_ON_READ */
return 1;
}
return 0;
}
-ACE_CDR::Boolean
+CDR::Boolean
ACE_InputCDR::skip_string (void)
{
- ACE_CDR::ULong len;
+ CDR::ULong len;
if (this->read_ulong (len))
{
if (this->rd_ptr () + len <= this->end ())
@@ -933,7 +931,7 @@ ACE_InputCDR::skip_string (void)
return 0;
}
-ACE_CDR::Boolean
+CDR::Boolean
ACE_InputCDR::skip_bytes (size_t len)
{
if (this->rd_ptr () + len <= this->end ())