Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / tests / Bug_1676_Regression / Hello.cpp
blobcdc0726f92b6677c6a37a1174d94ba028e14c6ca
1 #include "Hello.h"
3 Hello::Hello (CORBA::ORB_ptr orb)
4 : orb_ (CORBA::ORB::_duplicate (orb))
8 #if 0
9 char *
10 Hello::get_string (void)
12 return CORBA::string_dup ("Hello there!");
14 #endif
16 ::Test::StringList *
17 Hello::get_stringList ()
19 Test::StringList * seq;
20 ACE_NEW_RETURN (seq,
21 Test::StringList(10),
22 0);
23 seq->length(10);
24 for (CORBA::ULong i = 0; i<seq->length(); i++)
26 char tmp[255] = {0};
27 ACE_OS::sprintf(tmp, "Hello World %d", i);
28 (*seq)[i] = CORBA::string_dup(tmp);
31 return seq;
34 void
35 Hello::get_stringList2 (::CORBA::Boolean initialize,
36 ::Test::StringList_out osl)
38 // CORBA::String_var the_string = osl->length();
39 // ACE_DEBUG ((LM_DEBUG, "(%P|%t) - Entering get_stringList2(%.4d)\n", osl));
41 if (initialize)
43 ACE_NEW (osl,
44 Test::StringList(10));
46 osl->length(5);
47 for (CORBA::ULong i = 0; i<osl->length(); i++)
49 char tmp[255] = {0};
50 ACE_OS::sprintf(tmp, "Hello Again %d", i);
51 (*osl)[i] = CORBA::string_dup(tmp);
56 void
57 Hello::mod_stringList (::Test::StringList & iosl)
59 // osl->length(10);
60 for (CORBA::ULong i = 0; i<iosl.length(); i++)
62 char tmp[255] = {0};
63 ACE_OS::sprintf(tmp, "Hello Client %d", i);
64 if (i%2)
66 iosl[i] = CORBA::string_dup(tmp);
71 void
72 Hello::shutdown (void)
74 this->orb_->shutdown (0);