diff options
Diffstat (limited to 'TAO/tao/Object_T.cpp')
-rw-r--r-- | TAO/tao/Object_T.cpp | 49 |
1 files changed, 39 insertions, 10 deletions
diff --git a/TAO/tao/Object_T.cpp b/TAO/tao/Object_T.cpp index c44bdc66fea..a5f43a350b6 100644 --- a/TAO/tao/Object_T.cpp +++ b/TAO/tao/Object_T.cpp @@ -32,15 +32,45 @@ namespace TAO return T::_nil (); } - return TAO::Narrow_Utils<T>::unchecked_narrow (obj, pbf); + return TAO::Narrow_Utils<T>::unchecked_narrow (obj, + repo_id, + pbf + ACE_ENV_ARG_PARAMETER); } - - template<typename T> - T * + template<typename T> T * Narrow_Utils<T>::unchecked_narrow (CORBA::Object_ptr obj, Proxy_Broker_Factory pbf) { + ACE_DECLARE_NEW_CORBA_ENV; + + T *proxy = 0; + ACE_TRY + { + proxy = + TAO::Narrow_Utils<T>::unchecked_narrow (obj, + 0, + pbf + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + // Swallow the exception + return 0; + } + ACE_ENDTRY; + ACE_CHECK; + + return proxy; + } + + template<typename T> T * + Narrow_Utils<T>::unchecked_narrow (CORBA::Object_ptr obj, + const char *, + Proxy_Broker_Factory pbf + ACE_ENV_ARG_DECL) + { if (CORBA::is_nil (obj)) { return T::_nil (); @@ -66,12 +96,11 @@ namespace TAO && obj->_is_collocated () && pbf != 0; - ACE_NEW_RETURN (proxy, - T (stub, - collocated ? 1 : 0, - obj->_servant ()), - T::_nil ()); - + ACE_NEW_THROW_EX (proxy, + T (stub, + collocated ? 1 : 0, + obj->_servant ()), + CORBA::NO_MEMORY ()); return proxy; } |