blob: 0fb7d2c70bf67cb51a7f90be461e99df5a181bba (
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
|
/**
* @file RIR_Narrow.cpp
*
* $Id$
*
* @author Jody Hagins <jody@atdesk.com>
* @author Carlos O'Ryan <coryan@uci.edu>
*/
#ifndef TAO_PERF_RTEC_RIR_NARROW_CPP
#define TAO_PERF_RTEC_RIR_NARROW_CPP
#include "RIR_Narrow.h"
#include "tao/Environment.h"
#include "ace/Log_Msg.h"
template<class Interface> typename RIR_Narrow<Interface>::Interface_ptr
RIR_Narrow<Interface>::resolve (CORBA::ORB_ptr orb,
const char *object_id)
{
Interface_var interface;
try
{
CORBA::Object_var object =
orb->resolve_initial_references (object_id);
interface = Interface::_narrow (object.in ());
if (CORBA::is_nil (interface.in ()))
{
ACE_ERROR ((LM_ERROR,
"Panic - error while narrowing <%s>\n",
object_id));
ACE_OS::exit (1);
}
} catch (const CORBA::Exception& ex) {
ex._tao_print_exception ("Caught an exception \n");
}
return interface._retn ();
}
#endif /* TAO_PERF_RTEC_RIR_NARROW_CPP */
|