Cleaning up
authorrtrimana <rtrimana@uci.edu>
Sat, 10 Dec 2016 00:35:46 +0000 (16:35 -0800)
committerrtrimana <rtrimana@uci.edu>
Sat, 10 Dec 2016 00:35:46 +0000 (16:35 -0800)
common.mk
iotjava/Makefile
iotjava/iotpolicy/IoTCompiler.java
iotjava/iotrmi/C++/basics/TestClassInterface_Skeleton.cpp

index 0b14291..fdf6b88 100644 (file)
--- a/common.mk
+++ b/common.mk
@@ -1,4 +1,5 @@
 G++ := g++
+ARM_G++ := arm-linux-gnueabihf-g++
 JAVA := java
 JAR := jar
 JAVADOC := javadoc
index 00fac5b..1a4d49c 100644 (file)
@@ -36,10 +36,11 @@ compile:
        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:
index c0e932a..a5a6781 100644 (file)
@@ -999,84 +999,6 @@ public class IoTCompiler {
        }
 
 
-/*     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
         */
index c393c19..60ad5fd 100644 (file)
@@ -18,10 +18,10 @@ int main(int argc, char *argv[])
        cout << argv3 << endl;
        cout << argv4 << endl;
 
-       TestClassInterface *tc = new TestClass(argv2, argv3, argv4);
-       TestClassInterface_Skeleton *tcSkel = new TestClassInterface_Skeleton(tc, port);
+       //TestClassInterface *tc = new TestClass(argv2, argv3, argv4);
+       //TestClassInterface_Skeleton *tcSkel = new TestClassInterface_Skeleton(tc, port);
 
-       delete tc;
-       delete tcSkel;
+       //delete tc;
+       //delete tcSkel;
        return 0;
 }