void registerCallback(vector<CallBackInterface*>_cb);
int callBack();
void handleStruct(vector<data> vecData);
- void handleEnum(vector<EnumC> vecEn);
+ vector<EnumC> handleEnum(vector<EnumC> vecEn);
void ____init_CallBack(); // thread
void ____registerCallBack(); // tell the other side that we are ready
}
-void TestClass_Stub::handleEnum(vector<EnumC> vecEn) {
+vector<EnumC> TestClass_Stub::handleEnum(vector<EnumC> vecEn) {
int numParam = 1;
int methodId = 13;
int numParam2 = vecEn.size();
int methodId2 = 12;
- string retType2 = "void";
+ string retType2 = "int[]";
string paramCls2[numParam2];
// Need to define this container for integer version of enum
int paramEnum[numParam2];
void* paramObj2[numParam2];
- for(int i = 0; i < vecEn.size(); i++) {
+ for(int i = 0; i < numParam2; i++) {
paramCls2[i] = "int";
paramEnum[i] = (int) vecEn[i]; // cast enum to integer
paramObj2[i] = ¶mEnum[i];
}
- void* retObj2 = NULL;
+ vector<int> retEnumInt(numParam2);
+ // 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);
+ int enumsize1 = retEnumInt.size();
+ vector<EnumC> retVal(enumsize1);
+ for (int i=0; i < enumsize1; i++) {
+ retVal[i] = (EnumC) retEnumInt[i];
+ }
+ return retVal;
}