diff options
Diffstat (limited to 'TAO/tao/PolicyC.i')
-rw-r--r-- | TAO/tao/PolicyC.i | 119 |
1 files changed, 89 insertions, 30 deletions
diff --git a/TAO/tao/PolicyC.i b/TAO/tao/PolicyC.i index 07a2a9a2a93..63793eb792a 100644 --- a/TAO/tao/PolicyC.i +++ b/TAO/tao/PolicyC.i @@ -269,7 +269,7 @@ CORBA_PolicyList_var::operator= (const CORBA_PolicyList_var &p) // deep copy delete this->ptr_; ACE_NEW_RETURN (this->ptr_, CORBA_PolicyList (*p.ptr_), - *this); + *this); } return *this; } @@ -453,7 +453,7 @@ CORBA_PolicyTypeSeq_var::operator= (const CORBA_PolicyTypeSeq_var &p) // deep co delete this->ptr_; ACE_NEW_RETURN (this->ptr_, CORBA_PolicyTypeSeq (*p.ptr_), - *this); + *this); } return *this; } @@ -990,21 +990,12 @@ ACE_INLINE CORBA::Boolean operator<< (TAO_OutputCDR &strm, const CORBA_PolicyErr ACE_INLINE CORBA::Boolean operator>> (TAO_InputCDR &strm, CORBA_PolicyError &_tao_aggregate) { - // retrieve RepoID and verify if we are of that type - char *_tao_repoID; - if ((strm >> _tao_repoID) && - (_tao_aggregate._is_a (_tao_repoID))) - { - // now marshal the members - if ( + // now marshal the members + if ( (strm >> _tao_aggregate.reason) - ) - return 1; - else - return 0; - } - else - return 0; + ) + return 1; + return 0; } ACE_INLINE CORBA::Boolean operator<< ( @@ -1052,21 +1043,12 @@ ACE_INLINE CORBA::Boolean operator<< (TAO_OutputCDR &strm, const CORBA_InvalidPo ACE_INLINE CORBA::Boolean operator>> (TAO_InputCDR &strm, CORBA_InvalidPolicies &_tao_aggregate) { - // retrieve RepoID and verify if we are of that type - char *_tao_repoID; - if ((strm >> _tao_repoID) && - (_tao_aggregate._is_a (_tao_repoID))) - { - // now marshal the members - if ( + // now marshal the members + if ( (strm >> _tao_aggregate.indices) - ) - return 1; - else - return 0; - } - else - return 0; + ) + return 1; + return 0; } CORBA::Boolean TAO_Export @@ -1155,3 +1137,80 @@ ACE_INLINE CORBA::Boolean operator>> (TAO_InputCDR &strm, CORBA::SetOverrideType else return 0; } + +ACE_INLINE CORBA::Boolean +operator<< ( + TAO_OutputCDR &strm, + const CORBA::PolicyManager_ptr _tao_objref + ) +{ + CORBA::Object_ptr _tao_corba_obj = _tao_objref; + return (strm << _tao_corba_obj); +} + +ACE_INLINE CORBA::Boolean +operator>> ( + TAO_InputCDR &strm, + CORBA::PolicyManager_ptr &_tao_objref + ) +{ + ACE_TRY_NEW_ENV + { + CORBA::Object_var obj; + if ((strm >> obj.inout ()) == 0) + return 0; + // narrow to the right type + _tao_objref = + CORBA::PolicyManager::_narrow ( + obj.in (), + ACE_TRY_ENV + ); + ACE_TRY_CHECK; + return 1; + } + ACE_CATCHANY + { + // do nothing + } + ACE_ENDTRY; + return 0; +} + +ACE_INLINE CORBA::Boolean +operator<< ( + TAO_OutputCDR &strm, + const CORBA::PolicyCurrent_ptr _tao_objref + ) +{ + CORBA::Object_ptr _tao_corba_obj = _tao_objref; + return (strm << _tao_corba_obj); +} + +ACE_INLINE CORBA::Boolean +operator>> ( + TAO_InputCDR &strm, + CORBA::PolicyCurrent_ptr &_tao_objref + ) +{ + ACE_TRY_NEW_ENV + { + CORBA::Object_var obj; + if ((strm >> obj.inout ()) == 0) + return 0; + // narrow to the right type + _tao_objref = + CORBA::PolicyCurrent::_narrow ( + obj.in (), + ACE_TRY_ENV + ); + ACE_TRY_CHECK; + return 1; + } + ACE_CATCHANY + { + // do nothing + } + ACE_ENDTRY; + return 0; +} + |