X-Git-Url: http://plrg.eecs.uci.edu/git/?p=iot2.git;a=blobdiff_plain;f=iotjava%2Fiotrmi%2FC%2B%2B%2Fsample%2FTestClass_Stub.hpp;h=b8cce2186ec0ac5f5cbba5e215d339e0cacc8552;hp=8e470efdf6cecd8baa90a4dd3f60bf71bbb38f73;hb=9588f4768de10645d7b0d8a2214d5c63fc92fde8;hpb=fa20c8e87f7a52d03ce3a71647b22107ef0e9710 diff --git a/iotjava/iotrmi/C++/sample/TestClass_Stub.hpp b/iotjava/iotrmi/C++/sample/TestClass_Stub.hpp index 8e470ef..b8cce21 100644 --- a/iotjava/iotrmi/C++/sample/TestClass_Stub.hpp +++ b/iotjava/iotrmi/C++/sample/TestClass_Stub.hpp @@ -32,9 +32,6 @@ class TestClass_Stub : public TestClassInterface { void ____init_CallBack(); // thread void ____registerCallBack(); // tell the other side that we are ready - const static int size = 12; - const static string methodSignatures[size]; - private: int intA; float floatB; @@ -54,23 +51,6 @@ class TestClass_Stub : public TestClassInterface { int TestClass_Stub::objIdCnt = 0; -const string TestClass_Stub::methodSignatures[TestClass_Stub::size] = { - "voidsetA(int)", // 0 - "voidsetB(float)", // 1 - "voidsetC(string)", // 2 - "sumArray(string[])", // 3 - //"sumArray(int[])", - "intsetAndGetA(int)", // 4 - "intsetACAndGetA(string,int)", // 5 - "intcallBack()", // 6 - "voidregisterCallBack(CallBackInterface)", // 7 - "voidregisterCallBack(CallBackInterface[])", // 8 - "registercallback", // 9 - "handleStruct(StructJ[])", // 10 - "structsize" // 11 -}; - - TestClass_Stub::TestClass_Stub() { address = ""; @@ -306,32 +286,22 @@ void TestClass_Stub::handleStruct(vector vecData) { vector TestClass_Stub::handleEnum(vector vecEn) { int numParam = 1; - int methodId = 13; - string retType = "void"; - string paramCls[] = { "int" }; - int enumsize = vecEn.size(); - void* paramObj[] = { &enumsize }; - void* retObj = NULL; - rmiCall->remoteCall(objectId, methodId, retType, paramCls, paramObj, numParam, retObj); - - int numParam2 = vecEn.size(); - int methodId2 = 12; - string retType2 = "int[]"; - string paramCls2[numParam2]; + int numEl = vecEn.size(); + int methodId = 12; + string retType = "int[]"; + string paramCls[] = { "int[]" }; // Need to define this container for integer version of enum - int paramEnum[numParam2]; - void* paramObj2[numParam2]; - for(int i = 0; i < numParam2; i++) { - paramCls2[i] = "int"; - paramEnum[i] = (int) vecEn[i]; // cast enum to integer - paramObj2[i] = ¶mEnum[i]; + vector paramInt(numEl); + for(int i = 0; i < numEl; i++) { + paramInt[i] = (int) vecEn[i]; // cast enum to integer } - vector retEnumInt(numParam2); + void* paramObj[] = { ¶mInt }; // if no return value just // void* retObj2 = NULL; // This is with return value: - void* retObj2 = &retEnumInt; - rmiCall->remoteCall(objectId, methodId2, retType2, paramCls2, paramObj2, numParam2, retObj2); + vector retEnumInt; + void* retObj = &retEnumInt; + rmiCall->remoteCall(objectId, methodId, retType, paramCls, paramObj, numParam, retObj); int enumsize1 = retEnumInt.size(); vector retVal(enumsize1); for (int i=0; i < enumsize1; i++) {