2 #include "../IoTRMICall.hpp"
3 #include "TestClassInterface.hpp"
7 class TestClass_Stub : public TestClassInterface {
10 TestClass_Stub(int _port, const char* _address, int _rev, bool* _bResult);
14 void setB(float _float);
15 void setC(string _string);
16 string sumArray(vector<string> newA);
17 //int64_t sumArray(vector<int> newA);
18 int setAndGetA(int newA);
19 int setACAndGetA(string newC, int newA);
20 //void registerCallback(CallBackInterface _cb);
27 //CallBackInterface cb;
32 const static int size = 8;
33 string methodSignatures[size] = {
41 "intsetACAndGetA(string,int)",
43 "voidregisterCallBack(CallBackInterface)"
48 TestClass_Stub::TestClass_Stub() {
55 TestClass_Stub::TestClass_Stub(int _port, const char* _address, int _rev, bool* _bResult) {
58 rmiCall = new IoTRMICall(_port, _address, _rev, _bResult, methodSignatures, size);
62 TestClass_Stub::~TestClass_Stub() {
64 if (rmiCall != NULL) {
71 void TestClass_Stub::setA(int _int) {
74 string sign = "voidsetA(int)";
75 string retType = "void";
76 string paramCls[] = { "int" };
77 void* paramObj[] = { &_int };
79 rmiCall->remoteCall(sign, retType, paramCls, paramObj, numParam, retObj);
83 void TestClass_Stub::setB(float _float) {
86 string sign = "voidsetB(float)";
87 string retType = "void";
88 string paramCls[] = { "float" };
89 void* paramObj[] = { &_float };
91 rmiCall->remoteCall(sign, retType, paramCls, paramObj, numParam, retObj);
95 void TestClass_Stub::setC(string _string) {
98 string sign = "voidsetC(string)";
99 string retType = "void";
100 string paramCls[] = { "string" };
101 void* paramObj[] = { &_string };
103 rmiCall->remoteCall(sign, retType, paramCls, paramObj, numParam, retObj);
107 string TestClass_Stub::sumArray(vector<string> newA) {
110 string sign = "sumArray(string[])";
111 string retType = "string";
112 string paramCls[] = { "string[]" };
113 void* paramObj[] = { &newA };
115 void* retObj = &retVal;
116 rmiCall->remoteCall(sign, retType, paramCls, paramObj, numParam, retObj);
121 /*int64_t TestClass_Stub::sumArray(vector<int> newA) {
124 string sign = "sumArray(int[])";
125 string retType = "long";
126 string paramCls[] = { "int[]" };
127 void* paramObj[] = { &newA };
129 void* retObj = &retVal;
130 rmiCall->remoteCall(sign, retType, paramCls, paramObj, numParam, retObj);
136 int TestClass_Stub::setAndGetA(int newA) {
139 string sign = "intsetAndGetA(int)";
140 string retType = "int";
141 string paramCls[] = { "int" };
142 void* paramObj[] = { &newA };
144 void* retObj = &retVal;
145 rmiCall->remoteCall(sign, retType, paramCls, paramObj, numParam, retObj);
150 int TestClass_Stub::setACAndGetA(string newC, int newA) {
153 string sign = "intsetACAndGetA(string,int)";
154 string retType = "int";
155 string paramCls[] = { "string", "int" };
156 void* paramObj[] = { &newC, &newA };
158 void* retObj = &retVal;
159 rmiCall->remoteCall(sign, retType, paramCls, paramObj, numParam, retObj);
164 /*void TestClass_Stub::registerCallback(CallBackInterface _cb) {
170 int TestClass_Stub::callBack() {
172 return cb.printInt();