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"
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
,
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*/