1 #ifndef _CALLBACK_SKELETON_HPP__
2 #define _CALLBACK_SKELETON_HPP__
5 #include "../IoTRMIObject.hpp"
6 #include "CallBack.hpp"
10 class CallBack_Skeleton : public CallBackInterface {
12 CallBack_Skeleton(CallBackInterface* _cb, int _port);
15 void ___waitRequestInvokeMethod();
23 CallBackInterface *cb;
29 CallBack_Skeleton::CallBack_Skeleton(CallBackInterface* _cb, int _port) {
31 bool _bResult = false;
33 rmiObj = new IoTRMIObject(_port, &_bResult);
34 ___waitRequestInvokeMethod();
38 CallBack_Skeleton::~CallBack_Skeleton() {
47 int CallBack_Skeleton::printInt() {
49 return cb->printInt();
53 void CallBack_Skeleton::___printInt() {
55 string paramCls[] = { };
57 void* paramObj[] = { };
58 rmiObj->getMethodParams(paramCls, numParam, paramObj);
59 int retVal = printInt();
60 void* retObj = &retVal;
61 rmiObj->sendReturnObj(retObj, "int");
65 void CallBack_Skeleton::setInt(int _i) {
71 void CallBack_Skeleton::___setInt() {
73 string paramCls[] = { "int" };
76 void* paramObj[] = { ¶m1 };
77 rmiObj->getMethodParams(paramCls, numParam, paramObj);
82 void CallBack_Skeleton::___waitRequestInvokeMethod() {
84 // Loop continuously waiting for incoming bytes
87 rmiObj->getMethodBytes();
88 int methodId = rmiObj->getMethodId();
91 case 0 : ___printInt(); break;
92 case 1 : ___setInt(); break;
94 string error = "Method Id not recognized!";