CallBack_CBSkeleton(CallBackInterface* _cb, int _objectId);
~CallBack_CBSkeleton();
- void* invokeMethod(IoTRMIObject* rmiObj, string *type);
- int printInt();
- void setInt(int _i);
+ void invokeMethod(IoTRMIObject* rmiObj);
+ int printInt();
+ void setInt(int _i);
+
+ void ___printInt(IoTRMIObject* rmiObj);
+ void ___setInt(IoTRMIObject* rmiObj);
const static int size = 2;
const static string methodSignatures[size];
}
-void* CallBack_CBSkeleton::invokeMethod(IoTRMIObject* rmiObj, string *type) {
-
- // Loop continuously waiting for incoming bytes
- void* retObj = NULL;
- cout << "Get inside invoke method!" << endl;
-
- //rmiObj->getMethodBytes();
- cout << "Get inside invoke 2!" << endl;
- string methodSign = rmiObj->getSignature();
- cout << "Get inside invoke 3!" << endl;
- cout << "Method sign: " << methodSign << endl;
-
- if (methodSign.compare("intprintInt()") == 0) {
- string paramCls[] = { };
- int numParam = 0;
- void* paramObj[] = { };
- rmiObj->getMethodParams(paramCls, numParam, paramObj);
- int retVal = printInt();
- retObj = &retVal;
- *type = "int";
- rmiObj->sendReturnObj(retObj, "int");
- } else if (methodSign.compare("voidsetInt(int)") == 0) {
- string paramCls[] = { "int" };
- int numParam = 1;
- int param1 = 1;
- void* paramObj[] = { ¶m1 };
- rmiObj->getMethodParams(paramCls, numParam, paramObj);
- setInt(param1);
- *type = "void";
- } else {
- string error = "Signature not recognized: " + string(methodSign);
- throw error;
- }
+int CallBack_CBSkeleton::printInt() {
- return retObj;
+ return cb->printInt();
}
-int CallBack_CBSkeleton::printInt() {
+void CallBack_CBSkeleton::___printInt(IoTRMIObject* rmiObj) {
- return cb->printInt();
+ string paramCls[] = { };
+ int numParam = 0;
+ void* paramObj[] = { };
+ rmiObj->getMethodParams(paramCls, numParam, paramObj);
+ int retVal = printInt();
+ void* retObj = &retVal;
+ rmiObj->sendReturnObj(retObj, "int");
}
cb->setInt(_i);
}
+
+void CallBack_CBSkeleton::___setInt(IoTRMIObject* rmiObj) {
+
+ string paramCls[] = { "int" };
+ int numParam = 1;
+ int param1 = 1;
+ void* paramObj[] = { ¶m1 };
+ rmiObj->getMethodParams(paramCls, numParam, paramObj);
+ setInt(param1);
+}
+
+
+void CallBack_CBSkeleton::invokeMethod(IoTRMIObject* rmiObj) {
+
+ string methodSign = rmiObj->getSignature();
+
+ if (methodSign.compare("intprintInt()") == 0) {
+ ___printInt(rmiObj);
+ } else if (methodSign.compare("voidsetInt(int)") == 0) {
+ ___setInt(rmiObj);
+ } else {
+ string error = "Signature not recognized: " + string(methodSign);
+ throw error;
+ }
+}
+
+
#endif