CallBack_Skeleton(CallBackInterface* _cb, int _port);
~CallBack_Skeleton();
- void waitRequestInvokeMethod();
+ void ___waitRequestInvokeMethod();
int printInt();
void setInt(int _i);
+ void ___printInt();
+ void ___setInt();
+
const static int size = 2;
const static string methodSignatures[size];
bool _bResult = false;
cb = _cb;
rmiObj = new IoTRMIObject(_port, &_bResult, methodSignatures, size);
- waitRequestInvokeMethod();
+ ___waitRequestInvokeMethod();
}
}
-void CallBack_Skeleton::waitRequestInvokeMethod() {
+int CallBack_Skeleton::printInt() {
+
+ return cb->printInt();
+}
+
+
+void CallBack_Skeleton::___printInt() {
+
+ string paramCls[] = { };
+ int numParam = 0;
+ void* paramObj[] = { };
+ rmiObj->getMethodParams(paramCls, numParam, paramObj);
+ int retVal = printInt();
+ void* retObj = &retVal;
+ rmiObj->sendReturnObj(retObj, "int");
+}
+
+
+void CallBack_Skeleton::setInt(int _i) {
+
+ cb->setInt(_i);
+}
+
+
+void CallBack_Skeleton::___setInt() {
+
+ string paramCls[] = { "int" };
+ int numParam = 1;
+ int param1 = 1;
+ void* paramObj[] = { ¶m1 };
+ rmiObj->getMethodParams(paramCls, numParam, paramObj);
+ setInt(param1);
+}
+
+
+void CallBack_Skeleton::___waitRequestInvokeMethod() {
// Loop continuously waiting for incoming bytes
while (true) {
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();
- void* retObj = &retVal;
- rmiObj->sendReturnObj(retObj, "int");
+ ___printInt();
} 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);
+ ___setInt();
} else {
string error = "Signature not recognized: " + string(methodSign);
throw error;
}
-int CallBack_Skeleton::printInt() {
-
- return cb->printInt();
-}
-
-
-void CallBack_Skeleton::setInt(int _i) {
-
- cb->setInt(_i);
-}
-
#endif