=default for generated implementation copy ctor
[ACE_TAO.git] / TAO / tests / Collocated_Best / Collocated_Best_ThuP / Client_Task.cpp
blobbd7ac56e61598fd7e4a315a4f84027bd546d3634
2 #include "Client_Task.h"
3 #include "TestC.h"
5 Client_Task::Client_Task (const ACE_TCHAR *ior,
6 CORBA::ORB_ptr corb,
7 ACE_Thread_Manager *thr_mgr)
8 : ACE_Task_Base (thr_mgr)
9 , input_ (ior)
10 , corb_ (CORBA::ORB::_duplicate (corb))
15 int
16 Client_Task::svc ()
18 int status = 1;
19 try
21 CORBA::Object_var tmp =
22 this->corb_->string_to_object (input_);
24 Test::Hello_var hello =
25 Test::Hello::_narrow(tmp.in ());
27 if (CORBA::is_nil (hello.in ()))
29 ACE_ERROR_RETURN ((LM_DEBUG,
30 "Nil Test::Hello reference <%s>\n",
31 input_),
32 1);
35 CORBA::String_var the_string =
36 hello->get_string ();
38 if (ACE_OS::strcmp (the_string.in (), "Hello there!") != 0)
40 ACE_ERROR ((LM_ERROR, "(%P|%t) - Error, incorrect string returned <%C>\n",
41 the_string.in ()));
42 status = 1;
44 else
46 ACE_DEBUG ((LM_DEBUG, "(%P|%t) - string returned <%C>\n",
47 the_string.in ()));
50 hello->shutdown ();
52 catch (const CORBA::Exception& ex)
54 ex._tao_print_exception ("Exception caught:");
55 status = 1;
58 return status;