Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / tests / Smart_Proxies / Smart_Proxy_Impl.cpp
blobe21bc567688d5af981f93df789b0a3cef101c29b
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 ()
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;
23 Smart_Test_Proxy::Smart_Test_Proxy (Test_ptr proxy)
24 : TAO_Smart_Proxy_Base (proxy)
28 bool
29 Smart_Test_Proxy::can_convert_to_ior () const
31 // Even though a smart proxy is local, this one can be stringified
32 return true;
35 char*
36 Smart_Test_Proxy::convert_to_ior (bool,
37 const char*) const
39 // If this implementation wasn't provided, the ORB would provide
40 // a stringified representation of this object.
41 return CORBA::string_dup (fake_ior_.c_str ());
44 CORBA::Short
45 Smart_Test_Proxy::method (CORBA::Short boo)
47 ACE_DEBUG ((LM_DEBUG,
48 "Yahoo, I am smart\n"));
50 CORBA::Short retval = 0;
51 try
53 retval = TAO_Test_Smart_Proxy_Base::method (boo);
55 catch (const Test::Oops& reason)
57 reason._tao_print_exception ("User Exception");
58 return -1;
61 return retval;
64 const ACE_CString&
65 Smart_Test_Proxy::fake_ior ()
67 return fake_ior_;