Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / tao / Utils / RIR_Narrow.cpp
blobe8ad3425bea5a6c50b28b5e1afc81fd572dec40b
1 #ifndef TAO_UTILS_RIR_NARROW_CPP
2 #define TAO_UTILS_RIR_NARROW_CPP
4 #include "tao/Utils/RIR_Narrow.h"
5 #include "tao/SystemException.h"
6 #include <stdexcept>
8 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
10 template<class T> typename TAO::Utils::RIR_Narrow<T>::_ptr_type
11 TAO::Utils::RIR_Narrow<T>::narrow (CORBA::ORB_ptr orb, char const * id)
13 CORBA::Object_var object =
14 orb->resolve_initial_references (id);
16 return RIR_Narrow<T>::narrow_object (object.in ());
19 template<class T> typename TAO::Utils::RIR_Narrow<T>::_ptr_type
20 TAO::Utils::RIR_Narrow<T>::narrow (PortableInterceptor::ORBInitInfo_ptr info,
21 char const * id)
23 CORBA::Object_var object = info->resolve_initial_references (id);
25 return RIR_Narrow<T>::narrow_object (object.in ());
28 template<class T> typename TAO::Utils::RIR_Narrow<T>::_ptr_type
29 TAO::Utils::RIR_Narrow<T>::narrow_object (CORBA::Object_ptr object)
31 _var_type narrowed_object = T::_narrow (object);
33 if (CORBA::is_nil (narrowed_object.in ()))
35 throw ::CORBA::INV_OBJREF ();
37 return narrowed_object._retn ();
40 TAO_END_VERSIONED_NAMESPACE_DECL
42 #endif /*TAO_UTILS_RIR_NARROW_CPP*/