summaryrefslogtreecommitdiff
path: root/TAO/tao/IORC.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tao/IORC.cpp')
-rw-r--r--TAO/tao/IORC.cpp676
1 files changed, 605 insertions, 71 deletions
diff --git a/TAO/tao/IORC.cpp b/TAO/tao/IORC.cpp
index a1871ff6f84..a4ac85e380b 100644
--- a/TAO/tao/IORC.cpp
+++ b/TAO/tao/IORC.cpp
@@ -1,6 +1,7 @@
/* -*- C++ -*- */
// $Id$
+
// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
// TAO and the TAO IDL Compiler have been developed by the Center for
// Distributed Object Computing at Washington University, St. Louis.
@@ -21,6 +22,7 @@
ACE_RCSID(tao, IORC, "$Id$")
+
TAO_IOP::TAO_IOR_Manipulation_ptr TAO_IOP::TAO_IOR_Manipulation::_narrow (
CORBA::Object_ptr obj,
CORBA::Environment &ACE_TRY_ENV
@@ -106,6 +108,22 @@ void TAO_IOP::TAO_IOR_Manipulation::EmptyProfileList::_raise ()
TAO_RAISE(*this);
}
+void TAO_IOP::TAO_IOR_Manipulation::EmptyProfileList::_tao_encode (TAO_OutputCDR &cdr,
+ CORBA::Environment &ACE_TRY_ENV) const
+{
+ if (cdr << *this)
+ return;
+ ACE_THROW (CORBA::MARSHAL ());
+}
+
+void TAO_IOP::TAO_IOR_Manipulation::EmptyProfileList::_tao_decode (TAO_InputCDR &cdr,
+ CORBA::Environment &ACE_TRY_ENV)
+{
+ if (cdr >> *this)
+ return;
+ ACE_THROW (CORBA::MARSHAL ());
+}
+
// TAO extension - the _alloc method
CORBA::Exception *TAO_IOP::TAO_IOR_Manipulation::EmptyProfileList::_alloc (void)
{
@@ -170,6 +188,22 @@ void TAO_IOP::TAO_IOR_Manipulation::NotFound::_raise ()
TAO_RAISE(*this);
}
+void TAO_IOP::TAO_IOR_Manipulation::NotFound::_tao_encode (TAO_OutputCDR &cdr,
+ CORBA::Environment &ACE_TRY_ENV) const
+{
+ if (cdr << *this)
+ return;
+ ACE_THROW (CORBA::MARSHAL ());
+}
+
+void TAO_IOP::TAO_IOR_Manipulation::NotFound::_tao_decode (TAO_InputCDR &cdr,
+ CORBA::Environment &ACE_TRY_ENV)
+{
+ if (cdr >> *this)
+ return;
+ ACE_THROW (CORBA::MARSHAL ());
+}
+
// TAO extension - the _alloc method
CORBA::Exception *TAO_IOP::TAO_IOR_Manipulation::NotFound::_alloc (void)
{
@@ -234,6 +268,22 @@ void TAO_IOP::TAO_IOR_Manipulation::Duplicate::_raise ()
TAO_RAISE(*this);
}
+void TAO_IOP::TAO_IOR_Manipulation::Duplicate::_tao_encode (TAO_OutputCDR &cdr,
+ CORBA::Environment &ACE_TRY_ENV) const
+{
+ if (cdr << *this)
+ return;
+ ACE_THROW (CORBA::MARSHAL ());
+}
+
+void TAO_IOP::TAO_IOR_Manipulation::Duplicate::_tao_decode (TAO_InputCDR &cdr,
+ CORBA::Environment &ACE_TRY_ENV)
+{
+ if (cdr >> *this)
+ return;
+ ACE_THROW (CORBA::MARSHAL ());
+}
+
// TAO extension - the _alloc method
CORBA::Exception *TAO_IOP::TAO_IOR_Manipulation::Duplicate::_alloc (void)
{
@@ -298,6 +348,22 @@ void TAO_IOP::TAO_IOR_Manipulation::Invalid_IOR::_raise ()
TAO_RAISE(*this);
}
+void TAO_IOP::TAO_IOR_Manipulation::Invalid_IOR::_tao_encode (TAO_OutputCDR &cdr,
+ CORBA::Environment &ACE_TRY_ENV) const
+{
+ if (cdr << *this)
+ return;
+ ACE_THROW (CORBA::MARSHAL ());
+}
+
+void TAO_IOP::TAO_IOR_Manipulation::Invalid_IOR::_tao_decode (TAO_InputCDR &cdr,
+ CORBA::Environment &ACE_TRY_ENV)
+{
+ if (cdr >> *this)
+ return;
+ ACE_THROW (CORBA::MARSHAL ());
+}
+
// TAO extension - the _alloc method
CORBA::Exception *TAO_IOP::TAO_IOR_Manipulation::Invalid_IOR::_alloc (void)
{
@@ -401,8 +467,23 @@ void operator<<= (CORBA::Any &_tao_any, TAO_IOP::TAO_IOR_Manipulation_ptr _tao_e
{
ACE_NEW (_tao_obj_ptr, CORBA::Object_ptr);
*_tao_obj_ptr = TAO_IOP::TAO_IOR_Manipulation::_duplicate (_tao_elem);
- _tao_any.replace (TAO_IOP::_tc_TAO_IOR_Manipulation, _tao_obj_ptr, 1, ACE_TRY_ENV);
- ACE_TRY_CHECK;
+ TAO_OutputCDR stream;
+ if (stream << *_tao_obj_ptr)
+ {
+ _tao_any._tao_replace (
+ TAO_IOP::_tc_TAO_IOR_Manipulation,
+ TAO_ENCAP_BYTE_ORDER,
+ stream.begin (),
+ 1,
+ _tao_obj_ptr,
+ ACE_TRY_ENV
+ );
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ delete _tao_obj_ptr;
+ }
}
ACE_CATCHANY
{
@@ -414,39 +495,57 @@ void operator<<= (CORBA::Any &_tao_any, TAO_IOP::TAO_IOR_Manipulation_ptr _tao_e
CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, TAO_IOP::TAO_IOR_Manipulation_ptr &_tao_elem)
{
CORBA::Object_ptr *tmp = 0;
+ ACE_NEW_RETURN (tmp, CORBA::Object_ptr, 0);
ACE_TRY_NEW_ENV
{
_tao_elem = TAO_IOP::TAO_IOR_Manipulation::_nil ();
CORBA::TypeCode_var type = _tao_any.type ();
- if (!type->equal (TAO_IOP::_tc_TAO_IOR_Manipulation, ACE_TRY_ENV)) return 0; // not equal
+ if (!type->equivalent (TAO_IOP::_tc_TAO_IOR_Manipulation, ACE_TRY_ENV)) // not equal
+ {
+ delete tmp;
+ return 0;
+ }
ACE_TRY_CHECK;
- TAO_InputCDR stream (_tao_any._tao_get_cdr (),
- _tao_any._tao_byte_order ());
+
+ TAO_InputCDR stream (
+ _tao_any._tao_get_cdr (),
+ _tao_any._tao_byte_order ()
+ );
+
CORBA::Object_var _tao_obj_var;
- ACE_NEW_RETURN (tmp, CORBA::Object_ptr, 0);
- if (stream.decode (TAO_IOP::_tc_TAO_IOR_Manipulation, &_tao_obj_var.out (), 0, ACE_TRY_ENV)
- == CORBA::TypeCode::TRAVERSE_CONTINUE)
+ if (stream >> _tao_obj_var.out ())
{
_tao_elem = TAO_IOP::TAO_IOR_Manipulation::_narrow (_tao_obj_var.in (), ACE_TRY_ENV);
ACE_TRY_CHECK;
*tmp = (CORBA::Object_ptr) _tao_elem; // any owns the object
- ((CORBA::Any *)&_tao_any)->replace (TAO_IOP::_tc_TAO_IOR_Manipulation, tmp, 1, ACE_TRY_ENV);
+ ((CORBA::Any *)&_tao_any)->_tao_replace (
+ TAO_IOP::_tc_TAO_IOR_Manipulation,
+ 1,
+ tmp,
+ ACE_TRY_ENV
+ );
ACE_TRY_CHECK;
return 1;
}
- // failure
+ else // failure
+ {
+ delete tmp;
+ }
}
ACE_CATCHANY
{
delete tmp;
+ _tao_elem = TAO_IOP::TAO_IOR_Manipulation::_nil ();
return 0;
}
ACE_ENDTRY;
+ _tao_elem = TAO_IOP::TAO_IOR_Manipulation::_nil ();
return 0;
}
-#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
- template class TAO_Object_Field_T<TAO_IOP::TAO_IOR_Manipulation,TAO_IOP::TAO_IOR_Manipulation_var>;
+#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) || \
+ defined (ACE_HAS_GNU_REPO)
+ template class TAO_Object_Field_T<TAO_IOP::TAO_IOR_Manipulation,TAO_IOP::TAO_IOR_Manipulation_var>;
template class TAO_Object_Manager<TAO_IOP::TAO_IOR_Manipulation,TAO_IOP::TAO_IOR_Manipulation_var>;
#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
# pragma instantiate TAO_Object_Field_T<TAO_IOP::TAO_IOR_Manipulation,TAO_IOP::TAO_IOR_Manipulation_var>
@@ -455,14 +554,24 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, TAO_IOP::TAO_IOR_Manipul
void operator<<= (CORBA::Any &_tao_any, const TAO_IOP::TAO_IOR_Manipulation::EmptyProfileList &_tao_elem) // copying
{
- TAO_IOP::TAO_IOR_Manipulation::EmptyProfileList *_tao_any_val = new TAO_IOP::TAO_IOR_Manipulation::EmptyProfileList (_tao_elem);
+ TAO_IOP::TAO_IOR_Manipulation::EmptyProfileList *_tao_any_val = 0;
+ ACE_NEW (_tao_any_val, TAO_IOP::TAO_IOR_Manipulation::EmptyProfileList (_tao_elem));
if (!_tao_any_val) return;
ACE_TRY_NEW_ENV
{
- _tao_any.replace (TAO_IOP::TAO_IOR_Manipulation::_tc_EmptyProfileList, _tao_any_val, 1, ACE_TRY_ENV);
+ TAO_OutputCDR stream;
+ stream << *_tao_any_val;
+ _tao_any._tao_replace (
+ TAO_IOP::TAO_IOR_Manipulation::_tc_EmptyProfileList,
+ TAO_ENCAP_BYTE_ORDER,
+ stream.begin (),
+ 1,
+ _tao_any_val,
+ ACE_TRY_ENV
+ );
ACE_TRY_CHECK;
}
- ACE_CATCHANY
+ ACE_CATCHANY
{
delete _tao_any_val;
}
@@ -473,10 +582,23 @@ void operator<<= (CORBA::Any &_tao_any, TAO_IOP::TAO_IOR_Manipulation::EmptyProf
{
ACE_TRY_NEW_ENV
{
- _tao_any.replace (TAO_IOP::TAO_IOR_Manipulation::_tc_EmptyProfileList, _tao_elem, 1, ACE_TRY_ENV); // consume it
+ TAO_OutputCDR stream;
+ stream << *_tao_elem;
+ _tao_any._tao_replace (
+ TAO_IOP::TAO_IOR_Manipulation::_tc_EmptyProfileList,
+ TAO_ENCAP_BYTE_ORDER,
+ stream.begin (),
+ 1,
+ _tao_elem,
+ ACE_TRY_ENV
+ );
ACE_TRY_CHECK;
}
- ACE_CATCHANY {}
+ ACE_CATCHANY
+ {
+ delete _tao_elem;
+ _tao_elem = 0;
+ }
ACE_ENDTRY;
}
@@ -485,7 +607,11 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, TAO_IOP::TAO_IOR_Manipul
ACE_TRY_NEW_ENV
{
CORBA::TypeCode_var type = _tao_any.type ();
- if (!type->equal (TAO_IOP::TAO_IOR_Manipulation::_tc_EmptyProfileList, ACE_TRY_ENV)) return 0; // not equal
+ if (!type->equivalent (TAO_IOP::TAO_IOR_Manipulation::_tc_EmptyProfileList, ACE_TRY_ENV)) // not equal
+ {
+ _tao_elem = 0;
+ return 0;
+ }
ACE_TRY_CHECK;
if (_tao_any.any_owns_data ())
{
@@ -495,25 +621,84 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, TAO_IOP::TAO_IOR_Manipul
else
{
ACE_NEW_RETURN (_tao_elem, TAO_IOP::TAO_IOR_Manipulation::EmptyProfileList, 0);
- TAO_InputCDR stream (_tao_any._tao_get_cdr (),
- _tao_any._tao_byte_order ());
- if (stream.decode (TAO_IOP::TAO_IOR_Manipulation::_tc_EmptyProfileList, _tao_elem, 0, ACE_TRY_ENV)
- == CORBA::TypeCode::TRAVERSE_CONTINUE)
+ TAO_InputCDR stream (
+ _tao_any._tao_get_cdr (),
+ _tao_any._tao_byte_order ()
+ );
+ if (stream >> *_tao_elem)
{
- ((CORBA::Any *)&_tao_any)->replace (TAO_IOP::TAO_IOR_Manipulation::_tc_EmptyProfileList, _tao_elem, 1, ACE_TRY_ENV);
+ ((CORBA::Any *)&_tao_any)->_tao_replace (
+ TAO_IOP::TAO_IOR_Manipulation::_tc_EmptyProfileList,
+ 1,
+ ACE_reinterpret_cast (void *, _tao_elem),
+ ACE_TRY_ENV
+ );
ACE_TRY_CHECK;
return 1;
}
else
{
delete _tao_elem;
+ _tao_elem = 0;
}
}
}
ACE_CATCHANY
{
delete _tao_elem;
- return 0;
+ _tao_elem = 0;
+ return 0;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, const TAO_IOP::TAO_IOR_Manipulation::EmptyProfileList *&_tao_elem)
+{
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::TypeCode_var type = _tao_any.type ();
+ if (!type->equivalent (TAO_IOP::TAO_IOR_Manipulation::_tc_EmptyProfileList, ACE_TRY_ENV)) // not equal
+ {
+ _tao_elem = 0;
+ return 0;
+ }
+ ACE_TRY_CHECK;
+ if (_tao_any.any_owns_data ())
+ {
+ _tao_elem = (TAO_IOP::TAO_IOR_Manipulation::EmptyProfileList *)_tao_any.value ();
+ return 1;
+ }
+ else
+ {
+ ACE_NEW_RETURN (_tao_elem, TAO_IOP::TAO_IOR_Manipulation::EmptyProfileList, 0);
+ TAO_InputCDR stream (
+ _tao_any._tao_get_cdr (),
+ _tao_any._tao_byte_order ()
+ );
+ if (stream >> *(TAO_IOP::TAO_IOR_Manipulation::EmptyProfileList *)_tao_elem)
+ {
+ ((CORBA::Any *)&_tao_any)->_tao_replace (
+ TAO_IOP::TAO_IOR_Manipulation::_tc_EmptyProfileList,
+ 1,
+ ACE_reinterpret_cast (void *, ACE_const_cast (TAO_IOP::TAO_IOR_Manipulation::EmptyProfileList *&, _tao_elem)),
+ ACE_TRY_ENV
+ );
+ ACE_TRY_CHECK;
+ return 1;
+ }
+ else
+ {
+ delete ACE_const_cast (TAO_IOP::TAO_IOR_Manipulation::EmptyProfileList *&, _tao_elem);
+ _tao_elem = 0;
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ delete ACE_const_cast (TAO_IOP::TAO_IOR_Manipulation::EmptyProfileList *&, _tao_elem);
+ _tao_elem = 0;
+ return 0;
}
ACE_ENDTRY;
return 0;
@@ -521,14 +706,24 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, TAO_IOP::TAO_IOR_Manipul
void operator<<= (CORBA::Any &_tao_any, const TAO_IOP::TAO_IOR_Manipulation::NotFound &_tao_elem) // copying
{
- TAO_IOP::TAO_IOR_Manipulation::NotFound *_tao_any_val = new TAO_IOP::TAO_IOR_Manipulation::NotFound (_tao_elem);
+ TAO_IOP::TAO_IOR_Manipulation::NotFound *_tao_any_val = 0;
+ ACE_NEW (_tao_any_val, TAO_IOP::TAO_IOR_Manipulation::NotFound (_tao_elem));
if (!_tao_any_val) return;
ACE_TRY_NEW_ENV
{
- _tao_any.replace (TAO_IOP::TAO_IOR_Manipulation::_tc_NotFound, _tao_any_val, 1, ACE_TRY_ENV);
+ TAO_OutputCDR stream;
+ stream << *_tao_any_val;
+ _tao_any._tao_replace (
+ TAO_IOP::TAO_IOR_Manipulation::_tc_NotFound,
+ TAO_ENCAP_BYTE_ORDER,
+ stream.begin (),
+ 1,
+ _tao_any_val,
+ ACE_TRY_ENV
+ );
ACE_TRY_CHECK;
}
- ACE_CATCHANY
+ ACE_CATCHANY
{
delete _tao_any_val;
}
@@ -539,10 +734,23 @@ void operator<<= (CORBA::Any &_tao_any, TAO_IOP::TAO_IOR_Manipulation::NotFound
{
ACE_TRY_NEW_ENV
{
- _tao_any.replace (TAO_IOP::TAO_IOR_Manipulation::_tc_NotFound, _tao_elem, 1, ACE_TRY_ENV); // consume it
+ TAO_OutputCDR stream;
+ stream << *_tao_elem;
+ _tao_any._tao_replace (
+ TAO_IOP::TAO_IOR_Manipulation::_tc_NotFound,
+ TAO_ENCAP_BYTE_ORDER,
+ stream.begin (),
+ 1,
+ _tao_elem,
+ ACE_TRY_ENV
+ );
ACE_TRY_CHECK;
}
- ACE_CATCHANY {}
+ ACE_CATCHANY
+ {
+ delete _tao_elem;
+ _tao_elem = 0;
+ }
ACE_ENDTRY;
}
@@ -551,7 +759,11 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, TAO_IOP::TAO_IOR_Manipul
ACE_TRY_NEW_ENV
{
CORBA::TypeCode_var type = _tao_any.type ();
- if (!type->equal (TAO_IOP::TAO_IOR_Manipulation::_tc_NotFound, ACE_TRY_ENV)) return 0; // not equal
+ if (!type->equivalent (TAO_IOP::TAO_IOR_Manipulation::_tc_NotFound, ACE_TRY_ENV)) // not equal
+ {
+ _tao_elem = 0;
+ return 0;
+ }
ACE_TRY_CHECK;
if (_tao_any.any_owns_data ())
{
@@ -561,25 +773,84 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, TAO_IOP::TAO_IOR_Manipul
else
{
ACE_NEW_RETURN (_tao_elem, TAO_IOP::TAO_IOR_Manipulation::NotFound, 0);
- TAO_InputCDR stream (_tao_any._tao_get_cdr (),
- _tao_any._tao_byte_order ());
- if (stream.decode (TAO_IOP::TAO_IOR_Manipulation::_tc_NotFound, _tao_elem, 0, ACE_TRY_ENV)
- == CORBA::TypeCode::TRAVERSE_CONTINUE)
+ TAO_InputCDR stream (
+ _tao_any._tao_get_cdr (),
+ _tao_any._tao_byte_order ()
+ );
+ if (stream >> *_tao_elem)
{
- ((CORBA::Any *)&_tao_any)->replace (TAO_IOP::TAO_IOR_Manipulation::_tc_NotFound, _tao_elem, 1, ACE_TRY_ENV);
+ ((CORBA::Any *)&_tao_any)->_tao_replace (
+ TAO_IOP::TAO_IOR_Manipulation::_tc_NotFound,
+ 1,
+ ACE_reinterpret_cast (void *, _tao_elem),
+ ACE_TRY_ENV
+ );
ACE_TRY_CHECK;
return 1;
}
else
{
delete _tao_elem;
+ _tao_elem = 0;
}
}
}
ACE_CATCHANY
{
delete _tao_elem;
- return 0;
+ _tao_elem = 0;
+ return 0;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, const TAO_IOP::TAO_IOR_Manipulation::NotFound *&_tao_elem)
+{
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::TypeCode_var type = _tao_any.type ();
+ if (!type->equivalent (TAO_IOP::TAO_IOR_Manipulation::_tc_NotFound, ACE_TRY_ENV)) // not equal
+ {
+ _tao_elem = 0;
+ return 0;
+ }
+ ACE_TRY_CHECK;
+ if (_tao_any.any_owns_data ())
+ {
+ _tao_elem = (TAO_IOP::TAO_IOR_Manipulation::NotFound *)_tao_any.value ();
+ return 1;
+ }
+ else
+ {
+ ACE_NEW_RETURN (_tao_elem, TAO_IOP::TAO_IOR_Manipulation::NotFound, 0);
+ TAO_InputCDR stream (
+ _tao_any._tao_get_cdr (),
+ _tao_any._tao_byte_order ()
+ );
+ if (stream >> *(TAO_IOP::TAO_IOR_Manipulation::NotFound *)_tao_elem)
+ {
+ ((CORBA::Any *)&_tao_any)->_tao_replace (
+ TAO_IOP::TAO_IOR_Manipulation::_tc_NotFound,
+ 1,
+ ACE_reinterpret_cast (void *, ACE_const_cast (TAO_IOP::TAO_IOR_Manipulation::NotFound *&, _tao_elem)),
+ ACE_TRY_ENV
+ );
+ ACE_TRY_CHECK;
+ return 1;
+ }
+ else
+ {
+ delete ACE_const_cast (TAO_IOP::TAO_IOR_Manipulation::NotFound *&, _tao_elem);
+ _tao_elem = 0;
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ delete ACE_const_cast (TAO_IOP::TAO_IOR_Manipulation::NotFound *&, _tao_elem);
+ _tao_elem = 0;
+ return 0;
}
ACE_ENDTRY;
return 0;
@@ -587,14 +858,24 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, TAO_IOP::TAO_IOR_Manipul
void operator<<= (CORBA::Any &_tao_any, const TAO_IOP::TAO_IOR_Manipulation::Duplicate &_tao_elem) // copying
{
- TAO_IOP::TAO_IOR_Manipulation::Duplicate *_tao_any_val = new TAO_IOP::TAO_IOR_Manipulation::Duplicate (_tao_elem);
+ TAO_IOP::TAO_IOR_Manipulation::Duplicate *_tao_any_val = 0;
+ ACE_NEW (_tao_any_val, TAO_IOP::TAO_IOR_Manipulation::Duplicate (_tao_elem));
if (!_tao_any_val) return;
ACE_TRY_NEW_ENV
{
- _tao_any.replace (TAO_IOP::TAO_IOR_Manipulation::_tc_Duplicate, _tao_any_val, 1, ACE_TRY_ENV);
+ TAO_OutputCDR stream;
+ stream << *_tao_any_val;
+ _tao_any._tao_replace (
+ TAO_IOP::TAO_IOR_Manipulation::_tc_Duplicate,
+ TAO_ENCAP_BYTE_ORDER,
+ stream.begin (),
+ 1,
+ _tao_any_val,
+ ACE_TRY_ENV
+ );
ACE_TRY_CHECK;
}
- ACE_CATCHANY
+ ACE_CATCHANY
{
delete _tao_any_val;
}
@@ -605,10 +886,23 @@ void operator<<= (CORBA::Any &_tao_any, TAO_IOP::TAO_IOR_Manipulation::Duplicate
{
ACE_TRY_NEW_ENV
{
- _tao_any.replace (TAO_IOP::TAO_IOR_Manipulation::_tc_Duplicate, _tao_elem, 1, ACE_TRY_ENV); // consume it
+ TAO_OutputCDR stream;
+ stream << *_tao_elem;
+ _tao_any._tao_replace (
+ TAO_IOP::TAO_IOR_Manipulation::_tc_Duplicate,
+ TAO_ENCAP_BYTE_ORDER,
+ stream.begin (),
+ 1,
+ _tao_elem,
+ ACE_TRY_ENV
+ );
ACE_TRY_CHECK;
}
- ACE_CATCHANY {}
+ ACE_CATCHANY
+ {
+ delete _tao_elem;
+ _tao_elem = 0;
+ }
ACE_ENDTRY;
}
@@ -617,7 +911,11 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, TAO_IOP::TAO_IOR_Manipul
ACE_TRY_NEW_ENV
{
CORBA::TypeCode_var type = _tao_any.type ();
- if (!type->equal (TAO_IOP::TAO_IOR_Manipulation::_tc_Duplicate, ACE_TRY_ENV)) return 0; // not equal
+ if (!type->equivalent (TAO_IOP::TAO_IOR_Manipulation::_tc_Duplicate, ACE_TRY_ENV)) // not equal
+ {
+ _tao_elem = 0;
+ return 0;
+ }
ACE_TRY_CHECK;
if (_tao_any.any_owns_data ())
{
@@ -627,25 +925,84 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, TAO_IOP::TAO_IOR_Manipul
else
{
ACE_NEW_RETURN (_tao_elem, TAO_IOP::TAO_IOR_Manipulation::Duplicate, 0);
- TAO_InputCDR stream (_tao_any._tao_get_cdr (),
- _tao_any._tao_byte_order ());
- if (stream.decode (TAO_IOP::TAO_IOR_Manipulation::_tc_Duplicate, _tao_elem, 0, ACE_TRY_ENV)
- == CORBA::TypeCode::TRAVERSE_CONTINUE)
+ TAO_InputCDR stream (
+ _tao_any._tao_get_cdr (),
+ _tao_any._tao_byte_order ()
+ );
+ if (stream >> *_tao_elem)
{
- ((CORBA::Any *)&_tao_any)->replace (TAO_IOP::TAO_IOR_Manipulation::_tc_Duplicate, _tao_elem, 1, ACE_TRY_ENV);
+ ((CORBA::Any *)&_tao_any)->_tao_replace (
+ TAO_IOP::TAO_IOR_Manipulation::_tc_Duplicate,
+ 1,
+ ACE_reinterpret_cast (void *, _tao_elem),
+ ACE_TRY_ENV
+ );
ACE_TRY_CHECK;
return 1;
}
else
{
delete _tao_elem;
+ _tao_elem = 0;
}
}
}
ACE_CATCHANY
{
delete _tao_elem;
- return 0;
+ _tao_elem = 0;
+ return 0;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, const TAO_IOP::TAO_IOR_Manipulation::Duplicate *&_tao_elem)
+{
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::TypeCode_var type = _tao_any.type ();
+ if (!type->equivalent (TAO_IOP::TAO_IOR_Manipulation::_tc_Duplicate, ACE_TRY_ENV)) // not equal
+ {
+ _tao_elem = 0;
+ return 0;
+ }
+ ACE_TRY_CHECK;
+ if (_tao_any.any_owns_data ())
+ {
+ _tao_elem = (TAO_IOP::TAO_IOR_Manipulation::Duplicate *)_tao_any.value ();
+ return 1;
+ }
+ else
+ {
+ ACE_NEW_RETURN (_tao_elem, TAO_IOP::TAO_IOR_Manipulation::Duplicate, 0);
+ TAO_InputCDR stream (
+ _tao_any._tao_get_cdr (),
+ _tao_any._tao_byte_order ()
+ );
+ if (stream >> *(TAO_IOP::TAO_IOR_Manipulation::Duplicate *)_tao_elem)
+ {
+ ((CORBA::Any *)&_tao_any)->_tao_replace (
+ TAO_IOP::TAO_IOR_Manipulation::_tc_Duplicate,
+ 1,
+ ACE_reinterpret_cast (void *, ACE_const_cast (TAO_IOP::TAO_IOR_Manipulation::Duplicate *&, _tao_elem)),
+ ACE_TRY_ENV
+ );
+ ACE_TRY_CHECK;
+ return 1;
+ }
+ else
+ {
+ delete ACE_const_cast (TAO_IOP::TAO_IOR_Manipulation::Duplicate *&, _tao_elem);
+ _tao_elem = 0;
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ delete ACE_const_cast (TAO_IOP::TAO_IOR_Manipulation::Duplicate *&, _tao_elem);
+ _tao_elem = 0;
+ return 0;
}
ACE_ENDTRY;
return 0;
@@ -653,14 +1010,24 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, TAO_IOP::TAO_IOR_Manipul
void operator<<= (CORBA::Any &_tao_any, const TAO_IOP::TAO_IOR_Manipulation::Invalid_IOR &_tao_elem) // copying
{
- TAO_IOP::TAO_IOR_Manipulation::Invalid_IOR *_tao_any_val = new TAO_IOP::TAO_IOR_Manipulation::Invalid_IOR (_tao_elem);
+ TAO_IOP::TAO_IOR_Manipulation::Invalid_IOR *_tao_any_val = 0;
+ ACE_NEW (_tao_any_val, TAO_IOP::TAO_IOR_Manipulation::Invalid_IOR (_tao_elem));
if (!_tao_any_val) return;
ACE_TRY_NEW_ENV
{
- _tao_any.replace (TAO_IOP::TAO_IOR_Manipulation::_tc_Invalid_IOR, _tao_any_val, 1, ACE_TRY_ENV);
+ TAO_OutputCDR stream;
+ stream << *_tao_any_val;
+ _tao_any._tao_replace (
+ TAO_IOP::TAO_IOR_Manipulation::_tc_Invalid_IOR,
+ TAO_ENCAP_BYTE_ORDER,
+ stream.begin (),
+ 1,
+ _tao_any_val,
+ ACE_TRY_ENV
+ );
ACE_TRY_CHECK;
}
- ACE_CATCHANY
+ ACE_CATCHANY
{
delete _tao_any_val;
}
@@ -671,10 +1038,23 @@ void operator<<= (CORBA::Any &_tao_any, TAO_IOP::TAO_IOR_Manipulation::Invalid_I
{
ACE_TRY_NEW_ENV
{
- _tao_any.replace (TAO_IOP::TAO_IOR_Manipulation::_tc_Invalid_IOR, _tao_elem, 1, ACE_TRY_ENV); // consume it
+ TAO_OutputCDR stream;
+ stream << *_tao_elem;
+ _tao_any._tao_replace (
+ TAO_IOP::TAO_IOR_Manipulation::_tc_Invalid_IOR,
+ TAO_ENCAP_BYTE_ORDER,
+ stream.begin (),
+ 1,
+ _tao_elem,
+ ACE_TRY_ENV
+ );
ACE_TRY_CHECK;
}
- ACE_CATCHANY {}
+ ACE_CATCHANY
+ {
+ delete _tao_elem;
+ _tao_elem = 0;
+ }
ACE_ENDTRY;
}
@@ -683,7 +1063,11 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, TAO_IOP::TAO_IOR_Manipul
ACE_TRY_NEW_ENV
{
CORBA::TypeCode_var type = _tao_any.type ();
- if (!type->equal (TAO_IOP::TAO_IOR_Manipulation::_tc_Invalid_IOR, ACE_TRY_ENV)) return 0; // not equal
+ if (!type->equivalent (TAO_IOP::TAO_IOR_Manipulation::_tc_Invalid_IOR, ACE_TRY_ENV)) // not equal
+ {
+ _tao_elem = 0;
+ return 0;
+ }
ACE_TRY_CHECK;
if (_tao_any.any_owns_data ())
{
@@ -693,25 +1077,84 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, TAO_IOP::TAO_IOR_Manipul
else
{
ACE_NEW_RETURN (_tao_elem, TAO_IOP::TAO_IOR_Manipulation::Invalid_IOR, 0);
- TAO_InputCDR stream (_tao_any._tao_get_cdr (),
- _tao_any._tao_byte_order ());
- if (stream.decode (TAO_IOP::TAO_IOR_Manipulation::_tc_Invalid_IOR, _tao_elem, 0, ACE_TRY_ENV)
- == CORBA::TypeCode::TRAVERSE_CONTINUE)
+ TAO_InputCDR stream (
+ _tao_any._tao_get_cdr (),
+ _tao_any._tao_byte_order ()
+ );
+ if (stream >> *_tao_elem)
{
- ((CORBA::Any *)&_tao_any)->replace (TAO_IOP::TAO_IOR_Manipulation::_tc_Invalid_IOR, _tao_elem, 1, ACE_TRY_ENV);
+ ((CORBA::Any *)&_tao_any)->_tao_replace (
+ TAO_IOP::TAO_IOR_Manipulation::_tc_Invalid_IOR,
+ 1,
+ ACE_reinterpret_cast (void *, _tao_elem),
+ ACE_TRY_ENV
+ );
ACE_TRY_CHECK;
return 1;
}
else
{
delete _tao_elem;
+ _tao_elem = 0;
}
}
}
ACE_CATCHANY
{
delete _tao_elem;
- return 0;
+ _tao_elem = 0;
+ return 0;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, const TAO_IOP::TAO_IOR_Manipulation::Invalid_IOR *&_tao_elem)
+{
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::TypeCode_var type = _tao_any.type ();
+ if (!type->equivalent (TAO_IOP::TAO_IOR_Manipulation::_tc_Invalid_IOR, ACE_TRY_ENV)) // not equal
+ {
+ _tao_elem = 0;
+ return 0;
+ }
+ ACE_TRY_CHECK;
+ if (_tao_any.any_owns_data ())
+ {
+ _tao_elem = (TAO_IOP::TAO_IOR_Manipulation::Invalid_IOR *)_tao_any.value ();
+ return 1;
+ }
+ else
+ {
+ ACE_NEW_RETURN (_tao_elem, TAO_IOP::TAO_IOR_Manipulation::Invalid_IOR, 0);
+ TAO_InputCDR stream (
+ _tao_any._tao_get_cdr (),
+ _tao_any._tao_byte_order ()
+ );
+ if (stream >> *(TAO_IOP::TAO_IOR_Manipulation::Invalid_IOR *)_tao_elem)
+ {
+ ((CORBA::Any *)&_tao_any)->_tao_replace (
+ TAO_IOP::TAO_IOR_Manipulation::_tc_Invalid_IOR,
+ 1,
+ ACE_reinterpret_cast (void *, ACE_const_cast (TAO_IOP::TAO_IOR_Manipulation::Invalid_IOR *&, _tao_elem)),
+ ACE_TRY_ENV
+ );
+ ACE_TRY_CHECK;
+ return 1;
+ }
+ else
+ {
+ delete ACE_const_cast (TAO_IOP::TAO_IOR_Manipulation::Invalid_IOR *&, _tao_elem);
+ _tao_elem = 0;
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ delete ACE_const_cast (TAO_IOP::TAO_IOR_Manipulation::Invalid_IOR *&, _tao_elem);
+ _tao_elem = 0;
+ return 0;
}
ACE_ENDTRY;
return 0;
@@ -727,8 +1170,23 @@ void operator<<= (
if (!_tao_any_val) return;
ACE_TRY_NEW_ENV
{
- _tao_any.replace (TAO_IOP::TAO_IOR_Manipulation::_tc_IORList, _tao_any_val, 1, ACE_TRY_ENV); // copy the value
- ACE_TRY_CHECK;
+ TAO_OutputCDR stream;
+ if (stream << *_tao_any_val)
+ {
+ _tao_any._tao_replace (
+ TAO_IOP::TAO_IOR_Manipulation::_tc_IORList,
+ TAO_ENCAP_BYTE_ORDER,
+ stream.begin (),
+ 1,
+ _tao_any_val,
+ ACE_TRY_ENV
+ );
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ delete _tao_any_val;
+ }
}
ACE_CATCHANY
{
@@ -741,10 +1199,23 @@ void operator<<= (CORBA::Any &_tao_any, TAO_IOP::TAO_IOR_Manipulation::IORList *
{
ACE_TRY_NEW_ENV
{
- _tao_any.replace (TAO_IOP::TAO_IOR_Manipulation::_tc_IORList, _tao_elem, 0, ACE_TRY_ENV);
+ TAO_OutputCDR stream;
+ stream << *_tao_elem;
+ _tao_any._tao_replace (
+ TAO_IOP::TAO_IOR_Manipulation::_tc_IORList,
+ TAO_ENCAP_BYTE_ORDER,
+ stream.begin (),
+ 1,
+ _tao_elem,
+ ACE_TRY_ENV
+ );
ACE_TRY_CHECK;
}
- ACE_CATCHANY {}
+ ACE_CATCHANY
+ {
+ delete _tao_elem;
+ _tao_elem = 0;
+ }
ACE_ENDTRY;
}
@@ -753,7 +1224,11 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, TAO_IOP::TAO_IOR_Manipul
ACE_TRY_NEW_ENV
{
CORBA::TypeCode_var type = _tao_any.type ();
- if (!type->equal (TAO_IOP::TAO_IOR_Manipulation::_tc_IORList, ACE_TRY_ENV)) return 0; // not equal
+ if (!type->equivalent (TAO_IOP::TAO_IOR_Manipulation::_tc_IORList, ACE_TRY_ENV)) // not equal
+ {
+ _tao_elem = 0;
+ return 0;
+ }
ACE_TRY_CHECK;
if (_tao_any.any_owns_data ())
{
@@ -763,25 +1238,84 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, TAO_IOP::TAO_IOR_Manipul
else
{
ACE_NEW_RETURN (_tao_elem, TAO_IOP::TAO_IOR_Manipulation::IORList, 0);
- TAO_InputCDR stream (_tao_any._tao_get_cdr (),
- _tao_any._tao_byte_order ());
- if (stream.decode (TAO_IOP::TAO_IOR_Manipulation::_tc_IORList, _tao_elem, 0, ACE_TRY_ENV)
- == CORBA::TypeCode::TRAVERSE_CONTINUE)
+ TAO_InputCDR stream (
+ _tao_any._tao_get_cdr (),
+ _tao_any._tao_byte_order ()
+ );
+ if (stream >> *_tao_elem)
{
- ((CORBA::Any *)&_tao_any)->replace (TAO_IOP::TAO_IOR_Manipulation::_tc_IORList, _tao_elem, 1, ACE_TRY_ENV);
+ ((CORBA::Any *)&_tao_any)->_tao_replace (
+ TAO_IOP::TAO_IOR_Manipulation::_tc_IORList,
+ 1,
+ ACE_reinterpret_cast (void *, _tao_elem),
+ ACE_TRY_ENV
+ );
ACE_TRY_CHECK;
return 1;
}
else
{
delete _tao_elem;
+ _tao_elem = 0;
}
}
}
ACE_CATCHANY
{
delete _tao_elem;
- return 0;
+ _tao_elem = 0;
+ return 0;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, const TAO_IOP::TAO_IOR_Manipulation::IORList *&_tao_elem)
+{
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::TypeCode_var type = _tao_any.type ();
+ if (!type->equivalent (TAO_IOP::TAO_IOR_Manipulation::_tc_IORList, ACE_TRY_ENV)) // not equal
+ {
+ _tao_elem = 0;
+ return 0;
+ }
+ ACE_TRY_CHECK;
+ if (_tao_any.any_owns_data ())
+ {
+ _tao_elem = (TAO_IOP::TAO_IOR_Manipulation::IORList *)_tao_any.value ();
+ return 1;
+ }
+ else
+ {
+ ACE_NEW_RETURN (_tao_elem, TAO_IOP::TAO_IOR_Manipulation::IORList, 0);
+ TAO_InputCDR stream (
+ _tao_any._tao_get_cdr (),
+ _tao_any._tao_byte_order ()
+ );
+ if (stream >> *(TAO_IOP::TAO_IOR_Manipulation::IORList *)_tao_elem)
+ {
+ ((CORBA::Any *)&_tao_any)->_tao_replace (
+ TAO_IOP::TAO_IOR_Manipulation::_tc_IORList,
+ 1,
+ ACE_reinterpret_cast (void *, ACE_const_cast (TAO_IOP::TAO_IOR_Manipulation::IORList *&, _tao_elem)),
+ ACE_TRY_ENV
+ );
+ ACE_TRY_CHECK;
+ return 1;
+ }
+ else
+ {
+ delete ACE_const_cast (TAO_IOP::TAO_IOR_Manipulation::IORList *&, _tao_elem);
+ _tao_elem = 0;
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ delete ACE_const_cast (TAO_IOP::TAO_IOR_Manipulation::IORList *&, _tao_elem);
+ _tao_elem = 0;
+ return 0;
}
ACE_ENDTRY;
return 0;