summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TAO/TAO_IDL/be/be_visitor_array/any_op_cs.cpp8
-rw-r--r--TAO/TAO_IDL/be/be_visitor_enum/any_op_cs.cpp8
-rw-r--r--TAO/TAO_IDL/be/be_visitor_exception/any_op_cs.cpp20
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp8
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp20
-rw-r--r--TAO/TAO_IDL/be/be_visitor_structure/any_op_cs.cpp20
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union/any_op_cs.cpp17
-rw-r--r--TAO/tao/Any.cpp21
8 files changed, 87 insertions, 35 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_array/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_array/any_op_cs.cpp
index 9c0b6975740..d9703f4c588 100644
--- a/TAO/TAO_IDL/be/be_visitor_array/any_op_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_array/any_op_cs.cpp
@@ -91,8 +91,12 @@ be_visitor_array_any_op_cs::visit_array (be_array *node)
<< "{" << be_idt_nl
<< "_tao_elem.out () = " << node->name () << "_alloc ();" << be_nl
<< "if (!_tao_elem.in ()) return 0;" << be_nl
- << "TAO_InputCDR stream (_tao_any._tao_get_cdr ());"
- << be_nl
+
+ << "TAO_InputCDR stream (" << be_idt << be_idt_nl
+ << "_tao_any._tao_get_cdr ()," << be_nl
+ << "_tao_any._tao_byte_order ()" << be_uidt_nl
+ << ");" << be_uidt_nl
+
<< "if (stream.decode (" << node->tc_name ()
<< ", _tao_elem.inout (), 0, ACE_TRY_ENV)" << be_nl
<< " == CORBA::TypeCode::TRAVERSE_CONTINUE)" << be_nl
diff --git a/TAO/TAO_IDL/be/be_visitor_enum/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_enum/any_op_cs.cpp
index 0e4accf1469..1f2acd05b8e 100644
--- a/TAO/TAO_IDL/be/be_visitor_enum/any_op_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_enum/any_op_cs.cpp
@@ -83,8 +83,12 @@ be_visitor_enum_any_op_cs::visit_enum (be_enum *node)
<< "if (!type->equivalent (" << node->tc_name ()
<< ", ACE_TRY_ENV)) return 0; // not equal" << be_nl
<< "ACE_TRY_CHECK;" << be_nl
- << "TAO_InputCDR stream (_tao_any._tao_get_cdr ());"
- << be_nl
+
+ << "TAO_InputCDR stream (" << be_idt << be_idt_nl
+ << "_tao_any._tao_get_cdr ()," << be_nl
+ << "_tao_any._tao_byte_order ()" << be_uidt_nl
+ << ");" << be_uidt_nl
+
<< "if (stream.decode (" << node->tc_name ()
<< ", &_tao_elem, 0, ACE_TRY_ENV)" << be_nl
<< " == CORBA::TypeCode::TRAVERSE_CONTINUE)" << be_nl
diff --git a/TAO/TAO_IDL/be/be_visitor_exception/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_exception/any_op_cs.cpp
index e216219f84b..16a95324ab8 100644
--- a/TAO/TAO_IDL/be/be_visitor_exception/any_op_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_exception/any_op_cs.cpp
@@ -108,8 +108,12 @@ be_visitor_exception_any_op_cs::visit_exception (be_exception *node)
<< "{" << be_idt_nl
<< "ACE_NEW_RETURN (_tao_elem, " << node->name () << ", 0);"
<< be_nl
- << "TAO_InputCDR stream (_tao_any._tao_get_cdr ());"
- << be_nl
+
+ << "TAO_InputCDR stream (" << be_idt << be_idt_nl
+ << "_tao_any._tao_get_cdr ()," << be_nl
+ << "_tao_any._tao_byte_order ()" << be_uidt_nl
+ << ");" << be_uidt_nl
+
<< "if (stream.decode (" << node->tc_name ()
<< ", _tao_elem, 0, ACE_TRY_ENV)" << be_nl
<< " == CORBA::TypeCode::TRAVERSE_CONTINUE)" << be_nl
@@ -160,8 +164,12 @@ be_visitor_exception_any_op_cs::visit_exception (be_exception *node)
<< "{" << be_idt_nl
<< "ACE_NEW_RETURN (_tao_elem, " << node->name () << ", 0);"
<< be_nl
- << "TAO_InputCDR stream (_tao_any._tao_get_cdr ());"
- << be_nl
+
+ << "TAO_InputCDR stream (" << be_idt << be_idt_nl
+ << "_tao_any._tao_get_cdr ()," << be_nl
+ << "_tao_any._tao_byte_order ()" << be_uidt_nl
+ << ");" << be_uidt_nl
+
<< "if (stream.decode (" << node->tc_name ()
<< ", _tao_elem, 0, ACE_TRY_ENV)" << be_nl
<< " == CORBA::TypeCode::TRAVERSE_CONTINUE)" << be_nl
@@ -173,7 +181,7 @@ be_visitor_exception_any_op_cs::visit_exception (be_exception *node)
<< "}" << be_nl
<< "else" << be_nl // decode failed
<< "{" << be_idt_nl
- << "delete ACE_const_cast (" << node->name ()
+ << "delete ACE_const_cast (" << node->name ()
<< " *&, _tao_elem);" << be_nl
<< "_tao_elem = 0;" << be_uidt_nl
<< "}" << be_uidt_nl
@@ -181,7 +189,7 @@ be_visitor_exception_any_op_cs::visit_exception (be_exception *node)
<< "}" << be_nl
<< "ACE_CATCHANY" << be_nl
<< "{" << be_idt_nl
- << "delete ACE_const_cast (" << node->name ()
+ << "delete ACE_const_cast (" << node->name ()
<< " *&, _tao_elem);" << be_nl
<< "_tao_elem = 0;" << be_nl
<< "return 0;" << be_uidt_nl
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp
index 1f697456c65..8eedc6f6bfe 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp
@@ -102,8 +102,12 @@ be_visitor_interface_any_op_cs::visit_interface (be_interface *node)
<< "return 0;" << be_uidt_nl
<< "}" << be_uidt_nl
<< "ACE_TRY_CHECK;" << be_nl
- << "TAO_InputCDR stream (_tao_any._tao_get_cdr ());"
- << be_nl
+
+ << "TAO_InputCDR stream (" << be_idt << be_idt_nl
+ << "_tao_any._tao_get_cdr ()," << be_nl
+ << "_tao_any._tao_byte_order ()" << be_uidt_nl
+ << ");" << be_uidt_nl
+
<< "CORBA::Object_var _tao_obj_var;" << be_nl
<< "ACE_NEW_RETURN (tmp, CORBA::Object_ptr, 0);" << be_nl
<< "if (stream.decode (" << node->tc_name ()
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp
index 204d902d890..b9a28f97d32 100644
--- a/TAO/TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp
@@ -111,8 +111,12 @@ be_visitor_sequence_any_op_cs::visit_sequence (be_sequence *node)
<< "{" << be_idt_nl
<< "ACE_NEW_RETURN (_tao_elem, " << node->name () << ", 0);"
<< be_nl
- << "TAO_InputCDR stream (_tao_any._tao_get_cdr ());"
- << be_nl
+
+ << "TAO_InputCDR stream (" << be_idt << be_idt_nl
+ << "_tao_any._tao_get_cdr ()," << be_nl
+ << "_tao_any._tao_byte_order ()" << be_uidt_nl
+ << ");" << be_uidt_nl
+
<< "if (stream.decode (" << node->tc_name ()
<< ", _tao_elem, 0, ACE_TRY_ENV)" << be_nl
<< " == CORBA::TypeCode::TRAVERSE_CONTINUE)" << be_nl
@@ -164,8 +168,12 @@ be_visitor_sequence_any_op_cs::visit_sequence (be_sequence *node)
<< "{" << be_idt_nl
<< "ACE_NEW_RETURN (_tao_elem, " << node->name () << ", 0);"
<< be_nl
- << "TAO_InputCDR stream (_tao_any._tao_get_cdr ());"
- << be_nl
+
+ << "TAO_InputCDR stream (" << be_idt << be_idt_nl
+ << "_tao_any._tao_get_cdr ()," << be_nl
+ << "_tao_any._tao_byte_order ()" << be_uidt_nl
+ << ");" << be_uidt_nl
+
<< "if (stream.decode (" << node->tc_name ()
<< ", _tao_elem, 0, ACE_TRY_ENV)" << be_nl
<< " == CORBA::TypeCode::TRAVERSE_CONTINUE)" << be_nl
@@ -178,7 +186,7 @@ be_visitor_sequence_any_op_cs::visit_sequence (be_sequence *node)
<< "}" << be_nl
<< "else" << be_nl // decode failed
<< "{" << be_idt_nl
- << "delete ACE_const_cast (" << node->name ()
+ << "delete ACE_const_cast (" << node->name ()
<< " *&, _tao_elem);" << be_nl
<< "_tao_elem = 0;" << be_uidt_nl
<< "}" << be_uidt_nl
@@ -186,7 +194,7 @@ be_visitor_sequence_any_op_cs::visit_sequence (be_sequence *node)
<< "}" << be_nl
<< "ACE_CATCHANY" << be_nl
<< "{" << be_idt_nl
- << "delete ACE_const_cast (" << node->name ()
+ << "delete ACE_const_cast (" << node->name ()
<< " *&, _tao_elem);" << be_nl
<< "_tao_elem = 0;" << be_nl
<< "return 0;" << be_uidt_nl
diff --git a/TAO/TAO_IDL/be/be_visitor_structure/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_structure/any_op_cs.cpp
index 8132244b53e..46955581f4b 100644
--- a/TAO/TAO_IDL/be/be_visitor_structure/any_op_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_structure/any_op_cs.cpp
@@ -108,8 +108,12 @@ be_visitor_structure_any_op_cs::visit_structure (be_structure *node)
<< "{" << be_idt_nl
<< "ACE_NEW_RETURN (_tao_elem, " << node->name () << ", 0);"
<< be_nl
- << "TAO_InputCDR stream (_tao_any._tao_get_cdr ());"
- << be_nl
+
+ << "TAO_InputCDR stream (" << be_idt << be_idt_nl
+ << "_tao_any._tao_get_cdr ()," << be_nl
+ << "_tao_any._tao_byte_order ()" << be_uidt_nl
+ << ");" << be_uidt_nl
+
<< "if (stream.decode (" << node->tc_name ()
<< ", _tao_elem, 0, ACE_TRY_ENV)" << be_nl
<< " == CORBA::TypeCode::TRAVERSE_CONTINUE)" << be_nl
@@ -160,8 +164,12 @@ be_visitor_structure_any_op_cs::visit_structure (be_structure *node)
<< "{" << be_idt_nl
<< "ACE_NEW_RETURN (_tao_elem, " << node->name () << ", 0);"
<< be_nl
- << "TAO_InputCDR stream (_tao_any._tao_get_cdr ());"
- << be_nl
+
+ << "TAO_InputCDR stream (" << be_idt << be_idt_nl
+ << "_tao_any._tao_get_cdr ()," << be_nl
+ << "_tao_any._tao_byte_order ()" << be_uidt_nl
+ << ");" << be_uidt_nl
+
<< "if (stream.decode (" << node->tc_name ()
<< ", _tao_elem, 0, ACE_TRY_ENV)" << be_nl
<< " == CORBA::TypeCode::TRAVERSE_CONTINUE)" << be_nl
@@ -173,7 +181,7 @@ be_visitor_structure_any_op_cs::visit_structure (be_structure *node)
<< "}" << be_nl
<< "else" << be_nl
<< "{" << be_idt_nl
- << "delete ACE_const_cast (" << node->name ()
+ << "delete ACE_const_cast (" << node->name ()
<< " *&, _tao_elem);" << be_nl
<< "_tao_elem = 0;" << be_uidt_nl
<< "}" << be_uidt_nl
@@ -181,7 +189,7 @@ be_visitor_structure_any_op_cs::visit_structure (be_structure *node)
<< "}" << be_nl
<< "ACE_CATCHANY" << be_nl
<< "{" << be_idt_nl
- << "delete ACE_const_cast (" << node->name ()
+ << "delete ACE_const_cast (" << node->name ()
<< " *&, _tao_elem);" << be_nl
<< "_tao_elem = 0;" << be_nl
<< "return 0; " << be_uidt_nl
diff --git a/TAO/TAO_IDL/be/be_visitor_union/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union/any_op_cs.cpp
index 0b3632d4e3e..9cb6f624c52 100644
--- a/TAO/TAO_IDL/be/be_visitor_union/any_op_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_union/any_op_cs.cpp
@@ -115,7 +115,11 @@ be_visitor_union_any_op_cs::visit_union (be_union *node)
<< "{" << be_idt_nl
<< "ACE_NEW_RETURN (_tao_elem, " << node->name () << ", 0);"
<< be_nl
- << "TAO_InputCDR stream (_tao_any._tao_get_cdr ());" << be_nl;
+
+ << "TAO_InputCDR stream (" << be_idt << be_idt_nl
+ << "_tao_any._tao_get_cdr ()," << be_nl
+ << "_tao_any._tao_byte_order ()" << be_uidt_nl
+ << ");" << be_uidt_nl;
if (this->gen_extraction (os, node) != 0)
return -1;
@@ -158,7 +162,11 @@ be_visitor_union_any_op_cs::visit_union (be_union *node)
<< "{" << be_idt_nl
<< "ACE_NEW_RETURN (_tao_elem, " << node->name () << ", 0);"
<< be_nl
- << "TAO_InputCDR stream (_tao_any._tao_get_cdr ());" << be_nl;
+
+ << "TAO_InputCDR stream (" << be_idt << be_idt_nl
+ << "_tao_any._tao_get_cdr ()," << be_nl
+ << "_tao_any._tao_byte_order ()" << be_uidt_nl
+ << ");" << be_uidt_nl;
if (this->gen_const_extraction (os, node) != 0)
return -1;
@@ -169,7 +177,7 @@ be_visitor_union_any_op_cs::visit_union (be_union *node)
<< "}" << be_nl
<< "ACE_CATCHANY" << be_nl
<< "{" << be_idt_nl
- << "delete ACE_const_cast (" << node->name ()
+ << "delete ACE_const_cast (" << node->name ()
<< " *&, _tao_elem);" << be_nl
<< "_tao_elem = 0;" << be_uidt_nl
<< "}" << be_nl
@@ -233,6 +241,7 @@ gen_insertion (TAO_OutStream *os,
<< "stream << *_any_val;" << be_nl
<< "_tao_any._tao_replace (" << be_idt << be_idt_nl
<< node->tc_name () << "," << be_nl
+ << "TAO_ENCAP_BYTE_ORDER," << be_nl
<< "stream.begin ()," << be_nl
<< "1," << be_nl
<< "_any_val," << be_nl
@@ -251,6 +260,7 @@ gen_insertion_nocopy (TAO_OutStream *os,
<< "stream << *_tao_elem;" << be_nl
<< "_tao_any._tao_replace (" << be_idt << be_idt_nl
<< node->tc_name () << "," << be_nl
+ << "TAO_ENCAP_BYTE_ORDER," << be_nl
<< "stream.begin ()," << be_nl
<< "1," << be_nl
<< "_tao_elem," << be_nl
@@ -347,4 +357,3 @@ gen_const_extraction (TAO_OutStream *os,
return this->gen_extraction (os,
node);
}
-
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.
}