blob: 370f7540d6a4d69ff780169119b05347f49a5549 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
/**
* @file RIR_Narrow.cpp
*
* $Id$
*
* @author Carlos O'Ryan <coryan@atdesk.com>
*/
#ifndef RIR_Narrow__cpp_
#define RIR_Narrow__cpp_
#include "RIR_Narrow.h"
#include <stdexcept>
template<class T> TAO::Utils::RIR_Narrow<T>::_ptr_type
TAO::Utils::RIR_Narrow<T>::narrow (CORBA::ORB_ptr orb,
char const * id
ACE_ENV_ARG_DECL)
{
CORBA::Object_var object =
orb->resolve_initial_references (id
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (T::_nil ());
return RIR_Narrow<T>::narrow_object (object.in ()
ACE_ENV_ARG_PARAMETER);
}
template<class T> TAO::Utils::RIR_Narrow<T>::_ptr_type
TAO::Utils::RIR_Narrow<T>::narrow (PortableInterceptor::ORBInitInfo_ptr info,
char const * id
ACE_ENV_ARG_DECL)
{
CORBA::Object_var object =
info->resolve_initial_references (id
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (T::_nil ());
return RIR_Narrow<T>::narrow_object (object.in ()
ACE_ENV_ARG_PARAMETER);
}
template<class T> TAO::Utils::RIR_Narrow<T>::_ptr_type
TAO::Utils::RIR_Narrow<T>::narrow_object (CORBA::Object_ptr object
ACE_ENV_ARG_DECL);
{
_var_type narrowed_object = T::_narrow (object
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (T::_nil ());
if (CORBA::is_nil (narrowed_object.in ()))
{
ACE_THROW (CORBA::INV_OBJREF ());
}
return narrowed_object._retn ();
}
#endif // RIR_Narrow__cpp_
|