diff options
Diffstat (limited to 'TAO/tao/MessagingC.cpp')
-rw-r--r-- | TAO/tao/MessagingC.cpp | 1596 |
1 files changed, 1527 insertions, 69 deletions
diff --git a/TAO/tao/MessagingC.cpp b/TAO/tao/MessagingC.cpp index 9882d51e961..4528f4238c8 100644 --- a/TAO/tao/MessagingC.cpp +++ b/TAO/tao/MessagingC.cpp @@ -1,7 +1,6 @@ /* -*- 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. @@ -24,7 +23,6 @@ ACE_RCSID(tao, MessagingC, "$Id$") - static const CORBA::Long _oc_Messaging_RebindMode[] = { TAO_ENCAP_BYTE_ORDER, // byte order @@ -2075,14 +2073,185 @@ TAO_NAMESPACE_END // **************************************************************** +void operator<<= (CORBA::Any &_tao_any, Messaging::RebindPolicy_ptr _tao_elem) +{ + CORBA::Object_ptr *_tao_obj_ptr = 0; + ACE_TRY_NEW_ENV + { + ACE_NEW (_tao_obj_ptr, CORBA::Object_ptr); + *_tao_obj_ptr = Messaging::RebindPolicy::_duplicate (_tao_elem); + TAO_OutputCDR stream; + if (stream << *_tao_obj_ptr) + { + _tao_any._tao_replace ( + Messaging::_tc_RebindPolicy, + TAO_ENCAP_BYTE_ORDER, + stream.begin (), + 1, + _tao_obj_ptr, + ACE_TRY_ENV + ); + ACE_TRY_CHECK; + } + else + { + delete _tao_obj_ptr; + } + } + ACE_CATCHANY + { + delete _tao_obj_ptr; + } + ACE_ENDTRY; +} + +CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, Messaging::RebindPolicy_ptr &_tao_elem) +{ + CORBA::Object_ptr *tmp = 0; + ACE_NEW_RETURN (tmp, CORBA::Object_ptr, 0); + ACE_TRY_NEW_ENV + { + _tao_elem = Messaging::RebindPolicy::_nil (); + CORBA::TypeCode_var type = _tao_any.type (); + if (!type->equivalent (Messaging::_tc_RebindPolicy, 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 () + ); + CORBA::Object_var _tao_obj_var; + if (stream >> _tao_obj_var.out ()) + { + _tao_elem = Messaging::RebindPolicy::_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)->_tao_replace ( + Messaging::_tc_RebindPolicy, + 1, + tmp, + ACE_TRY_ENV + ); + ACE_TRY_CHECK; + return 1; + } + else // failure + { + delete tmp; + } + } + ACE_CATCHANY + { + delete tmp; + _tao_elem = Messaging::RebindPolicy::_nil (); + return 0; + } + ACE_ENDTRY; + _tao_elem = Messaging::RebindPolicy::_nil (); + return 0; +} + +void operator<<= (CORBA::Any &_tao_any, Messaging::SyncScopePolicy_ptr _tao_elem) +{ + CORBA::Object_ptr *_tao_obj_ptr = 0; + ACE_TRY_NEW_ENV + { + ACE_NEW (_tao_obj_ptr, CORBA::Object_ptr); + *_tao_obj_ptr = Messaging::SyncScopePolicy::_duplicate (_tao_elem); + TAO_OutputCDR stream; + if (stream << *_tao_obj_ptr) + { + _tao_any._tao_replace ( + Messaging::_tc_SyncScopePolicy, + TAO_ENCAP_BYTE_ORDER, + stream.begin (), + 1, + _tao_obj_ptr, + ACE_TRY_ENV + ); + ACE_TRY_CHECK; + } + else + { + delete _tao_obj_ptr; + } + } + ACE_CATCHANY + { + delete _tao_obj_ptr; + } + ACE_ENDTRY; +} + +CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, Messaging::SyncScopePolicy_ptr &_tao_elem) +{ + CORBA::Object_ptr *tmp = 0; + ACE_NEW_RETURN (tmp, CORBA::Object_ptr, 0); + ACE_TRY_NEW_ENV + { + _tao_elem = Messaging::SyncScopePolicy::_nil (); + CORBA::TypeCode_var type = _tao_any.type (); + if (!type->equivalent (Messaging::_tc_SyncScopePolicy, 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 () + ); + CORBA::Object_var _tao_obj_var; + if (stream >> _tao_obj_var.out ()) + { + _tao_elem = Messaging::SyncScopePolicy::_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)->_tao_replace ( + Messaging::_tc_SyncScopePolicy, + 1, + tmp, + ACE_TRY_ENV + ); + ACE_TRY_CHECK; + return 1; + } + else // failure + { + delete tmp; + } + } + ACE_CATCHANY + { + delete tmp; + _tao_elem = Messaging::SyncScopePolicy::_nil (); + return 0; + } + ACE_ENDTRY; + _tao_elem = Messaging::SyncScopePolicy::_nil (); + return 0; +} + void operator<<= (CORBA::Any &_tao_any, const Messaging::PriorityRange &_tao_elem) // copying { - Messaging::PriorityRange *_any_val; + Messaging::PriorityRange *_any_val = 0; ACE_NEW (_any_val, Messaging::PriorityRange (_tao_elem)); if (!_any_val) return; ACE_TRY_NEW_ENV { - _tao_any.replace (Messaging::_tc_PriorityRange, _any_val, 1, ACE_TRY_ENV); // copy the value + TAO_OutputCDR stream; + stream << *_any_val; + _tao_any._tao_replace ( + Messaging::_tc_PriorityRange, + TAO_ENCAP_BYTE_ORDER, + stream.begin (), + 1, + _any_val, + ACE_TRY_ENV + ); ACE_TRY_CHECK; } ACE_CATCHANY @@ -2096,10 +2265,23 @@ void operator<<= (CORBA::Any &_tao_any, Messaging::PriorityRange *_tao_elem) // { ACE_TRY_NEW_ENV { - _tao_any.replace (Messaging::_tc_PriorityRange, _tao_elem, 1, ACE_TRY_ENV); // consume it + TAO_OutputCDR stream; + stream << *_tao_elem; + _tao_any._tao_replace ( + Messaging::_tc_PriorityRange, + 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; } @@ -2108,37 +2290,748 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, Messaging::PriorityRange ACE_TRY_NEW_ENV { CORBA::TypeCode_var type = _tao_any.type (); - if (!type->equal (Messaging::_tc_PriorityRange, ACE_TRY_ENV)) return 0; // not equal + if (!type->equivalent (Messaging::_tc_PriorityRange, ACE_TRY_ENV)) // not equal + { + _tao_elem = 0; + return 0; + } ACE_TRY_CHECK; if (_tao_any.any_owns_data ()) { _tao_elem = (Messaging::PriorityRange *)_tao_any.value (); return 1; - } + } else { ACE_NEW_RETURN (_tao_elem, Messaging::PriorityRange, 0); - TAO_InputCDR stream (_tao_any._tao_get_cdr (), - _tao_any._tao_byte_order ()); - if (stream.decode (Messaging::_tc_PriorityRange, _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 (Messaging::_tc_PriorityRange, _tao_elem, 1, ACE_TRY_ENV); + ((CORBA::Any *)&_tao_any)->_tao_replace ( + Messaging::_tc_PriorityRange, + 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; + _tao_elem = 0; + return 0; + } + ACE_ENDTRY; + return 0; +} + +CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, const Messaging::PriorityRange *&_tao_elem) +{ + ACE_TRY_NEW_ENV + { + CORBA::TypeCode_var type = _tao_any.type (); + if (!type->equivalent (Messaging::_tc_PriorityRange, ACE_TRY_ENV)) // not equal + { + _tao_elem = 0; + return 0; + } + ACE_TRY_CHECK; + if (_tao_any.any_owns_data ()) + { + _tao_elem = (Messaging::PriorityRange *)_tao_any.value (); + return 1; + } + else + { + ACE_NEW_RETURN (_tao_elem, Messaging::PriorityRange, 0); + TAO_InputCDR stream ( + _tao_any._tao_get_cdr (), + _tao_any._tao_byte_order () + ); + if (stream >> *(Messaging::PriorityRange *)_tao_elem) + { + ((CORBA::Any *)&_tao_any)->_tao_replace ( + Messaging::_tc_PriorityRange, + 1, + ACE_reinterpret_cast (void *, ACE_const_cast (Messaging::PriorityRange *&, _tao_elem)), + ACE_TRY_ENV + ); + ACE_TRY_CHECK; + return 1; + } + else + { + delete ACE_const_cast (Messaging::PriorityRange *&, _tao_elem); + _tao_elem = 0; + } + } + } + ACE_CATCHANY + { + delete ACE_const_cast (Messaging::PriorityRange *&, _tao_elem); + _tao_elem = 0; + return 0; + } + ACE_ENDTRY; + return 0; +} + +void operator<<= (CORBA::Any &_tao_any, Messaging::RequestPriorityPolicy_ptr _tao_elem) +{ + CORBA::Object_ptr *_tao_obj_ptr = 0; + ACE_TRY_NEW_ENV + { + ACE_NEW (_tao_obj_ptr, CORBA::Object_ptr); + *_tao_obj_ptr = Messaging::RequestPriorityPolicy::_duplicate (_tao_elem); + TAO_OutputCDR stream; + if (stream << *_tao_obj_ptr) + { + _tao_any._tao_replace ( + Messaging::_tc_RequestPriorityPolicy, + TAO_ENCAP_BYTE_ORDER, + stream.begin (), + 1, + _tao_obj_ptr, + ACE_TRY_ENV + ); + ACE_TRY_CHECK; + } + else + { + delete _tao_obj_ptr; + } + } + ACE_CATCHANY + { + delete _tao_obj_ptr; + } + ACE_ENDTRY; +} + +CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, Messaging::RequestPriorityPolicy_ptr &_tao_elem) +{ + CORBA::Object_ptr *tmp = 0; + ACE_NEW_RETURN (tmp, CORBA::Object_ptr, 0); + ACE_TRY_NEW_ENV + { + _tao_elem = Messaging::RequestPriorityPolicy::_nil (); + CORBA::TypeCode_var type = _tao_any.type (); + if (!type->equivalent (Messaging::_tc_RequestPriorityPolicy, 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 () + ); + CORBA::Object_var _tao_obj_var; + if (stream >> _tao_obj_var.out ()) + { + _tao_elem = Messaging::RequestPriorityPolicy::_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)->_tao_replace ( + Messaging::_tc_RequestPriorityPolicy, + 1, + tmp, + ACE_TRY_ENV + ); + ACE_TRY_CHECK; + return 1; + } + else // failure + { + delete tmp; + } + } + ACE_CATCHANY + { + delete tmp; + _tao_elem = Messaging::RequestPriorityPolicy::_nil (); + return 0; + } + ACE_ENDTRY; + _tao_elem = Messaging::RequestPriorityPolicy::_nil (); + return 0; +} + +void operator<<= (CORBA::Any &_tao_any, Messaging::ReplyPriorityPolicy_ptr _tao_elem) +{ + CORBA::Object_ptr *_tao_obj_ptr = 0; + ACE_TRY_NEW_ENV + { + ACE_NEW (_tao_obj_ptr, CORBA::Object_ptr); + *_tao_obj_ptr = Messaging::ReplyPriorityPolicy::_duplicate (_tao_elem); + TAO_OutputCDR stream; + if (stream << *_tao_obj_ptr) + { + _tao_any._tao_replace ( + Messaging::_tc_ReplyPriorityPolicy, + TAO_ENCAP_BYTE_ORDER, + stream.begin (), + 1, + _tao_obj_ptr, + ACE_TRY_ENV + ); + ACE_TRY_CHECK; + } + else + { + delete _tao_obj_ptr; + } + } + ACE_CATCHANY + { + delete _tao_obj_ptr; + } + ACE_ENDTRY; +} + +CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, Messaging::ReplyPriorityPolicy_ptr &_tao_elem) +{ + CORBA::Object_ptr *tmp = 0; + ACE_NEW_RETURN (tmp, CORBA::Object_ptr, 0); + ACE_TRY_NEW_ENV + { + _tao_elem = Messaging::ReplyPriorityPolicy::_nil (); + CORBA::TypeCode_var type = _tao_any.type (); + if (!type->equivalent (Messaging::_tc_ReplyPriorityPolicy, 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 () + ); + CORBA::Object_var _tao_obj_var; + if (stream >> _tao_obj_var.out ()) + { + _tao_elem = Messaging::ReplyPriorityPolicy::_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)->_tao_replace ( + Messaging::_tc_ReplyPriorityPolicy, + 1, + tmp, + ACE_TRY_ENV + ); + ACE_TRY_CHECK; + return 1; + } + else // failure + { + delete tmp; + } + } + ACE_CATCHANY + { + delete tmp; + _tao_elem = Messaging::ReplyPriorityPolicy::_nil (); + return 0; + } + ACE_ENDTRY; + _tao_elem = Messaging::ReplyPriorityPolicy::_nil (); + return 0; +} + +void operator<<= (CORBA::Any &_tao_any, Messaging::RequestStartTimePolicy_ptr _tao_elem) +{ + CORBA::Object_ptr *_tao_obj_ptr = 0; + ACE_TRY_NEW_ENV + { + ACE_NEW (_tao_obj_ptr, CORBA::Object_ptr); + *_tao_obj_ptr = Messaging::RequestStartTimePolicy::_duplicate (_tao_elem); + TAO_OutputCDR stream; + if (stream << *_tao_obj_ptr) + { + _tao_any._tao_replace ( + Messaging::_tc_RequestStartTimePolicy, + TAO_ENCAP_BYTE_ORDER, + stream.begin (), + 1, + _tao_obj_ptr, + ACE_TRY_ENV + ); + ACE_TRY_CHECK; + } + else + { + delete _tao_obj_ptr; + } + } + ACE_CATCHANY + { + delete _tao_obj_ptr; + } + ACE_ENDTRY; +} + +CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, Messaging::RequestStartTimePolicy_ptr &_tao_elem) +{ + CORBA::Object_ptr *tmp = 0; + ACE_NEW_RETURN (tmp, CORBA::Object_ptr, 0); + ACE_TRY_NEW_ENV + { + _tao_elem = Messaging::RequestStartTimePolicy::_nil (); + CORBA::TypeCode_var type = _tao_any.type (); + if (!type->equivalent (Messaging::_tc_RequestStartTimePolicy, 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 () + ); + CORBA::Object_var _tao_obj_var; + if (stream >> _tao_obj_var.out ()) + { + _tao_elem = Messaging::RequestStartTimePolicy::_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)->_tao_replace ( + Messaging::_tc_RequestStartTimePolicy, + 1, + tmp, + ACE_TRY_ENV + ); + ACE_TRY_CHECK; + return 1; + } + else // failure + { + delete tmp; + } + } + ACE_CATCHANY + { + delete tmp; + _tao_elem = Messaging::RequestStartTimePolicy::_nil (); + return 0; + } + ACE_ENDTRY; + _tao_elem = Messaging::RequestStartTimePolicy::_nil (); + return 0; +} + +void operator<<= (CORBA::Any &_tao_any, Messaging::RequestEndTimePolicy_ptr _tao_elem) +{ + CORBA::Object_ptr *_tao_obj_ptr = 0; + ACE_TRY_NEW_ENV + { + ACE_NEW (_tao_obj_ptr, CORBA::Object_ptr); + *_tao_obj_ptr = Messaging::RequestEndTimePolicy::_duplicate (_tao_elem); + TAO_OutputCDR stream; + if (stream << *_tao_obj_ptr) + { + _tao_any._tao_replace ( + Messaging::_tc_RequestEndTimePolicy, + TAO_ENCAP_BYTE_ORDER, + stream.begin (), + 1, + _tao_obj_ptr, + ACE_TRY_ENV + ); + ACE_TRY_CHECK; + } + else + { + delete _tao_obj_ptr; + } + } + ACE_CATCHANY + { + delete _tao_obj_ptr; + } + ACE_ENDTRY; +} + +CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, Messaging::RequestEndTimePolicy_ptr &_tao_elem) +{ + CORBA::Object_ptr *tmp = 0; + ACE_NEW_RETURN (tmp, CORBA::Object_ptr, 0); + ACE_TRY_NEW_ENV + { + _tao_elem = Messaging::RequestEndTimePolicy::_nil (); + CORBA::TypeCode_var type = _tao_any.type (); + if (!type->equivalent (Messaging::_tc_RequestEndTimePolicy, 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 () + ); + CORBA::Object_var _tao_obj_var; + if (stream >> _tao_obj_var.out ()) + { + _tao_elem = Messaging::RequestEndTimePolicy::_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)->_tao_replace ( + Messaging::_tc_RequestEndTimePolicy, + 1, + tmp, + ACE_TRY_ENV + ); + ACE_TRY_CHECK; + return 1; + } + else // failure + { + delete tmp; + } + } + ACE_CATCHANY + { + delete tmp; + _tao_elem = Messaging::RequestEndTimePolicy::_nil (); + return 0; + } + ACE_ENDTRY; + _tao_elem = Messaging::RequestEndTimePolicy::_nil (); + return 0; +} + +void operator<<= (CORBA::Any &_tao_any, Messaging::ReplyStartTimePolicy_ptr _tao_elem) +{ + CORBA::Object_ptr *_tao_obj_ptr = 0; + ACE_TRY_NEW_ENV + { + ACE_NEW (_tao_obj_ptr, CORBA::Object_ptr); + *_tao_obj_ptr = Messaging::ReplyStartTimePolicy::_duplicate (_tao_elem); + TAO_OutputCDR stream; + if (stream << *_tao_obj_ptr) + { + _tao_any._tao_replace ( + Messaging::_tc_ReplyStartTimePolicy, + TAO_ENCAP_BYTE_ORDER, + stream.begin (), + 1, + _tao_obj_ptr, + ACE_TRY_ENV + ); + ACE_TRY_CHECK; + } + else + { + delete _tao_obj_ptr; + } + } + ACE_CATCHANY + { + delete _tao_obj_ptr; + } + ACE_ENDTRY; +} + +CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, Messaging::ReplyStartTimePolicy_ptr &_tao_elem) +{ + CORBA::Object_ptr *tmp = 0; + ACE_NEW_RETURN (tmp, CORBA::Object_ptr, 0); + ACE_TRY_NEW_ENV + { + _tao_elem = Messaging::ReplyStartTimePolicy::_nil (); + CORBA::TypeCode_var type = _tao_any.type (); + if (!type->equivalent (Messaging::_tc_ReplyStartTimePolicy, 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 () + ); + CORBA::Object_var _tao_obj_var; + if (stream >> _tao_obj_var.out ()) + { + _tao_elem = Messaging::ReplyStartTimePolicy::_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)->_tao_replace ( + Messaging::_tc_ReplyStartTimePolicy, + 1, + tmp, + ACE_TRY_ENV + ); + ACE_TRY_CHECK; + return 1; + } + else // failure + { + delete tmp; + } + } + ACE_CATCHANY + { + delete tmp; + _tao_elem = Messaging::ReplyStartTimePolicy::_nil (); + return 0; + } + ACE_ENDTRY; + _tao_elem = Messaging::ReplyStartTimePolicy::_nil (); + return 0; +} + +void operator<<= (CORBA::Any &_tao_any, Messaging::ReplyEndTimePolicy_ptr _tao_elem) +{ + CORBA::Object_ptr *_tao_obj_ptr = 0; + ACE_TRY_NEW_ENV + { + ACE_NEW (_tao_obj_ptr, CORBA::Object_ptr); + *_tao_obj_ptr = Messaging::ReplyEndTimePolicy::_duplicate (_tao_elem); + TAO_OutputCDR stream; + if (stream << *_tao_obj_ptr) + { + _tao_any._tao_replace ( + Messaging::_tc_ReplyEndTimePolicy, + TAO_ENCAP_BYTE_ORDER, + stream.begin (), + 1, + _tao_obj_ptr, + ACE_TRY_ENV + ); + ACE_TRY_CHECK; + } + else + { + delete _tao_obj_ptr; + } + } + ACE_CATCHANY + { + delete _tao_obj_ptr; + } + ACE_ENDTRY; +} + +CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, Messaging::ReplyEndTimePolicy_ptr &_tao_elem) +{ + CORBA::Object_ptr *tmp = 0; + ACE_NEW_RETURN (tmp, CORBA::Object_ptr, 0); + ACE_TRY_NEW_ENV + { + _tao_elem = Messaging::ReplyEndTimePolicy::_nil (); + CORBA::TypeCode_var type = _tao_any.type (); + if (!type->equivalent (Messaging::_tc_ReplyEndTimePolicy, 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 () + ); + CORBA::Object_var _tao_obj_var; + if (stream >> _tao_obj_var.out ()) + { + _tao_elem = Messaging::ReplyEndTimePolicy::_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)->_tao_replace ( + Messaging::_tc_ReplyEndTimePolicy, + 1, + tmp, + ACE_TRY_ENV + ); + ACE_TRY_CHECK; + return 1; + } + else // failure + { + delete tmp; + } + } + ACE_CATCHANY + { + delete tmp; + _tao_elem = Messaging::ReplyEndTimePolicy::_nil (); return 0; } ACE_ENDTRY; + _tao_elem = Messaging::ReplyEndTimePolicy::_nil (); + return 0; +} + +void operator<<= (CORBA::Any &_tao_any, Messaging::RelativeRequestTimeoutPolicy_ptr _tao_elem) +{ + CORBA::Object_ptr *_tao_obj_ptr = 0; + ACE_TRY_NEW_ENV + { + ACE_NEW (_tao_obj_ptr, CORBA::Object_ptr); + *_tao_obj_ptr = Messaging::RelativeRequestTimeoutPolicy::_duplicate (_tao_elem); + TAO_OutputCDR stream; + if (stream << *_tao_obj_ptr) + { + _tao_any._tao_replace ( + Messaging::_tc_RelativeRequestTimeoutPolicy, + TAO_ENCAP_BYTE_ORDER, + stream.begin (), + 1, + _tao_obj_ptr, + ACE_TRY_ENV + ); + ACE_TRY_CHECK; + } + else + { + delete _tao_obj_ptr; + } + } + ACE_CATCHANY + { + delete _tao_obj_ptr; + } + ACE_ENDTRY; +} + +CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, Messaging::RelativeRequestTimeoutPolicy_ptr &_tao_elem) +{ + CORBA::Object_ptr *tmp = 0; + ACE_NEW_RETURN (tmp, CORBA::Object_ptr, 0); + ACE_TRY_NEW_ENV + { + _tao_elem = Messaging::RelativeRequestTimeoutPolicy::_nil (); + CORBA::TypeCode_var type = _tao_any.type (); + if (!type->equivalent (Messaging::_tc_RelativeRequestTimeoutPolicy, 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 () + ); + CORBA::Object_var _tao_obj_var; + if (stream >> _tao_obj_var.out ()) + { + _tao_elem = Messaging::RelativeRequestTimeoutPolicy::_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)->_tao_replace ( + Messaging::_tc_RelativeRequestTimeoutPolicy, + 1, + tmp, + ACE_TRY_ENV + ); + ACE_TRY_CHECK; + return 1; + } + else // failure + { + delete tmp; + } + } + ACE_CATCHANY + { + delete tmp; + _tao_elem = Messaging::RelativeRequestTimeoutPolicy::_nil (); + return 0; + } + ACE_ENDTRY; + _tao_elem = Messaging::RelativeRequestTimeoutPolicy::_nil (); + return 0; +} + +void operator<<= (CORBA::Any &_tao_any, Messaging::RelativeRoundtripTimeoutPolicy_ptr _tao_elem) +{ + CORBA::Object_ptr *_tao_obj_ptr = 0; + ACE_TRY_NEW_ENV + { + ACE_NEW (_tao_obj_ptr, CORBA::Object_ptr); + *_tao_obj_ptr = Messaging::RelativeRoundtripTimeoutPolicy::_duplicate (_tao_elem); + TAO_OutputCDR stream; + if (stream << *_tao_obj_ptr) + { + _tao_any._tao_replace ( + Messaging::_tc_RelativeRoundtripTimeoutPolicy, + TAO_ENCAP_BYTE_ORDER, + stream.begin (), + 1, + _tao_obj_ptr, + ACE_TRY_ENV + ); + ACE_TRY_CHECK; + } + else + { + delete _tao_obj_ptr; + } + } + ACE_CATCHANY + { + delete _tao_obj_ptr; + } + ACE_ENDTRY; +} + +CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, Messaging::RelativeRoundtripTimeoutPolicy_ptr &_tao_elem) +{ + CORBA::Object_ptr *tmp = 0; + ACE_NEW_RETURN (tmp, CORBA::Object_ptr, 0); + ACE_TRY_NEW_ENV + { + _tao_elem = Messaging::RelativeRoundtripTimeoutPolicy::_nil (); + CORBA::TypeCode_var type = _tao_any.type (); + if (!type->equivalent (Messaging::_tc_RelativeRoundtripTimeoutPolicy, 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 () + ); + CORBA::Object_var _tao_obj_var; + if (stream >> _tao_obj_var.out ()) + { + _tao_elem = Messaging::RelativeRoundtripTimeoutPolicy::_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)->_tao_replace ( + Messaging::_tc_RelativeRoundtripTimeoutPolicy, + 1, + tmp, + ACE_TRY_ENV + ); + ACE_TRY_CHECK; + return 1; + } + else // failure + { + delete tmp; + } + } + ACE_CATCHANY + { + delete tmp; + _tao_elem = Messaging::RelativeRoundtripTimeoutPolicy::_nil (); + return 0; + } + ACE_ENDTRY; + _tao_elem = Messaging::RelativeRoundtripTimeoutPolicy::_nil (); return 0; } @@ -2146,12 +3039,21 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, Messaging::PriorityRange void operator<<= (CORBA::Any &_tao_any, const Messaging::RoutingTypeRange &_tao_elem) // copying { - Messaging::RoutingTypeRange *_any_val; + Messaging::RoutingTypeRange *_any_val = 0; ACE_NEW (_any_val, Messaging::RoutingTypeRange (_tao_elem)); if (!_any_val) return; ACE_TRY_NEW_ENV { - _tao_any.replace (Messaging::_tc_RoutingTypeRange, _any_val, 1, ACE_TRY_ENV); // copy the value + TAO_OutputCDR stream; + stream << *_any_val; + _tao_any._tao_replace ( + Messaging::_tc_RoutingTypeRange, + TAO_ENCAP_BYTE_ORDER, + stream.begin (), + 1, + _any_val, + ACE_TRY_ENV + ); ACE_TRY_CHECK; } ACE_CATCHANY @@ -2165,10 +3067,23 @@ void operator<<= (CORBA::Any &_tao_any, Messaging::RoutingTypeRange *_tao_elem) { ACE_TRY_NEW_ENV { - _tao_any.replace (Messaging::_tc_RoutingTypeRange, _tao_elem, 1, ACE_TRY_ENV); // consume it + TAO_OutputCDR stream; + stream << *_tao_elem; + _tao_any._tao_replace ( + Messaging::_tc_RoutingTypeRange, + 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; } @@ -2177,35 +3092,98 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, Messaging::RoutingTypeRa ACE_TRY_NEW_ENV { CORBA::TypeCode_var type = _tao_any.type (); - if (!type->equal (Messaging::_tc_RoutingTypeRange, ACE_TRY_ENV)) return 0; // not equal + if (!type->equivalent (Messaging::_tc_RoutingTypeRange, ACE_TRY_ENV)) // not equal + { + _tao_elem = 0; + return 0; + } ACE_TRY_CHECK; if (_tao_any.any_owns_data ()) { _tao_elem = (Messaging::RoutingTypeRange *)_tao_any.value (); return 1; - } + } else { ACE_NEW_RETURN (_tao_elem, Messaging::RoutingTypeRange, 0); - TAO_InputCDR stream (_tao_any._tao_get_cdr (), - _tao_any._tao_byte_order ()); - if (stream.decode (Messaging::_tc_RoutingTypeRange, _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 (Messaging::_tc_RoutingTypeRange, _tao_elem, 1, ACE_TRY_ENV); + ((CORBA::Any *)&_tao_any)->_tao_replace ( + Messaging::_tc_RoutingTypeRange, + 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 Messaging::RoutingTypeRange *&_tao_elem) +{ + ACE_TRY_NEW_ENV + { + CORBA::TypeCode_var type = _tao_any.type (); + if (!type->equivalent (Messaging::_tc_RoutingTypeRange, ACE_TRY_ENV)) // not equal + { + _tao_elem = 0; + return 0; + } + ACE_TRY_CHECK; + if (_tao_any.any_owns_data ()) + { + _tao_elem = (Messaging::RoutingTypeRange *)_tao_any.value (); + return 1; + } + else + { + ACE_NEW_RETURN (_tao_elem, Messaging::RoutingTypeRange, 0); + TAO_InputCDR stream ( + _tao_any._tao_get_cdr (), + _tao_any._tao_byte_order () + ); + if (stream >> *(Messaging::RoutingTypeRange *)_tao_elem) + { + ((CORBA::Any *)&_tao_any)->_tao_replace ( + Messaging::_tc_RoutingTypeRange, + 1, + ACE_reinterpret_cast (void *, ACE_const_cast (Messaging::RoutingTypeRange *&, _tao_elem)), + ACE_TRY_ENV + ); + ACE_TRY_CHECK; + return 1; + } + else + { + delete ACE_const_cast (Messaging::RoutingTypeRange *&, _tao_elem); + _tao_elem = 0; + } + } + } + ACE_CATCHANY + { + delete ACE_const_cast (Messaging::RoutingTypeRange *&, _tao_elem); + _tao_elem = 0; + return 0; } ACE_ENDTRY; return 0; @@ -2213,14 +3191,266 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, Messaging::RoutingTypeRa // **************************************************************** +void operator<<= (CORBA::Any &_tao_any, Messaging::RoutingPolicy_ptr _tao_elem) +{ + CORBA::Object_ptr *_tao_obj_ptr = 0; + ACE_TRY_NEW_ENV + { + ACE_NEW (_tao_obj_ptr, CORBA::Object_ptr); + *_tao_obj_ptr = Messaging::RoutingPolicy::_duplicate (_tao_elem); + TAO_OutputCDR stream; + if (stream << *_tao_obj_ptr) + { + _tao_any._tao_replace ( + Messaging::_tc_RoutingPolicy, + TAO_ENCAP_BYTE_ORDER, + stream.begin (), + 1, + _tao_obj_ptr, + ACE_TRY_ENV + ); + ACE_TRY_CHECK; + } + else + { + delete _tao_obj_ptr; + } + } + ACE_CATCHANY + { + delete _tao_obj_ptr; + } + ACE_ENDTRY; +} + +CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, Messaging::RoutingPolicy_ptr &_tao_elem) +{ + CORBA::Object_ptr *tmp = 0; + ACE_NEW_RETURN (tmp, CORBA::Object_ptr, 0); + ACE_TRY_NEW_ENV + { + _tao_elem = Messaging::RoutingPolicy::_nil (); + CORBA::TypeCode_var type = _tao_any.type (); + if (!type->equivalent (Messaging::_tc_RoutingPolicy, 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 () + ); + CORBA::Object_var _tao_obj_var; + if (stream >> _tao_obj_var.out ()) + { + _tao_elem = Messaging::RoutingPolicy::_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)->_tao_replace ( + Messaging::_tc_RoutingPolicy, + 1, + tmp, + ACE_TRY_ENV + ); + ACE_TRY_CHECK; + return 1; + } + else // failure + { + delete tmp; + } + } + ACE_CATCHANY + { + delete tmp; + _tao_elem = Messaging::RoutingPolicy::_nil (); + return 0; + } + ACE_ENDTRY; + _tao_elem = Messaging::RoutingPolicy::_nil (); + return 0; +} + +void operator<<= (CORBA::Any &_tao_any, Messaging::MaxHopsPolicy_ptr _tao_elem) +{ + CORBA::Object_ptr *_tao_obj_ptr = 0; + ACE_TRY_NEW_ENV + { + ACE_NEW (_tao_obj_ptr, CORBA::Object_ptr); + *_tao_obj_ptr = Messaging::MaxHopsPolicy::_duplicate (_tao_elem); + TAO_OutputCDR stream; + if (stream << *_tao_obj_ptr) + { + _tao_any._tao_replace ( + Messaging::_tc_MaxHopsPolicy, + TAO_ENCAP_BYTE_ORDER, + stream.begin (), + 1, + _tao_obj_ptr, + ACE_TRY_ENV + ); + ACE_TRY_CHECK; + } + else + { + delete _tao_obj_ptr; + } + } + ACE_CATCHANY + { + delete _tao_obj_ptr; + } + ACE_ENDTRY; +} + +CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, Messaging::MaxHopsPolicy_ptr &_tao_elem) +{ + CORBA::Object_ptr *tmp = 0; + ACE_NEW_RETURN (tmp, CORBA::Object_ptr, 0); + ACE_TRY_NEW_ENV + { + _tao_elem = Messaging::MaxHopsPolicy::_nil (); + CORBA::TypeCode_var type = _tao_any.type (); + if (!type->equivalent (Messaging::_tc_MaxHopsPolicy, 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 () + ); + CORBA::Object_var _tao_obj_var; + if (stream >> _tao_obj_var.out ()) + { + _tao_elem = Messaging::MaxHopsPolicy::_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)->_tao_replace ( + Messaging::_tc_MaxHopsPolicy, + 1, + tmp, + ACE_TRY_ENV + ); + ACE_TRY_CHECK; + return 1; + } + else // failure + { + delete tmp; + } + } + ACE_CATCHANY + { + delete tmp; + _tao_elem = Messaging::MaxHopsPolicy::_nil (); + return 0; + } + ACE_ENDTRY; + _tao_elem = Messaging::MaxHopsPolicy::_nil (); + return 0; +} + +void operator<<= (CORBA::Any &_tao_any, Messaging::QueueOrderPolicy_ptr _tao_elem) +{ + CORBA::Object_ptr *_tao_obj_ptr = 0; + ACE_TRY_NEW_ENV + { + ACE_NEW (_tao_obj_ptr, CORBA::Object_ptr); + *_tao_obj_ptr = Messaging::QueueOrderPolicy::_duplicate (_tao_elem); + TAO_OutputCDR stream; + if (stream << *_tao_obj_ptr) + { + _tao_any._tao_replace ( + Messaging::_tc_QueueOrderPolicy, + TAO_ENCAP_BYTE_ORDER, + stream.begin (), + 1, + _tao_obj_ptr, + ACE_TRY_ENV + ); + ACE_TRY_CHECK; + } + else + { + delete _tao_obj_ptr; + } + } + ACE_CATCHANY + { + delete _tao_obj_ptr; + } + ACE_ENDTRY; +} + +CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, Messaging::QueueOrderPolicy_ptr &_tao_elem) +{ + CORBA::Object_ptr *tmp = 0; + ACE_NEW_RETURN (tmp, CORBA::Object_ptr, 0); + ACE_TRY_NEW_ENV + { + _tao_elem = Messaging::QueueOrderPolicy::_nil (); + CORBA::TypeCode_var type = _tao_any.type (); + if (!type->equivalent (Messaging::_tc_QueueOrderPolicy, 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 () + ); + CORBA::Object_var _tao_obj_var; + if (stream >> _tao_obj_var.out ()) + { + _tao_elem = Messaging::QueueOrderPolicy::_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)->_tao_replace ( + Messaging::_tc_QueueOrderPolicy, + 1, + tmp, + ACE_TRY_ENV + ); + ACE_TRY_CHECK; + return 1; + } + else // failure + { + delete tmp; + } + } + ACE_CATCHANY + { + delete tmp; + _tao_elem = Messaging::QueueOrderPolicy::_nil (); + return 0; + } + ACE_ENDTRY; + _tao_elem = Messaging::QueueOrderPolicy::_nil (); + return 0; +} + void operator<<= (CORBA::Any &_tao_any, const Messaging::PolicyValue &_tao_elem) // copying { - Messaging::PolicyValue *_any_val; + Messaging::PolicyValue *_any_val = 0; ACE_NEW (_any_val, Messaging::PolicyValue (_tao_elem)); if (!_any_val) return; ACE_TRY_NEW_ENV { - _tao_any.replace (Messaging::_tc_PolicyValue, _any_val, 1, ACE_TRY_ENV); // copy the value + TAO_OutputCDR stream; + stream << *_any_val; + _tao_any._tao_replace ( + Messaging::_tc_PolicyValue, + TAO_ENCAP_BYTE_ORDER, + stream.begin (), + 1, + _any_val, + ACE_TRY_ENV + ); ACE_TRY_CHECK; } ACE_CATCHANY @@ -2234,10 +3464,23 @@ void operator<<= (CORBA::Any &_tao_any, Messaging::PolicyValue *_tao_elem) // no { ACE_TRY_NEW_ENV { - _tao_any.replace (Messaging::_tc_PolicyValue, _tao_elem, 1, ACE_TRY_ENV); // consume it + TAO_OutputCDR stream; + stream << *_tao_elem; + _tao_any._tao_replace ( + Messaging::_tc_PolicyValue, + 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; } @@ -2246,35 +3489,98 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, Messaging::PolicyValue * ACE_TRY_NEW_ENV { CORBA::TypeCode_var type = _tao_any.type (); - if (!type->equal (Messaging::_tc_PolicyValue, ACE_TRY_ENV)) return 0; // not equal + if (!type->equivalent (Messaging::_tc_PolicyValue, ACE_TRY_ENV)) // not equal + { + _tao_elem = 0; + return 0; + } ACE_TRY_CHECK; if (_tao_any.any_owns_data ()) { _tao_elem = (Messaging::PolicyValue *)_tao_any.value (); return 1; - } + } else { ACE_NEW_RETURN (_tao_elem, Messaging::PolicyValue, 0); - TAO_InputCDR stream (_tao_any._tao_get_cdr (), - _tao_any._tao_byte_order ()); - if (stream.decode (Messaging::_tc_PolicyValue, _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 (Messaging::_tc_PolicyValue, _tao_elem, 1, ACE_TRY_ENV); + ((CORBA::Any *)&_tao_any)->_tao_replace ( + Messaging::_tc_PolicyValue, + 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 Messaging::PolicyValue *&_tao_elem) +{ + ACE_TRY_NEW_ENV + { + CORBA::TypeCode_var type = _tao_any.type (); + if (!type->equivalent (Messaging::_tc_PolicyValue, ACE_TRY_ENV)) // not equal + { + _tao_elem = 0; + return 0; + } + ACE_TRY_CHECK; + if (_tao_any.any_owns_data ()) + { + _tao_elem = (Messaging::PolicyValue *)_tao_any.value (); + return 1; + } + else + { + ACE_NEW_RETURN (_tao_elem, Messaging::PolicyValue, 0); + TAO_InputCDR stream ( + _tao_any._tao_get_cdr (), + _tao_any._tao_byte_order () + ); + if (stream >> *(Messaging::PolicyValue *)_tao_elem) + { + ((CORBA::Any *)&_tao_any)->_tao_replace ( + Messaging::_tc_PolicyValue, + 1, + ACE_reinterpret_cast (void *, ACE_const_cast (Messaging::PolicyValue *&, _tao_elem)), + ACE_TRY_ENV + ); + ACE_TRY_CHECK; + return 1; + } + else + { + delete ACE_const_cast (Messaging::PolicyValue *&, _tao_elem); + _tao_elem = 0; + } + } + } + ACE_CATCHANY + { + delete ACE_const_cast (Messaging::PolicyValue *&, _tao_elem); + _tao_elem = 0; + return 0; } ACE_ENDTRY; return 0; @@ -2292,8 +3598,23 @@ void operator<<= ( if (!_tao_any_val) return; ACE_TRY_NEW_ENV { - _tao_any.replace (Messaging::_tc_PolicyValueSeq, _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 ( + Messaging::_tc_PolicyValueSeq, + TAO_ENCAP_BYTE_ORDER, + stream.begin (), + 1, + _tao_any_val, + ACE_TRY_ENV + ); + ACE_TRY_CHECK; + } + else + { + delete _tao_any_val; + } } ACE_CATCHANY { @@ -2306,10 +3627,23 @@ void operator<<= (CORBA::Any &_tao_any, Messaging::PolicyValueSeq *_tao_elem) // { ACE_TRY_NEW_ENV { - _tao_any.replace (Messaging::_tc_PolicyValueSeq, _tao_elem, 0, ACE_TRY_ENV); + TAO_OutputCDR stream; + stream << *_tao_elem; + _tao_any._tao_replace ( + Messaging::_tc_PolicyValueSeq, + 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; } @@ -2318,7 +3652,11 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, Messaging::PolicyValueSe ACE_TRY_NEW_ENV { CORBA::TypeCode_var type = _tao_any.type (); - if (!type->equal (Messaging::_tc_PolicyValueSeq, ACE_TRY_ENV)) return 0; // not equal + if (!type->equivalent (Messaging::_tc_PolicyValueSeq, ACE_TRY_ENV)) // not equal + { + _tao_elem = 0; + return 0; + } ACE_TRY_CHECK; if (_tao_any.any_owns_data ()) { @@ -2328,25 +3666,84 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, Messaging::PolicyValueSe else { ACE_NEW_RETURN (_tao_elem, Messaging::PolicyValueSeq, 0); - TAO_InputCDR stream (_tao_any._tao_get_cdr (), - _tao_any._tao_byte_order ()); - if (stream.decode (Messaging::_tc_PolicyValueSeq, _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 (Messaging::_tc_PolicyValueSeq, _tao_elem, 1, ACE_TRY_ENV); + ((CORBA::Any *)&_tao_any)->_tao_replace ( + Messaging::_tc_PolicyValueSeq, + 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 Messaging::PolicyValueSeq *&_tao_elem) +{ + ACE_TRY_NEW_ENV + { + CORBA::TypeCode_var type = _tao_any.type (); + if (!type->equivalent (Messaging::_tc_PolicyValueSeq, ACE_TRY_ENV)) // not equal + { + _tao_elem = 0; + return 0; + } + ACE_TRY_CHECK; + if (_tao_any.any_owns_data ()) + { + _tao_elem = (Messaging::PolicyValueSeq *)_tao_any.value (); + return 1; + } + else + { + ACE_NEW_RETURN (_tao_elem, Messaging::PolicyValueSeq, 0); + TAO_InputCDR stream ( + _tao_any._tao_get_cdr (), + _tao_any._tao_byte_order () + ); + if (stream >> *(Messaging::PolicyValueSeq *)_tao_elem) + { + ((CORBA::Any *)&_tao_any)->_tao_replace ( + Messaging::_tc_PolicyValueSeq, + 1, + ACE_reinterpret_cast (void *, ACE_const_cast (Messaging::PolicyValueSeq *&, _tao_elem)), + ACE_TRY_ENV + ); + ACE_TRY_CHECK; + return 1; + } + else + { + delete ACE_const_cast (Messaging::PolicyValueSeq *&, _tao_elem); + _tao_elem = 0; + } + } + } + ACE_CATCHANY + { + delete ACE_const_cast (Messaging::PolicyValueSeq *&, _tao_elem); + _tao_elem = 0; + return 0; } ACE_ENDTRY; return 0; @@ -2367,8 +3764,23 @@ void operator<<= (CORBA::Any &_tao_any, Messaging::ReplyHandler_ptr _tao_elem) { ACE_NEW (_tao_obj_ptr, CORBA::Object_ptr); *_tao_obj_ptr = Messaging::ReplyHandler::_duplicate (_tao_elem); - _tao_any.replace (Messaging::_tc_ReplyHandler, _tao_obj_ptr, 1, ACE_TRY_ENV); - ACE_TRY_CHECK; + TAO_OutputCDR stream; + if (stream << *_tao_obj_ptr) + { + _tao_any._tao_replace ( + Messaging::_tc_ReplyHandler, + TAO_ENCAP_BYTE_ORDER, + stream.begin (), + 1, + _tao_obj_ptr, + ACE_TRY_ENV + ); + ACE_TRY_CHECK; + } + else + { + delete _tao_obj_ptr; + } } ACE_CATCHANY { @@ -2380,38 +3792,53 @@ void operator<<= (CORBA::Any &_tao_any, Messaging::ReplyHandler_ptr _tao_elem) CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, Messaging::ReplyHandler_ptr &_tao_elem) { CORBA::Object_ptr *tmp = 0; + ACE_NEW_RETURN (tmp, CORBA::Object_ptr, 0); ACE_TRY_NEW_ENV { _tao_elem = Messaging::ReplyHandler::_nil (); CORBA::TypeCode_var type = _tao_any.type (); - if (!type->equal (Messaging::_tc_ReplyHandler, ACE_TRY_ENV)) return 0; // not equal + if (!type->equivalent (Messaging::_tc_ReplyHandler, 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 (Messaging::_tc_ReplyHandler, &_tao_obj_var.out (), 0, ACE_TRY_ENV) - == CORBA::TypeCode::TRAVERSE_CONTINUE) + if (stream >> _tao_obj_var.out ()) { _tao_elem = Messaging::ReplyHandler::_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 (Messaging::_tc_ReplyHandler, tmp, 1, ACE_TRY_ENV); + ((CORBA::Any *)&_tao_any)->_tao_replace ( + Messaging::_tc_ReplyHandler, + 1, + tmp, + ACE_TRY_ENV + ); ACE_TRY_CHECK; return 1; } - // failure + else // failure + { + delete tmp; + } } ACE_CATCHANY { delete tmp; + _tao_elem = Messaging::ReplyHandler::_nil (); return 0; } ACE_ENDTRY; + _tao_elem = Messaging::ReplyHandler::_nil (); return 0; } -#endif /* TAO_HAS_AMI_CALLBACK == 1 || TAO_HAS_AMI_POLLER == 1 */ +#endif /* TAO_HAS_AMI_CALLBACK == 1 || TAO_HAS_AMI_POLLER */ // **************************************************************** @@ -2424,8 +3851,23 @@ void operator<<= (CORBA::Any &_tao_any, Messaging::Poller_ptr _tao_elem) { ACE_NEW (_tao_obj_ptr, CORBA::Object_ptr); *_tao_obj_ptr = Messaging::Poller::_duplicate (_tao_elem); - _tao_any.replace (Messaging::_tc_Poller, _tao_obj_ptr, 1, ACE_TRY_ENV); - ACE_TRY_CHECK; + TAO_OutputCDR stream; + if (stream << *_tao_obj_ptr) + { + _tao_any._tao_replace ( + Messaging::_tc_Poller, + TAO_ENCAP_BYTE_ORDER, + stream.begin (), + 1, + _tao_obj_ptr, + ACE_TRY_ENV + ); + ACE_TRY_CHECK; + } + else + { + delete _tao_obj_ptr; + } } ACE_CATCHANY { @@ -2437,36 +3879,52 @@ void operator<<= (CORBA::Any &_tao_any, Messaging::Poller_ptr _tao_elem) CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, Messaging::Poller_ptr &_tao_elem) { CORBA::Object_ptr *tmp = 0; + ACE_NEW_RETURN (tmp, CORBA::Object_ptr, 0); ACE_TRY_NEW_ENV { _tao_elem = Messaging::Poller::_nil (); CORBA::TypeCode_var type = _tao_any.type (); - if (!type->equal (Messaging::_tc_Poller, ACE_TRY_ENV)) return 0; // not equal + if (!type->equivalent (Messaging::_tc_Poller, 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 (Messaging::_tc_Poller, &_tao_obj_var.out (), 0, ACE_TRY_ENV) - == CORBA::TypeCode::TRAVERSE_CONTINUE) + if (stream >> _tao_obj_var.out ()) { _tao_elem = Messaging::Poller::_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 (Messaging::_tc_Poller, tmp, 1, ACE_TRY_ENV); + ((CORBA::Any *)&_tao_any)->_tao_replace ( + Messaging::_tc_Poller, + 1, + tmp, + ACE_TRY_ENV + ); ACE_TRY_CHECK; return 1; } - // failure + else // failure + { + delete tmp; + } } ACE_CATCHANY { delete tmp; + _tao_elem = Messaging::Poller::_nil (); return 0; } ACE_ENDTRY; + _tao_elem = Messaging::Poller::_nil (); return 0; } + #endif /* TAO_HAS_AMI_POLLER == 1 */ #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) |