private void writePropertiesJavaStub(String intface, String newIntface, boolean callbackExist, Set<String> callbackClasses) {
println("private IoTRMICall rmiCall;");
- println("private String address;");
+ println("private String callbackAddress;");
println("private int[] ports;\n");
// Get the object Id
Integer objId = mapIntfaceObjId.get(intface);
*/
private void writeConstructorJavaStub(String intface, String newStubClass, boolean callbackExist, Set<String> callbackClasses) {
- println("public " + newStubClass + "(int _port, String _address, int _rev, int[] _ports) throws Exception {");
- println("address = _address;");
+ println("public " + newStubClass + "(int _port, String _skeletonAddress, String _callbackAddress, int _rev, int[] _ports) throws Exception {");
+ println("callbackAddress = _callbackAddress;");
println("ports = _ports;");
- println("rmiCall = new IoTRMICall(_port, _address, _rev);");
+ println("rmiCall = new IoTRMICall(_port, _skeletonAddress, _rev);");
if (callbackExist) {
Iterator it = callbackClasses.iterator();
String callbackType = (String) it.next();
println("int methodId = " + methodNumId + ";");
println("Class<?> retType = void.class;");
println("Class<?>[] paramCls = new Class<?>[] { int.class, String.class, int.class };");
- println("Object[] paramObj = new Object[] { ports[0], address, 0 };");
+ println("Object[] paramObj = new Object[] { ports[0], callbackAddress, 0 };");
println("rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);");
println("}\n");
}
/**
* HELPER: writeStructParamClassJavaStub() writes parameters if struct is present
*/
- private void writeStructParamClassJavaStub(List<String> methParams, List<String> methPrmTypes) {
+ private void writeStructParamClassJavaStub(List<String> methParams, List<String> methPrmTypes, String callbackType) {
print("int paramLen = ");
writeLengthStructParamClassJavaStub(methParams, methPrmTypes);
String simpleType = getGenericType(paramType);
if (isStructClass(simpleType)) {
writeStructMembersJavaStub(simpleType, paramType, param);
+ } else if (checkCallbackType(paramType, callbackType)) { // Check if this has callback object
+ println("paramCls[pos] = int.class;");
+ print("paramObj[pos++] = ");
+ if (isArray(methParams.get(i)))
+ print(getSimpleIdentifier(methParams.get(i)) + ".length");
+ else if (isList(methPrmTypes.get(i)))
+ print(getSimpleIdentifier(methParams.get(i)) + ".size()");
+ else
+ print("new Integer(1)");
+ println(";");
} else {
String prmType = checkAndGetArray(methPrmTypes.get(i), methParams.get(i));
println("paramCls[pos] = " + getSimpleType(getEnumType(prmType)) + ".class;");
* HELPER: writeStdMethodBodyJavaStub() writes the standard method body in the stub class
*/
private void writeStdMethodBodyJavaStub(InterfaceDecl intDecl, List<String> methParams,
- List<String> methPrmTypes, String method) {
+ List<String> methPrmTypes, String method, String callbackType) {
checkAndWriteStructSetupJavaStub(methParams, methPrmTypes, intDecl, method);
println("int methodId = " + intDecl.getMethodNumId(method) + ";");
checkAndWriteEnumTypeJavaStub(methParams, methPrmTypes);
// Generate array of parameter types
if (isStructPresent(methParams, methPrmTypes)) {
- writeStructParamClassJavaStub(methParams, methPrmTypes);
+ writeStructParamClassJavaStub(methParams, methPrmTypes, callbackType);
} else {
print("Class<?>[] paramCls = new Class<?>[] { ");
for (int i = 0; i < methParams.size(); i++) {
- String paramType = checkAndGetArray(methPrmTypes.get(i), methParams.get(i));
- print(getSimpleType(getEnumType(paramType)) + ".class");
+ String prmType = methPrmTypes.get(i);
+ if (checkCallbackType(prmType, callbackType)) { // Check if this has callback object
+ print("int.class");
+ } else { // Generate normal classes if it's not a callback object
+ String paramType = checkAndGetArray(methPrmTypes.get(i), methParams.get(i));
+ print(getSimpleType(getEnumType(paramType)) + ".class");
+ }
// Check if this is the last element (don't print a comma)
if (i != methParams.size() - 1) {
print(", ");
// Generate array of parameter objects
print("Object[] paramObj = new Object[] { ");
for (int i = 0; i < methParams.size(); i++) {
- print(getEnumParam(methPrmTypes.get(i), getSimpleIdentifier(methParams.get(i)), i));
+ String paramType = methPrmTypes.get(i);
+ if (checkCallbackType(paramType, callbackType)) { // Check if this has callback object
+ //if (isArray(methPrmTypes.get(i), methParams.get(i)))
+ if (isArray(methParams.get(i)))
+ print(getSimpleIdentifier(methParams.get(i)) + ".length");
+ else if (isList(methPrmTypes.get(i)))
+ print(getSimpleIdentifier(methParams.get(i)) + ".size()");
+ else
+ print("new Integer(1)");
+ } else
+ print(getEnumParam(methPrmTypes.get(i), getSimpleIdentifier(methParams.get(i)), i));
// Check if this is the last element (don't print a comma)
if (i != methParams.size() - 1) {
print(", ");
private boolean checkCallbackType(String paramType, String callbackType) {
String prmType = returnGenericCallbackType(paramType);
- return callbackType.equals(prmType);
+ if (callbackType == null) // If there is no callbackType it means not a callback method
+ return false;
+ else
+ return callbackType.equals(prmType);
}
println("ex.printStackTrace();");
println("throw new Error(\"Exception when generating skeleton objects!\");");
println("}\n");
- println("int methodId = " + intDecl.getMethodNumId(method) + ";");
- String retType = intDecl.getMethodType(method);
- println("Class<?> retType = " + getSimpleType(getEnumType(retType)) + ".class;");
- // Generate array of parameter types
- print("Class<?>[] paramCls = new Class<?>[] { ");
- for (int i = 0; i < methParams.size(); i++) {
- String paramType = methPrmTypes.get(i);
- if (checkCallbackType(paramType, callbackType)) { // Check if this has callback object
- print("int.class");
- } else { // Generate normal classes if it's not a callback object
- String prmType = checkAndGetArray(methPrmTypes.get(i), methParams.get(i));
- print(getSimpleType(prmType) + ".class");
- }
- if (i != methParams.size() - 1) // Check if this is the last element
- print(", ");
- }
- println(" };");
- // Generate array of parameter objects
- print("Object[] paramObj = new Object[] { ");
- for (int i = 0; i < methParams.size(); i++) {
- String paramType = methPrmTypes.get(i);
- if (checkCallbackType(paramType, callbackType)) { // Check if this has callback object
- //if (isArray(methPrmTypes.get(i), methParams.get(i)))
- if (isArray(methParams.get(i)))
- print(getSimpleIdentifier(methParams.get(i)) + ".length");
- else if (isList(methPrmTypes.get(i)))
- print(getSimpleIdentifier(methParams.get(i)) + ".size()");
- else
- print("new Integer(1)");
- } else
- print(getSimpleIdentifier(methParams.get(i)));
- if (i != methParams.size() - 1)
- print(", ");
- }
- println(" };");
- // Check if this is "void"
- if (retType.equals("void")) {
- println("rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);");
- } else { // We do have a return value
- // Check if the return value NONPRIMITIVES
- if (getParamCategory(retType) == ParamCategory.NONPRIMITIVES) {
- String[] retGenValType = getTypeOfGeneric(retType);
- println("Class<?> retGenValType = " + retGenValType[0] + ".class;");
- println("Object retObj = rmiCall.remoteCall(objectId, methodId, retType, retGenValType, paramCls, paramObj);");
- println("return (" + retType + ")retObj;");
- } else {
- println("Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);");
- println("return (" + retType + ")retObj;");
- }
- }
}
// Now, write the body of stub!
if (isCallbackMethod)
writeCallbackMethodBodyJavaStub(intDecl, methParams, methPrmTypes, method, callbackType);
- else
- writeStdMethodBodyJavaStub(intDecl, methParams, methPrmTypes, method);
+ //else
+ writeStdMethodBodyJavaStub(intDecl, methParams, methPrmTypes, method, callbackType);
println("}\n");
// Write the init callback helper method
if (isCallbackMethod && !isDefined) {
* HELPER: writeCallbackJavaStubGeneration() writes the callback stub generation part
*/
private Map<Integer,String> writeCallbackJavaStubGeneration(List<String> methParams, List<String> methPrmTypes,
- String callbackType) {
+ String callbackType, boolean isStructMethod) {
Map<Integer,String> mapStubParam = new HashMap<Integer,String>();
+ String offsetPfx = "";
+ if (isStructMethod)
+ offsetPfx = "offset";
// Iterate over callback objects
for (int i = 0; i < methParams.size(); i++) {
String paramType = methPrmTypes.get(i);
String param = methParams.get(i);
if (checkCallbackType(paramType, callbackType)) { // Check if this has callback object
- println("try {");
String exchParamType = checkAndGetParamClass(getGenericType(paramType));
// Print array if this is array or list if this is a list of callback objects
if (isArray(param)) {
- println("int numStubs" + i + " = (int) paramObj[" + i + "];");
+ println("int numStubs" + i + " = (int) paramObj[" + offsetPfx + i + "];");
println(exchParamType + "[] stub" + i + " = new " + exchParamType + "[numStubs" + i + "];");
} else if (isList(paramType)) {
- println("int numStubs" + i + " = (int) paramObj[" + i + "];");
+ println("int numStubs" + i + " = (int) paramObj[" + offsetPfx + i + "];");
println("List<" + exchParamType + "> stub" + i + " = new ArrayList<" + exchParamType + ">();");
} else {
println(exchParamType + " stub" + i + " = new " + exchParamType + "_CallbackStub(rmiCall, objIdCnt);");
/**
* HELPER: checkAndWriteEnumTypeJavaSkeleton() writes the enum type (convert from enum to int)
*/
- private void checkAndWriteEnumTypeJavaSkeleton(List<String> methParams, List<String> methPrmTypes) {
+ private void checkAndWriteEnumTypeJavaSkeleton(List<String> methParams, List<String> methPrmTypes, boolean isStructMethod) {
+ String offsetPfx = "";
+ if (isStructMethod)
+ offsetPfx = "offset";
// Iterate and find enum declarations
+ boolean printed = false;
for (int i = 0; i < methParams.size(); i++) {
String paramType = methPrmTypes.get(i);
String param = methParams.get(i);
String simpleType = getGenericType(paramType);
if (isEnumClass(simpleType)) {
// Check if this is enum type
- println("int paramInt" + i + "[] = (int[]) paramObj[" + i + "];");
- println(simpleType + "[] enumVals = " + simpleType + ".values();");
+ println("int paramInt" + i + "[] = (int[]) paramObj[" + offsetPfx + i + "];");
+ if (!printed) {
+ println(simpleType + "[] enumVals = " + simpleType + ".values();");
+ printed = true;
+ }
if (isArray(param)) { // An array
println("int len" + i + " = paramInt" + i + ".length;");
println(simpleType + "[] paramEnum" + i + " = new " + simpleType + "[len" + i + "];");
List<String> methPrmTypes, String method, boolean isCallbackMethod, String callbackType,
boolean isStructMethod) {
- checkAndWriteEnumTypeJavaSkeleton(methParams, methPrmTypes);
+ checkAndWriteEnumTypeJavaSkeleton(methParams, methPrmTypes, isStructMethod);
Map<Integer,String> mapStubParam = null;
if (isCallbackMethod) {
- mapStubParam = writeCallbackJavaStubGeneration(methParams, methPrmTypes, callbackType);
+ println("try {");
+ mapStubParam = writeCallbackJavaStubGeneration(methParams, methPrmTypes, callbackType, isStructMethod);
}
// Check if this is "void"
String retType = intDecl.getMethodType(method);
String param = methParams.get(i);
String simpleType = getGenericType(paramType);
if (isStructClass(simpleType)) {
- if (!begin) { // Generate comma for not the beginning variable
- print(", "); begin = false;
- }
+ if (!begin) // Generate comma for not the beginning variable
+ print(", ");
+ else
+ begin = false;
int methodNumId = intDecl.getMethodNumId(method);
print("int struct" + methodNumId + "Size" + i);
}
List<String> methParams = intDecl.getMethodParams(method);
List<String> methPrmTypes = intDecl.getMethodParamTypes(method);
boolean structExist = false;
+ boolean begin = true;
// Check for params with structs
for (int i = 0; i < methParams.size(); i++) {
String paramType = methPrmTypes.get(i);
String param = methParams.get(i);
String simpleType = getGenericType(paramType);
- boolean begin = true;
if (isStructClass(simpleType)) {
structExist = true;
- if (!begin) {
- print(", "); begin = false;
- }
+ if (!begin)
+ print(", ");
+ else
+ begin = false;
int methodNumId = intDecl.getMethodNumId(method);
print("struct" + methodNumId + "Size" + i);
}
String param = methParams.get(i);
String simpleType = getGenericType(paramType);
if (isStructClass(simpleType)) {
- if (!begin) { // Generate comma for not the beginning variable
- print(", "); begin = false;
- }
+ if (!begin) // Generate comma for not the beginning variable
+ print(", ");
+ else
+ begin = false;
int methodNumId = intDecl.getMethodNumId(method);
print("int struct" + methodNumId + "Size" + i);
}
println(") { ");
if (isCallbackMethod)
writeCallbackMethodBodyCplusStub(intDecl, methParams, methPrmTypes, method, callbackType);
- else
- writeStdMethodBodyCplusStub(intDecl, methParams, methPrmTypes, method, callbackClasses);
+ writeStdMethodBodyCplusStub(intDecl, methParams, methPrmTypes, method, callbackType, isCallbackMethod);
println("}\n");
// Write the init callback helper method
if (isCallbackMethod && !isDefined) {
String param = methParams.get(i);
if (isArrayOrList(paramType, param)) { // Generate loop
println("for (" + getGenericType(paramType) + "* cb : " + getSimpleIdentifier(param) + ") {");
- println(callbackType + "_CallbackSkeleton* skel = new " + callbackType + "_CallbackSkeleton(cb, objIdCnt++);");
+ println(callbackType + "_CallbackSkeleton* skel" + i + " = new " + callbackType + "_CallbackSkeleton(cb, objIdCnt++);");
isArrayOrList = true;
callbackParam = getSimpleIdentifier(param);
} else
- println(callbackType + "_CallbackSkeleton* skel = new " + callbackType + "_CallbackSkeleton(" +
+ println(callbackType + "_CallbackSkeleton* skel" + i + " = new " + callbackType + "_CallbackSkeleton(" +
getSimpleIdentifier(param) + ", objIdCnt++);");
- println("vecCallbackObj.push_back(skel);");
+ println("vecCallbackObj.push_back(skel" + i + ");");
if (isArrayOrList)
println("}");
+ print("int ___paramCB" + i + " = ");
+ if (isArrayOrList)
+ println(callbackParam + ".size();");
+ else
+ println("1;");
}
}
- println("int numParam = " + methParams.size() + ";");
- println("int methodId = " + intDecl.getMethodNumId(method) + ";");
- String retType = intDecl.getMethodType(method);
- //String retTypeC = checkAndGetCplusType(retType);
- //println("string retType = \"" + checkAndGetCplusArrayType(getStructType(getEnumType(retTypeC))) + "\";");
- println("string retType = \"" + checkAndGetCplusRetClsType(getStructType(getEnumType(retType))) + "\";");
- // Generate array of parameter types
- print("string paramCls[] = { ");
- for (int i = 0; i < methParams.size(); i++) {
- String paramType = methPrmTypes.get(i);
- if (checkCallbackType(paramType, callbackType)) { // Check if this has callback object
- print("\"int\"");
- } else { // Generate normal classes if it's not a callback object
- String paramTypeC = checkAndGetCplusArgClsType(methPrmTypes.get(i), methParams.get(i));
- print("\"" + paramTypeC + "\"");
- }
- if (i != methParams.size() - 1) // Check if this is the last element
- print(", ");
- }
- println(" };");
- print("int ___paramCB = ");
- if (isArrayOrList)
- println(callbackParam + ".size();");
- else
- println("1;");
- // Generate array of parameter objects
- print("void* paramObj[] = { ");
- for (int i = 0; i < methParams.size(); i++) {
- String paramType = methPrmTypes.get(i);
- if (checkCallbackType(paramType, callbackType)) { // Check if this has callback object
- print("&___paramCB");
- } else
- print("&" + getSimpleIdentifier(methParams.get(i)));
- if (i != methParams.size() - 1)
- print(", ");
- }
- println(" };");
- // Check if this is "void"
- if (retType.equals("void")) {
- println("void* retObj = NULL;");
- println("rmiCall->remoteCall(objectId, methodId, retType, paramCls, paramObj, numParam, retObj);");
- } else { // We do have a return value
- if (getParamCategory(retType) == ParamCategory.NONPRIMITIVES)
- println(checkAndGetCplusType(retType) + " retVal;");
- else
- println(checkAndGetCplusType(retType) + " retVal = " + generateCplusInitializer(retType) + ";");
- println("void* retObj = &retVal;");
- println("rmiCall->remoteCall(objectId, methodId, retType, paramCls, paramObj, numParam, retObj);");
- println("return retVal;");
- }
}
/**
* HELPER: writeStructParamClassCplusStub() writes member parameters of struct
*/
- private void writeStructParamClassCplusStub(List<String> methParams, List<String> methPrmTypes) {
+ private void writeStructParamClassCplusStub(List<String> methParams, List<String> methPrmTypes, String callbackType) {
print("int numParam = ");
writeLengthStructParamClassCplusStub(methParams, methPrmTypes);
String simpleType = getGenericType(paramType);
if (isStructClass(simpleType)) {
writeStructMembersCplusStub(simpleType, paramType, param);
+ } else if (checkCallbackType(paramType, callbackType)) { // Check if this has callback object
+ println("paramCls[pos] = \"int\";");
+ println("paramObj[pos++] = &___paramCB" + i + ";");
} else {
String prmTypeC = checkAndGetCplusArgClsType(methPrmTypes.get(i), methParams.get(i));
println("paramCls[pos] = \"" + prmTypeC + "\";");
* HELPER: writeStdMethodBodyCplusStub() writes the standard method body in the stub class
*/
private void writeStdMethodBodyCplusStub(InterfaceDecl intDecl, List<String> methParams,
- List<String> methPrmTypes, String method, Set<String> callbackClasses) {
+ List<String> methPrmTypes, String method, String callbackType, boolean isCallbackMethod) {
checkAndWriteStructSetupCplusStub(methParams, methPrmTypes, intDecl, method);
println("int methodId = " + intDecl.getMethodNumId(method) + ";");
checkAndWriteEnumTypeCplusStub(methParams, methPrmTypes);
// Generate array of parameter types
if (isStructPresent(methParams, methPrmTypes)) {
- writeStructParamClassCplusStub(methParams, methPrmTypes);
+ writeStructParamClassCplusStub(methParams, methPrmTypes, callbackType);
} else {
println("int numParam = " + methParams.size() + ";");
print("string paramCls[] = { ");
for (int i = 0; i < methParams.size(); i++) {
String paramType = returnGenericCallbackType(methPrmTypes.get(i));
- if (callbackClasses.contains(paramType)) {
+ if (checkCallbackType(paramType, callbackType)) {
print("\"int\"");
} else {
String paramTypeC = checkAndGetCplusArgClsType(methPrmTypes.get(i), methParams.get(i));
// Generate array of parameter objects
print("void* paramObj[] = { ");
for (int i = 0; i < methParams.size(); i++) {
- print("&" + getEnumParam(methPrmTypes.get(i), getSimpleIdentifier(methParams.get(i)), i));
+ String paramType = returnGenericCallbackType(methPrmTypes.get(i));
+ if (checkCallbackType(paramType, callbackType)) // Check if this has callback object
+ print("&___paramCB" + i);
+ else
+ print("&" + getEnumParam(methPrmTypes.get(i), getSimpleIdentifier(methParams.get(i)), i));
// Check if this is the last element (don't print a comma)
if (i != methParams.size() - 1) {
print(", ");
private void writePropertiesCplusStub(String intface, String newIntface, boolean callbackExist, Set<String> callbackClasses) {
println("IoTRMICall *rmiCall;");
- //println("IoTRMIObject\t\t\t*rmiObj;");
- println("string address;");
+ println("string callbackAddress;");
println("vector<int> ports;\n");
// Get the object Id
Integer objId = mapIntfaceObjId.get(intface);
private void writeConstructorCplusStub(String newStubClass, boolean callbackExist, Set<String> callbackClasses) {
println(newStubClass +
- "(int _port, const char* _address, int _rev, bool* _bResult, vector<int> _ports) {");
- println("address = _address;");
+ "(int _port, const char* _skeletonAddress, const char* _callbackAddress, int _rev, bool* _bResult, vector<int> _ports) {");
+ println("callbackAddress = _callbackAddress;");
println("ports = _ports;");
- println("rmiCall = new IoTRMICall(_port, _address, _rev, _bResult);");
+ println("rmiCall = new IoTRMICall(_port, _skeletonAddress, _rev, _bResult);");
if (callbackExist) {
Iterator it = callbackClasses.iterator();
String callbackType = (String) it.next();
String method = "___initCallBack()";
int methodNumId = intDecl.getHelperMethodNumId(method);
println("int methodId = " + methodNumId + ";");
- //writeCplusCallbackPermission(intface, methodNumId);
println("string retType = \"void\";");
println("string paramCls[] = { \"int\", \"String\", \"int\" };");
println("int rev = 0;");
- println("void* paramObj[] = { &ports[0], &address, &rev };");
+ println("void* paramObj[] = { &ports[0], &callbackAddress, &rev };");
println("void* retObj = NULL;");
println("rmiCall->remoteCall(objectId, methodId, retType, paramCls, paramObj, numParam, retObj);");
println("}\n");
/**
- * HELPER: writeMethodHelperReturnCplusSkeleton() writes the return statement part in skeleton
+ * HELPER: writeMethodInputParameters() writes the parameter variables for C++ skeleton
*/
private void writeMethodInputParameters(List<String> methParams, List<String> methPrmTypes,
Set<String> callbackClasses, String methodId) {
for (int i = 0; i < members.size(); i++) {
String prmTypeC = checkAndGetCplusType(memTypes.get(i));
String prmType = checkAndGetCplusArrayType(prmTypeC, members.get(i));
- println(getSimpleType(getEnumType(prmType)) + " param" + i + "[" + counter + "];");
+ println(getSimpleType(getEnumType(prmType)) + " param" + iVar + i + "[" + counter + "];");
}
} else { // Just one struct element
for (int i = 0; i < members.size(); i++) {
String prmTypeC = checkAndGetCplusType(memTypes.get(i));
String prmType = checkAndGetCplusArrayType(prmTypeC, members.get(i));
- println(getSimpleType(getEnumType(prmType)) + " param" + i + ";");
+ println(getSimpleType(getEnumType(prmType)) + " param" + iVar + i + ";");
}
}
if (isArrayOrList(paramType, param)) { // An array or list
for (int i = 0; i < members.size(); i++) {
String prmTypeC = checkAndGetCplusArgClsType(memTypes.get(i), members.get(i));
println("paramCls[pos] = \"" + prmTypeC + "\";");
- println("paramObj[pos++] = ¶m" + i + "[i];");
+ println("paramObj[pos++] = ¶m" + iVar + i + "[i];");
}
println("}");
} else { // Just one struct element
for (int i = 0; i < members.size(); i++) {
String prmTypeC = checkAndGetCplusArgClsType(memTypes.get(i), members.get(i));
println("paramCls[pos] = \"" + prmTypeC + "\";");
- println("paramObj[pos++] = ¶m" + i + ";");
+ println("paramObj[pos++] = ¶m" + iVar + i + ";");
}
}
}
println("for(int i = 0; i < " + counter + "; i++) {");
for (int j = 0; j < members.size(); j++) {
print("paramStruct" + i + "[i]." + getSimpleIdentifier(members.get(j)));
- println(" = param" + j + "[i];");
+ println(" = param" + i + j + "[i];");
}
println("}");
} else { // Just one struct element
for (int j = 0; j < members.size(); j++) {
print("paramStruct" + i + "." + getSimpleIdentifier(members.get(j)));
- println(" = param" + j + ";");
+ println(" = param" + i + j + ";");
}
}
}
String prmType = returnGenericCallbackType(methPrmTypes.get(i));
if (callbackClasses.contains(prmType)) {
isCallbackMethod = true;
- callbackType = paramType;
- writeCallbackCplusNumStubs(methParams, methPrmTypes, callbackType);
+ callbackType = prmType;
+ println("int numStubs" + i + " = 0;");
println("paramCls[pos] = \"int\";");
println("paramObj[pos++] = &numStubs" + i + ";");
} else { // Generate normal classes if it's not a callback object
String param = methParams.get(i);
String simpleType = getGenericType(paramType);
if (isStructClass(simpleType)) {
- if (!begin) { // Generate comma for not the beginning variable
- print(", "); begin = false;
- }
+ if (!begin) // Generate comma for not the beginning variable
+ print(", ");
+ else
+ begin = false;
int methodNumId = intDecl.getMethodNumId(method);
print("int struct" + methodNumId + "Size" + i);
}
String param = methParams.get(i);
String simpleType = getGenericType(paramType);
if (isStructClass(simpleType)) {
- if (!begin) { // Generate comma for not the beginning variable
- print(", "); begin = false;
- }
+ if (!begin) // Generate comma for not the beginning variable
+ print(", ");
+ else
+ begin = false;
int methodNumId = intDecl.getMethodNumId(method);
print("int struct" + methodNumId + "Size" + i);
}