summaryrefslogtreecommitdiff
path: root/TAO/tao/Any.cpp
diff options
context:
space:
mode:
authorcoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-02-19 23:27:53 +0000
committercoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-02-19 23:27:53 +0000
commit2d9ad1ce6d4bcb1cbfc6ea016bc05d2502b20ece (patch)
tree7bfd5e575dff5c8954bb2adee8080fa2564bdff7 /TAO/tao/Any.cpp
parent2446368b3dbe077e29b8b05e4546c4489b443ae4 (diff)
downloadATCD-2d9ad1ce6d4bcb1cbfc6ea016bc05d2502b20ece.tar.gz
ChangeLogTag:Sat Feb 19 14:23:38 2000 Carlos O'Ryan <coryan@uci.edu>
Diffstat (limited to 'TAO/tao/Any.cpp')
-rw-r--r--TAO/tao/Any.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/TAO/tao/Any.cpp b/TAO/tao/Any.cpp
index 9f8eeb5c8fa..90fe0ccfb76 100644
--- a/TAO/tao/Any.cpp
+++ b/TAO/tao/Any.cpp
@@ -101,7 +101,8 @@ CORBA_Any::CORBA_Any (CORBA::TypeCode_ptr tc,
// Retrieve the start of the message block chain and save it.
this->byte_order_ = TAO_ENCAP_BYTE_ORDER;
- this->cdr_ = stream.begin ()->clone ();
+ ACE_NEW (this->cdr_, ACE_Message_Block);
+ ACE_CDR::compactify (this->cdr_, stream.begin ());
}
}
ACE_CATCHANY
@@ -120,9 +121,10 @@ CORBA_Any::CORBA_Any (CORBA::TypeCode_ptr type,
: type_ (CORBA::TypeCode::_duplicate (type)),
value_ (0),
byte_order_ (byte_order),
- cdr_ (ACE_Message_Block::duplicate (mb)),
any_owns_data_ (0)
{
+ ACE_NEW (this->cdr_, ACE_Message_Block);
+ ACE_CDR::compactify (this->cdr_, mb);
}
// Copy constructor for "Any".
@@ -141,7 +143,8 @@ CORBA_Any::CORBA_Any (const CORBA_Any &src)
// CDR stream always contains encoded object, if any holds anything
// at all.
this->byte_order_ = src.byte_order_;
- this->cdr_ = ACE_Message_Block::duplicate (src.cdr_);
+ ACE_NEW (this->cdr_, ACE_Message_Block);
+ ACE_CDR::compactify (this->cdr_, mb);
// No need to copy src's value_. We can always get that from cdr.
}
@@ -191,7 +194,8 @@ CORBA_Any::operator= (const CORBA_Any &src)
this->any_owns_data_ = 0;
this->byte_order_ = src.byte_order_;
- this->cdr_ = ACE_Message_Block::duplicate (src.cdr_);
+ ACE_NEW (this->cdr_, ACE_Message_Block);
+ ACE_CDR::compactify (this->cdr_, src.cdr_);
// Simply duplicate the cdr string here. We can save the decode
// operation if there's no need to extract the object.
}
@@ -276,7 +280,8 @@ CORBA_Any::replace (CORBA::TypeCode_ptr tc,
// Retrieve the start of the message block chain and duplicate it.
this->byte_order_ = TAO_ENCAP_BYTE_ORDER;
- this->cdr_ = ACE_Message_Block::duplicate (stream.begin ());
+ ACE_NEW (this->cdr_, ACE_Message_Block);
+ ACE_CDR::compactify (this->cdr_, stream.begin ());
}
}
@@ -304,7 +309,8 @@ CORBA_Any::_tao_replace (CORBA::TypeCode_ptr tc,
this->any_owns_data_ = 0;
this->byte_order_ = byte_order;
- this->cdr_ = ACE_Message_Block::duplicate (mb);
+ ACE_NEW (this->cdr_, ACE_Message_Block);
+ ACE_CDR::compactify (this->cdr_, mb);
// We can save the decode operation if there's no need to extract
// the object.
}
@@ -337,7 +343,8 @@ CORBA_Any::_tao_replace (CORBA::TypeCode_ptr tc,
this->any_owns_data_ = any_owns_data;
this->byte_order_ = byte_order;
- this->cdr_ = ACE_Message_Block::duplicate (mb);
+ ACE_NEW (this->cdr_, ACE_Message_Block);
+ ACE_CDR::compactify (this->cdr_, mb);
// We can save the decode operation if there's no need to extract
// the object.
}