summaryrefslogtreecommitdiff
path: root/TAO/tao/IOPC.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tao/IOPC.cpp')
-rw-r--r--TAO/tao/IOPC.cpp662
1 files changed, 592 insertions, 70 deletions
diff --git a/TAO/tao/IOPC.cpp b/TAO/tao/IOPC.cpp
index ec9d78943d4..226f26aab0b 100644
--- a/TAO/tao/IOPC.cpp
+++ b/TAO/tao/IOPC.cpp
@@ -538,12 +538,21 @@ TAO_NAMESPACE_DEFINE (const CORBA::ULong, UnknownExceptionInfo, 9)
TAO_NAMESPACE_END
void operator<<= (CORBA::Any &_tao_any, const IOP::TaggedProfile &_tao_elem) // copying
{
- IOP::TaggedProfile *_any_val;
+ IOP::TaggedProfile *_any_val = 0;
ACE_NEW (_any_val, IOP::TaggedProfile (_tao_elem));
if (!_any_val) return;
ACE_TRY_NEW_ENV
{
- _tao_any.replace (IOP::_tc_TaggedProfile, _any_val, 1, ACE_TRY_ENV); // copy the value
+ TAO_OutputCDR stream;
+ stream << *_any_val;
+ _tao_any._tao_replace (
+ IOP::_tc_TaggedProfile,
+ TAO_ENCAP_BYTE_ORDER,
+ stream.begin (),
+ 1,
+ _any_val,
+ ACE_TRY_ENV
+ );
ACE_TRY_CHECK;
}
ACE_CATCHANY
@@ -557,10 +566,23 @@ void operator<<= (CORBA::Any &_tao_any, IOP::TaggedProfile *_tao_elem) // non co
{
ACE_TRY_NEW_ENV
{
- _tao_any.replace (IOP::_tc_TaggedProfile, _tao_elem, 1, ACE_TRY_ENV); // consume it
+ TAO_OutputCDR stream;
+ stream << *_tao_elem;
+ _tao_any._tao_replace (
+ IOP::_tc_TaggedProfile,
+ 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;
}
@@ -569,35 +591,98 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, IOP::TaggedProfile *&_ta
ACE_TRY_NEW_ENV
{
CORBA::TypeCode_var type = _tao_any.type ();
- if (!type->equal (IOP::_tc_TaggedProfile, ACE_TRY_ENV)) return 0; // not equal
+ if (!type->equivalent (IOP::_tc_TaggedProfile, ACE_TRY_ENV)) // not equal
+ {
+ _tao_elem = 0;
+ return 0;
+ }
ACE_TRY_CHECK;
if (_tao_any.any_owns_data ())
{
_tao_elem = (IOP::TaggedProfile *)_tao_any.value ();
return 1;
- }
+ }
else
{
ACE_NEW_RETURN (_tao_elem, IOP::TaggedProfile, 0);
- TAO_InputCDR stream (_tao_any._tao_get_cdr (),
- _tao_any._tao_byte_order ());
- if (stream.decode (IOP::_tc_TaggedProfile, _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 (IOP::_tc_TaggedProfile, _tao_elem, 1, ACE_TRY_ENV);
+ ((CORBA::Any *)&_tao_any)->_tao_replace (
+ IOP::_tc_TaggedProfile,
+ 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 IOP::TaggedProfile *&_tao_elem)
+{
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::TypeCode_var type = _tao_any.type ();
+ if (!type->equivalent (IOP::_tc_TaggedProfile, ACE_TRY_ENV)) // not equal
+ {
+ _tao_elem = 0;
+ return 0;
+ }
+ ACE_TRY_CHECK;
+ if (_tao_any.any_owns_data ())
+ {
+ _tao_elem = (IOP::TaggedProfile *)_tao_any.value ();
+ return 1;
+ }
+ else
+ {
+ ACE_NEW_RETURN (_tao_elem, IOP::TaggedProfile, 0);
+ TAO_InputCDR stream (
+ _tao_any._tao_get_cdr (),
+ _tao_any._tao_byte_order ()
+ );
+ if (stream >> *(IOP::TaggedProfile *)_tao_elem)
+ {
+ ((CORBA::Any *)&_tao_any)->_tao_replace (
+ IOP::_tc_TaggedProfile,
+ 1,
+ ACE_reinterpret_cast (void *, ACE_const_cast (IOP::TaggedProfile *&, _tao_elem)),
+ ACE_TRY_ENV
+ );
+ ACE_TRY_CHECK;
+ return 1;
+ }
+ else
+ {
+ delete ACE_const_cast (IOP::TaggedProfile *&, _tao_elem);
+ _tao_elem = 0;
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ delete ACE_const_cast (IOP::TaggedProfile *&, _tao_elem);
+ _tao_elem = 0;
+ return 0;
}
ACE_ENDTRY;
return 0;
@@ -605,12 +690,21 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, IOP::TaggedProfile *&_ta
void operator<<= (CORBA::Any &_tao_any, const IOP::IOR &_tao_elem) // copying
{
- IOP::IOR *_any_val;
+ IOP::IOR *_any_val = 0;
ACE_NEW (_any_val, IOP::IOR (_tao_elem));
if (!_any_val) return;
ACE_TRY_NEW_ENV
{
- _tao_any.replace (IOP::_tc_IOR, _any_val, 1, ACE_TRY_ENV); // copy the value
+ TAO_OutputCDR stream;
+ stream << *_any_val;
+ _tao_any._tao_replace (
+ IOP::_tc_IOR,
+ TAO_ENCAP_BYTE_ORDER,
+ stream.begin (),
+ 1,
+ _any_val,
+ ACE_TRY_ENV
+ );
ACE_TRY_CHECK;
}
ACE_CATCHANY
@@ -624,10 +718,23 @@ void operator<<= (CORBA::Any &_tao_any, IOP::IOR *_tao_elem) // non copying
{
ACE_TRY_NEW_ENV
{
- _tao_any.replace (IOP::_tc_IOR, _tao_elem, 1, ACE_TRY_ENV); // consume it
+ TAO_OutputCDR stream;
+ stream << *_tao_elem;
+ _tao_any._tao_replace (
+ IOP::_tc_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;
}
@@ -636,35 +743,98 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, IOP::IOR *&_tao_elem)
ACE_TRY_NEW_ENV
{
CORBA::TypeCode_var type = _tao_any.type ();
- if (!type->equal (IOP::_tc_IOR, ACE_TRY_ENV)) return 0; // not equal
+ if (!type->equivalent (IOP::_tc_IOR, ACE_TRY_ENV)) // not equal
+ {
+ _tao_elem = 0;
+ return 0;
+ }
ACE_TRY_CHECK;
if (_tao_any.any_owns_data ())
{
_tao_elem = (IOP::IOR *)_tao_any.value ();
return 1;
- }
+ }
else
{
ACE_NEW_RETURN (_tao_elem, IOP::IOR, 0);
- TAO_InputCDR stream (_tao_any._tao_get_cdr (),
- _tao_any._tao_byte_order ());
- if (stream.decode (IOP::_tc_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 (IOP::_tc_IOR, _tao_elem, 1, ACE_TRY_ENV);
+ ((CORBA::Any *)&_tao_any)->_tao_replace (
+ IOP::_tc_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 IOP::IOR *&_tao_elem)
+{
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::TypeCode_var type = _tao_any.type ();
+ if (!type->equivalent (IOP::_tc_IOR, ACE_TRY_ENV)) // not equal
+ {
+ _tao_elem = 0;
+ return 0;
+ }
+ ACE_TRY_CHECK;
+ if (_tao_any.any_owns_data ())
+ {
+ _tao_elem = (IOP::IOR *)_tao_any.value ();
+ return 1;
+ }
+ else
+ {
+ ACE_NEW_RETURN (_tao_elem, IOP::IOR, 0);
+ TAO_InputCDR stream (
+ _tao_any._tao_get_cdr (),
+ _tao_any._tao_byte_order ()
+ );
+ if (stream >> *(IOP::IOR *)_tao_elem)
+ {
+ ((CORBA::Any *)&_tao_any)->_tao_replace (
+ IOP::_tc_IOR,
+ 1,
+ ACE_reinterpret_cast (void *, ACE_const_cast (IOP::IOR *&, _tao_elem)),
+ ACE_TRY_ENV
+ );
+ ACE_TRY_CHECK;
+ return 1;
+ }
+ else
+ {
+ delete ACE_const_cast (IOP::IOR *&, _tao_elem);
+ _tao_elem = 0;
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ delete ACE_const_cast (IOP::IOR *&, _tao_elem);
+ _tao_elem = 0;
+ return 0;
}
ACE_ENDTRY;
return 0;
@@ -672,12 +842,21 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, IOP::IOR *&_tao_elem)
void operator<<= (CORBA::Any &_tao_any, const IOP::TaggedComponent &_tao_elem) // copying
{
- IOP::TaggedComponent *_any_val;
+ IOP::TaggedComponent *_any_val = 0;
ACE_NEW (_any_val, IOP::TaggedComponent (_tao_elem));
if (!_any_val) return;
ACE_TRY_NEW_ENV
{
- _tao_any.replace (IOP::_tc_TaggedComponent, _any_val, 1, ACE_TRY_ENV); // copy the value
+ TAO_OutputCDR stream;
+ stream << *_any_val;
+ _tao_any._tao_replace (
+ IOP::_tc_TaggedComponent,
+ TAO_ENCAP_BYTE_ORDER,
+ stream.begin (),
+ 1,
+ _any_val,
+ ACE_TRY_ENV
+ );
ACE_TRY_CHECK;
}
ACE_CATCHANY
@@ -691,10 +870,23 @@ void operator<<= (CORBA::Any &_tao_any, IOP::TaggedComponent *_tao_elem) // non
{
ACE_TRY_NEW_ENV
{
- _tao_any.replace (IOP::_tc_TaggedComponent, _tao_elem, 1, ACE_TRY_ENV); // consume it
+ TAO_OutputCDR stream;
+ stream << *_tao_elem;
+ _tao_any._tao_replace (
+ IOP::_tc_TaggedComponent,
+ 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;
}
@@ -703,35 +895,98 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, IOP::TaggedComponent *&_
ACE_TRY_NEW_ENV
{
CORBA::TypeCode_var type = _tao_any.type ();
- if (!type->equal (IOP::_tc_TaggedComponent, ACE_TRY_ENV)) return 0; // not equal
+ if (!type->equivalent (IOP::_tc_TaggedComponent, ACE_TRY_ENV)) // not equal
+ {
+ _tao_elem = 0;
+ return 0;
+ }
ACE_TRY_CHECK;
if (_tao_any.any_owns_data ())
{
_tao_elem = (IOP::TaggedComponent *)_tao_any.value ();
return 1;
- }
+ }
else
{
ACE_NEW_RETURN (_tao_elem, IOP::TaggedComponent, 0);
- TAO_InputCDR stream (_tao_any._tao_get_cdr (),
- _tao_any._tao_byte_order ());
- if (stream.decode (IOP::_tc_TaggedComponent, _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 (IOP::_tc_TaggedComponent, _tao_elem, 1, ACE_TRY_ENV);
+ ((CORBA::Any *)&_tao_any)->_tao_replace (
+ IOP::_tc_TaggedComponent,
+ 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 IOP::TaggedComponent *&_tao_elem)
+{
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::TypeCode_var type = _tao_any.type ();
+ if (!type->equivalent (IOP::_tc_TaggedComponent, ACE_TRY_ENV)) // not equal
+ {
+ _tao_elem = 0;
+ return 0;
+ }
+ ACE_TRY_CHECK;
+ if (_tao_any.any_owns_data ())
+ {
+ _tao_elem = (IOP::TaggedComponent *)_tao_any.value ();
+ return 1;
+ }
+ else
+ {
+ ACE_NEW_RETURN (_tao_elem, IOP::TaggedComponent, 0);
+ TAO_InputCDR stream (
+ _tao_any._tao_get_cdr (),
+ _tao_any._tao_byte_order ()
+ );
+ if (stream >> *(IOP::TaggedComponent *)_tao_elem)
+ {
+ ((CORBA::Any *)&_tao_any)->_tao_replace (
+ IOP::_tc_TaggedComponent,
+ 1,
+ ACE_reinterpret_cast (void *, ACE_const_cast (IOP::TaggedComponent *&, _tao_elem)),
+ ACE_TRY_ENV
+ );
+ ACE_TRY_CHECK;
+ return 1;
+ }
+ else
+ {
+ delete ACE_const_cast (IOP::TaggedComponent *&, _tao_elem);
+ _tao_elem = 0;
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ delete ACE_const_cast (IOP::TaggedComponent *&, _tao_elem);
+ _tao_elem = 0;
+ return 0;
}
ACE_ENDTRY;
return 0;
@@ -747,8 +1002,23 @@ void operator<<= (
if (!_tao_any_val) return;
ACE_TRY_NEW_ENV
{
- _tao_any.replace (IOP::_tc_MultipleComponentProfile, _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 (
+ IOP::_tc_MultipleComponentProfile,
+ TAO_ENCAP_BYTE_ORDER,
+ stream.begin (),
+ 1,
+ _tao_any_val,
+ ACE_TRY_ENV
+ );
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ delete _tao_any_val;
+ }
}
ACE_CATCHANY
{
@@ -761,10 +1031,23 @@ void operator<<= (CORBA::Any &_tao_any, IOP::MultipleComponentProfile *_tao_elem
{
ACE_TRY_NEW_ENV
{
- _tao_any.replace (IOP::_tc_MultipleComponentProfile, _tao_elem, 0, ACE_TRY_ENV);
+ TAO_OutputCDR stream;
+ stream << *_tao_elem;
+ _tao_any._tao_replace (
+ IOP::_tc_MultipleComponentProfile,
+ 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;
}
@@ -773,7 +1056,11 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, IOP::MultipleComponentPr
ACE_TRY_NEW_ENV
{
CORBA::TypeCode_var type = _tao_any.type ();
- if (!type->equal (IOP::_tc_MultipleComponentProfile, ACE_TRY_ENV)) return 0; // not equal
+ if (!type->equivalent (IOP::_tc_MultipleComponentProfile, ACE_TRY_ENV)) // not equal
+ {
+ _tao_elem = 0;
+ return 0;
+ }
ACE_TRY_CHECK;
if (_tao_any.any_owns_data ())
{
@@ -783,25 +1070,84 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, IOP::MultipleComponentPr
else
{
ACE_NEW_RETURN (_tao_elem, IOP::MultipleComponentProfile, 0);
- TAO_InputCDR stream (_tao_any._tao_get_cdr (),
- _tao_any._tao_byte_order ());
- if (stream.decode (IOP::_tc_MultipleComponentProfile, _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 (IOP::_tc_MultipleComponentProfile, _tao_elem, 1, ACE_TRY_ENV);
+ ((CORBA::Any *)&_tao_any)->_tao_replace (
+ IOP::_tc_MultipleComponentProfile,
+ 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 IOP::MultipleComponentProfile *&_tao_elem)
+{
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::TypeCode_var type = _tao_any.type ();
+ if (!type->equivalent (IOP::_tc_MultipleComponentProfile, ACE_TRY_ENV)) // not equal
+ {
+ _tao_elem = 0;
+ return 0;
+ }
+ ACE_TRY_CHECK;
+ if (_tao_any.any_owns_data ())
+ {
+ _tao_elem = (IOP::MultipleComponentProfile *)_tao_any.value ();
+ return 1;
+ }
+ else
+ {
+ ACE_NEW_RETURN (_tao_elem, IOP::MultipleComponentProfile, 0);
+ TAO_InputCDR stream (
+ _tao_any._tao_get_cdr (),
+ _tao_any._tao_byte_order ()
+ );
+ if (stream >> *(IOP::MultipleComponentProfile *)_tao_elem)
+ {
+ ((CORBA::Any *)&_tao_any)->_tao_replace (
+ IOP::_tc_MultipleComponentProfile,
+ 1,
+ ACE_reinterpret_cast (void *, ACE_const_cast (IOP::MultipleComponentProfile *&, _tao_elem)),
+ ACE_TRY_ENV
+ );
+ ACE_TRY_CHECK;
+ return 1;
+ }
+ else
+ {
+ delete ACE_const_cast (IOP::MultipleComponentProfile *&, _tao_elem);
+ _tao_elem = 0;
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ delete ACE_const_cast (IOP::MultipleComponentProfile *&, _tao_elem);
+ _tao_elem = 0;
+ return 0;
}
ACE_ENDTRY;
return 0;
@@ -809,12 +1155,21 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, IOP::MultipleComponentPr
void operator<<= (CORBA::Any &_tao_any, const IOP::ServiceContext &_tao_elem) // copying
{
- IOP::ServiceContext *_any_val;
+ IOP::ServiceContext *_any_val = 0;
ACE_NEW (_any_val, IOP::ServiceContext (_tao_elem));
if (!_any_val) return;
ACE_TRY_NEW_ENV
{
- _tao_any.replace (IOP::_tc_ServiceContext, _any_val, 1, ACE_TRY_ENV); // copy the value
+ TAO_OutputCDR stream;
+ stream << *_any_val;
+ _tao_any._tao_replace (
+ IOP::_tc_ServiceContext,
+ TAO_ENCAP_BYTE_ORDER,
+ stream.begin (),
+ 1,
+ _any_val,
+ ACE_TRY_ENV
+ );
ACE_TRY_CHECK;
}
ACE_CATCHANY
@@ -828,10 +1183,23 @@ void operator<<= (CORBA::Any &_tao_any, IOP::ServiceContext *_tao_elem) // non c
{
ACE_TRY_NEW_ENV
{
- _tao_any.replace (IOP::_tc_ServiceContext, _tao_elem, 1, ACE_TRY_ENV); // consume it
+ TAO_OutputCDR stream;
+ stream << *_tao_elem;
+ _tao_any._tao_replace (
+ IOP::_tc_ServiceContext,
+ 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;
}
@@ -840,35 +1208,98 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, IOP::ServiceContext *&_t
ACE_TRY_NEW_ENV
{
CORBA::TypeCode_var type = _tao_any.type ();
- if (!type->equal (IOP::_tc_ServiceContext, ACE_TRY_ENV)) return 0; // not equal
+ if (!type->equivalent (IOP::_tc_ServiceContext, ACE_TRY_ENV)) // not equal
+ {
+ _tao_elem = 0;
+ return 0;
+ }
ACE_TRY_CHECK;
if (_tao_any.any_owns_data ())
{
_tao_elem = (IOP::ServiceContext *)_tao_any.value ();
return 1;
- }
+ }
else
{
ACE_NEW_RETURN (_tao_elem, IOP::ServiceContext, 0);
- TAO_InputCDR stream (_tao_any._tao_get_cdr (),
- _tao_any._tao_byte_order ());
- if (stream.decode (IOP::_tc_ServiceContext, _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 (IOP::_tc_ServiceContext, _tao_elem, 1, ACE_TRY_ENV);
+ ((CORBA::Any *)&_tao_any)->_tao_replace (
+ IOP::_tc_ServiceContext,
+ 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 IOP::ServiceContext *&_tao_elem)
+{
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::TypeCode_var type = _tao_any.type ();
+ if (!type->equivalent (IOP::_tc_ServiceContext, ACE_TRY_ENV)) // not equal
+ {
+ _tao_elem = 0;
+ return 0;
+ }
+ ACE_TRY_CHECK;
+ if (_tao_any.any_owns_data ())
+ {
+ _tao_elem = (IOP::ServiceContext *)_tao_any.value ();
+ return 1;
+ }
+ else
+ {
+ ACE_NEW_RETURN (_tao_elem, IOP::ServiceContext, 0);
+ TAO_InputCDR stream (
+ _tao_any._tao_get_cdr (),
+ _tao_any._tao_byte_order ()
+ );
+ if (stream >> *(IOP::ServiceContext *)_tao_elem)
+ {
+ ((CORBA::Any *)&_tao_any)->_tao_replace (
+ IOP::_tc_ServiceContext,
+ 1,
+ ACE_reinterpret_cast (void *, ACE_const_cast (IOP::ServiceContext *&, _tao_elem)),
+ ACE_TRY_ENV
+ );
+ ACE_TRY_CHECK;
+ return 1;
+ }
+ else
+ {
+ delete ACE_const_cast (IOP::ServiceContext *&, _tao_elem);
+ _tao_elem = 0;
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ delete ACE_const_cast (IOP::ServiceContext *&, _tao_elem);
+ _tao_elem = 0;
+ return 0;
}
ACE_ENDTRY;
return 0;
@@ -884,8 +1315,23 @@ void operator<<= (
if (!_tao_any_val) return;
ACE_TRY_NEW_ENV
{
- _tao_any.replace (IOP::_tc_ServiceContextList, _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 (
+ IOP::_tc_ServiceContextList,
+ TAO_ENCAP_BYTE_ORDER,
+ stream.begin (),
+ 1,
+ _tao_any_val,
+ ACE_TRY_ENV
+ );
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ delete _tao_any_val;
+ }
}
ACE_CATCHANY
{
@@ -898,10 +1344,23 @@ void operator<<= (CORBA::Any &_tao_any, IOP::ServiceContextList *_tao_elem) // n
{
ACE_TRY_NEW_ENV
{
- _tao_any.replace (IOP::_tc_ServiceContextList, _tao_elem, 0, ACE_TRY_ENV);
+ TAO_OutputCDR stream;
+ stream << *_tao_elem;
+ _tao_any._tao_replace (
+ IOP::_tc_ServiceContextList,
+ 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;
}
@@ -910,7 +1369,11 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, IOP::ServiceContextList
ACE_TRY_NEW_ENV
{
CORBA::TypeCode_var type = _tao_any.type ();
- if (!type->equal (IOP::_tc_ServiceContextList, ACE_TRY_ENV)) return 0; // not equal
+ if (!type->equivalent (IOP::_tc_ServiceContextList, ACE_TRY_ENV)) // not equal
+ {
+ _tao_elem = 0;
+ return 0;
+ }
ACE_TRY_CHECK;
if (_tao_any.any_owns_data ())
{
@@ -920,25 +1383,84 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, IOP::ServiceContextList
else
{
ACE_NEW_RETURN (_tao_elem, IOP::ServiceContextList, 0);
- TAO_InputCDR stream (_tao_any._tao_get_cdr (),
- _tao_any._tao_byte_order ());
- if (stream.decode (IOP::_tc_ServiceContextList, _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 (IOP::_tc_ServiceContextList, _tao_elem, 1, ACE_TRY_ENV);
+ ((CORBA::Any *)&_tao_any)->_tao_replace (
+ IOP::_tc_ServiceContextList,
+ 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 IOP::ServiceContextList *&_tao_elem)
+{
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::TypeCode_var type = _tao_any.type ();
+ if (!type->equivalent (IOP::_tc_ServiceContextList, ACE_TRY_ENV)) // not equal
+ {
+ _tao_elem = 0;
+ return 0;
+ }
+ ACE_TRY_CHECK;
+ if (_tao_any.any_owns_data ())
+ {
+ _tao_elem = (IOP::ServiceContextList *)_tao_any.value ();
+ return 1;
+ }
+ else
+ {
+ ACE_NEW_RETURN (_tao_elem, IOP::ServiceContextList, 0);
+ TAO_InputCDR stream (
+ _tao_any._tao_get_cdr (),
+ _tao_any._tao_byte_order ()
+ );
+ if (stream >> *(IOP::ServiceContextList *)_tao_elem)
+ {
+ ((CORBA::Any *)&_tao_any)->_tao_replace (
+ IOP::_tc_ServiceContextList,
+ 1,
+ ACE_reinterpret_cast (void *, ACE_const_cast (IOP::ServiceContextList *&, _tao_elem)),
+ ACE_TRY_ENV
+ );
+ ACE_TRY_CHECK;
+ return 1;
+ }
+ else
+ {
+ delete ACE_const_cast (IOP::ServiceContextList *&, _tao_elem);
+ _tao_elem = 0;
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ delete ACE_const_cast (IOP::ServiceContextList *&, _tao_elem);
+ _tao_elem = 0;
+ return 0;
}
ACE_ENDTRY;
return 0;