summaryrefslogtreecommitdiffstats
path: root/dcopjava/tests/test_impl.cpp
blob: 2b031bcc4cda26a5d90ff96ed49d8590e2c76e22 (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#include <stream.h>
#include <stdio.h>


#include "test_impl.h"


void test_impl::noArg()
{
  printf("SERVER: noArg() called\n");
}


void test_impl::asyncNoArg()
{
  printf("SERVER: asyncNoArg() called\n");
}


void test_impl::oneArg(bool b)
{
  printf("SERVER: oneArg(");
  printf(b ? "true" : "false");
  printf(") called\n");
}


bool test_impl::returnFalse()
{
  printf("SERVER: returnFalse() called\n");
  return false;
}


bool test_impl::returnTrue()
{
  printf("SERVER: returnTrue() called\n");
  return true;
}


short test_impl::shortArg(short in)
{
  cout << "SERVER: short in: " << in << endl;
  return 123;
}


int test_impl::intArg(int in)
{
  cout << "SERVER: int in: " << in << endl;
  return 123456;
}


long test_impl::longArg(long in)
{
  cout << "SERVER: long in: " << in << endl;
  return 1234567890;
}


float test_impl::floatArg(float in)
{
  cout << "SERVER: float in: " << in << endl;
  return 12.34;
}


double test_impl::doubleArg(double in)
{
  cout << "SERVER: double in: " << in << endl;
  return 12.12313123;
}


TQString test_impl::stringArg(TQString in)
{
  cout << "SERVER: TQString in: " << in << endl;
  return "Hello Java";
}


TQCString test_impl::cstringArg(TQCString in)
{
  cout << "SERVER: TQCString in: " << in << endl;
  return "Hello Java";
}


TQStringList test_impl::stringListArg(TQStringList in)
{
  cout << "SERVER: TQStringList in: ";
  for (uint i=0; i<in.count(); ++i)
    cout << in[i] << ", ";
  cout << endl;
  TQStringList result;
  result << "one" << "two" << "three";
  return result;
}


DCOPRef test_impl::DCOPRefArg(DCOPRef in)
{
    cout << "SERVER: DCOPRef in: " << in.app() << ", " 
	 << in.object() << ", " << in.type() << endl;
    return DCOPRef("application", "object", "type");
}