cp ./iotrmi/C++/basics/* $(BIN_DIR)/iotpolicy/output_files/Cplus
cd $(BIN_DIR)/iotpolicy/output_files; cp *.java ./Java
cd $(BIN_DIR)/iotpolicy/output_files; cp *.hpp ./Cplus
- cd $(BIN_DIR)/iotpolicy/output_files/Java; $(JAVAC) -cp .:..:../../../$(BIN_DIR) TestClass_Skeleton.java
- cd $(BIN_DIR)/iotpolicy/output_files/Java; $(JAVAC) -cp .:..:../../../$(BIN_DIR) TestClassAdvanced_Stub.java
- cd $(BIN_DIR)/iotpolicy/output_files/Cplus; $(G++) ./TestClass_Skeleton.cpp -o ./TestClass_Skeleton.out --std=c++11 -pthread -pg -I../../../../iotjava/iotrmi/C++/
- cd $(BIN_DIR)/iotpolicy/output_files/Cplus; $(G++) ./TestClassAdvanced_Stub.cpp -o ./TestClassAdvanced_Stub.out --std=c++11 -pthread -pg -I../../../../iotjava/iotrmi/C++/
+# cd $(BIN_DIR)/iotpolicy/output_files/Java; $(JAVAC) -cp .:..:../../../$(BIN_DIR) TestClass_Skeleton.java
+# cd $(BIN_DIR)/iotpolicy/output_files/Java; $(JAVAC) -cp .:..:../../../$(BIN_DIR) TestClassAdvanced_Stub.java
+# cd $(BIN_DIR)/iotpolicy/output_files/Cplus; $(G++) ./TestClass_Skeleton.cpp -o ./TestClass_Skeleton.out --std=c++11 -pthread -pg -I../../../../iotjava/iotrmi/C++/
+# cd $(BIN_DIR)/iotpolicy/output_files/Cplus; $(G++) ./TestClassAdvanced_Stub.cpp -o ./TestClassAdvanced_Stub.out --std=c++11 -pthread -pg -I../../../../iotjava/iotrmi/C++/
+ cd $(BIN_DIR)/iotpolicy/output_files/Cplus; $(ARM_G++) ./TestClassInterface_Skeleton.cpp -o ./TestClassInterface_Skeleton.out --std=c++11 -pthread -pg -I../../../../iotjava/iotrmi/C++/
PHONY += run-java-skeleton
run-java-skeleton:
}
-/* private void writeCallbackMethodBodyJavaStub(InterfaceDecl intDecl, List<String> methParams,
- List<String> methPrmTypes, String method, String callbackType) {
-
- println("try {");
- // Check if this is single object, array, or list of objects
- for (int i = 0; i < methParams.size(); i++) {
- String paramType = methPrmTypes.get(i);
- if (checkCallbackType(paramType, callbackType)) { // Check if this has callback object
- String param = methParams.get(i);
- if (isArrayOrList(paramType, param)) { // Generate loop
- println("for (" + getGenericType(paramType) + " cb : " + getSimpleIdentifier(param) + ") {");
- println(callbackType + "_CallbackSkeleton skel" + i + " = new " + callbackType + "_CallbackSkeleton(cb, objIdCnt++);");
- } else
- println(callbackType + "_CallbackSkeleton skel" + i + " = new " + callbackType + "_CallbackSkeleton(" +
- getSimpleIdentifier(param) + ", objIdCnt++);");
- println("listCallbackObj.add(skel" + i + ");");
- if (isArrayOrList(paramType, param))
- println("}");
- }
- }
- print("}");
- println(" catch (Exception ex) {");
- 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;");
- }
- }
- }*/
-
-
/**
* HELPER: writeMethodJavaStub() writes the methods of the stub class
*/