summaryrefslogtreecommitdiff
path: root/TAO/tests/Bench/wire/test_i.cpp
blob: 04e72060da62126cf43d6b0b44a72cdf1c2f19be (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

// $Id$

#include "test_i.h"

char * 
foo_i::all_str (const char *inarg,
                char *& inoutarg,
                CORBA::String_out outarg
                ACE_ENV_ARG_DECL_NOT_USED)
    ACE_THROW_SPEC ((
      CORBA::SystemException
    ))
{
  cout << "inarg: " << inarg << endl;
  cout << "inoutarg: " << inoutarg << endl;

  const char *new_inout = "new_inout";
  const char *new_out = "out";
  const char *new_retval = "return";

  CORBA::string_free (inoutarg);

  inoutarg = CORBA::string_alloc (ACE_OS::strlen (new_inout));
  outarg = CORBA::string_alloc (ACE_OS::strlen (new_out));
  char *retval = CORBA::string_alloc (ACE_OS::strlen (new_retval));

  ACE_OS::sprintf (inoutarg, "%s", new_inout);
  ACE_OS::sprintf (outarg.ptr (), "%s", new_out);
  ACE_OS::sprintf (retval, "%s", new_retval);

  return retval;
}


void
foo_i::push (const char *inarg
             ACE_ENV_ARG_DECL_NOT_USED)
    ACE_THROW_SPEC ((
        CORBA::SystemException
    ))
{
  cout << "Eventreceived is " << inarg << endl;
}