ACE+TAO-7_0_8
[ACE_TAO.git] / TAO / tests / Smart_Proxies / Smart_Proxy_Impl.cpp
blob097c5217a69b8685d3fb42bea9fe06be993d3039
1 #include "Smart_Proxy_Impl.h"
3 ACE_CString Smart_Test_Proxy::fake_ior_ ("This_is_my_fake_ior");
5 Smart_Test_Factory::Smart_Test_Factory (void)
7 ACE_DEBUG ((LM_DEBUG,
8 "Smart_Test_Factory\n"));
11 Test_ptr
12 Smart_Test_Factory::create_proxy (Test_ptr proxy)
14 ACE_DEBUG ((LM_DEBUG,
15 "create_smart_proxy\n"));
17 if (CORBA::is_nil (proxy) == 0)
18 ACE_NEW_RETURN (proxy, Smart_Test_Proxy (proxy), 0);
20 return proxy;
24 Smart_Test_Proxy::Smart_Test_Proxy (Test_ptr proxy)
25 : TAO_Smart_Proxy_Base (proxy)
29 bool
30 Smart_Test_Proxy::can_convert_to_ior () const
32 // Even though a smart proxy is local, this one can be stringified
33 return true;
36 char*
37 Smart_Test_Proxy::convert_to_ior (bool,
38 const char*) const
40 // If this implementation wasn't provided, the ORB would provide
41 // a stringified representation of this object.
42 return CORBA::string_dup (fake_ior_.c_str ());
45 CORBA::Short
46 Smart_Test_Proxy::method (CORBA::Short boo)
48 ACE_DEBUG ((LM_DEBUG,
49 "Yahoo, I am smart\n"));
51 CORBA::Short retval = 0;
52 try
54 retval = TAO_Test_Smart_Proxy_Base::method (boo);
56 catch (const Test::Oops& reason)
58 reason._tao_print_exception ("User Exception");
59 return -1;
62 return retval;
65 const ACE_CString&
66 Smart_Test_Proxy::fake_ior (void)
68 return fake_ior_;