diff options
Diffstat (limited to 'TAO/tao/ObjectIDList.cpp')
-rw-r--r-- | TAO/tao/ObjectIDList.cpp | 53 |
1 files changed, 28 insertions, 25 deletions
diff --git a/TAO/tao/ObjectIDList.cpp b/TAO/tao/ObjectIDList.cpp index 4432a72ec46..23e3e73b4b1 100644 --- a/TAO/tao/ObjectIDList.cpp +++ b/TAO/tao/ObjectIDList.cpp @@ -86,19 +86,12 @@ void operator<<= ( const CORBA_ORB_ObjectIdList &_tao_elem ) // copying { - CORBA_ORB_ObjectIdList *_tao_any_val; - ACE_NEW (_tao_any_val, CORBA_ORB_ObjectIdList (_tao_elem)); - if (!_tao_any_val) return; - ACE_TRY_NEW_ENV - { - _tao_any.replace (CORBA::ORB::_tc_ObjectIdList, _tao_any_val, 1, ACE_TRY_ENV); // copy the value - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - delete _tao_any_val; - } - ACE_ENDTRY; + TAO_OutputCDR stream; + stream << _tao_elem; + + _tao_any._tao_replace (CORBA::ORB::_tc_ObjectIdList, + TAO_ENCAP_BYTE_ORDER, + stream.begin ()); } CORBA::Boolean @@ -135,15 +128,23 @@ operator>> (TAO_InputCDR &strm, CORBA_ORB_ObjectIdList &_tao_sequence) return 0; // error } -void operator<<= (CORBA::Any &_tao_any, CORBA_ORB_ObjectIdList *_tao_elem) // non copying +void CORBA_ORB_ObjectIdList::_tao_any_destructor (void *x) { - ACE_TRY_NEW_ENV - { - _tao_any.replace (CORBA::ORB::_tc_ObjectIdList, _tao_elem, 0, ACE_TRY_ENV); - ACE_TRY_CHECK; - } - ACE_CATCHANY {} - ACE_ENDTRY; + CORBA_ORB_ObjectIdList *tmp = ACE_static_cast(CORBA_ORB_ObjectIdList*,x); + delete tmp; +} + +void operator<<= (CORBA::Any &_tao_any, CORBA_ORB_ObjectIdList *_tao_elem) +{ + TAO_OutputCDR stream; + stream << *_tao_elem; + + _tao_any._tao_replace (CORBA::ORB::_tc_ObjectIdList, + TAO_ENCAP_BYTE_ORDER, + stream.begin (), + 1, + _tao_elem, + CORBA_ORB_ObjectIdList::_tao_any_destructor); } CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, CORBA_ORB_ObjectIdList *&_tao_elem) @@ -163,11 +164,13 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, CORBA_ORB_ObjectIdList * ACE_NEW_RETURN (_tao_elem, CORBA_ORB_ObjectIdList, 0); TAO_InputCDR stream (_tao_any._tao_get_cdr (), _tao_any._tao_byte_order ()); - if (stream.decode (CORBA::ORB::_tc_ObjectIdList, _tao_elem, 0, ACE_TRY_ENV) - == CORBA::TypeCode::TRAVERSE_CONTINUE) + if (stream >> *_tao_elem) { - ((CORBA::Any *)&_tao_any)->replace (CORBA::ORB::_tc_ObjectIdList, _tao_elem, 1, ACE_TRY_ENV); - ACE_TRY_CHECK; + ((CORBA::Any *)&_tao_any)->_tao_replace ( + CORBA::ORB::_tc_ObjectIdList, + 1, + _tao_elem, + CORBA_ORB_ObjectIdList::_tao_any_destructor); return 1; } else |