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();
22 const static int size = 2;
23 const static string methodSignatures[size];
26 CallBackInterface *cb;
31 const string CallBack_Skeleton::methodSignatures[CallBack_Skeleton::size] = {
39 CallBack_Skeleton::CallBack_Skeleton(CallBackInterface* _cb, int _port) {
41 bool _bResult = false;
43 rmiObj = new IoTRMIObject(_port, &_bResult);
44 ___waitRequestInvokeMethod();
48 CallBack_Skeleton::~CallBack_Skeleton() {
57 int CallBack_Skeleton::printInt() {
59 return cb->printInt();
63 void CallBack_Skeleton::___printInt() {
65 string paramCls[] = { };
67 void* paramObj[] = { };
68 rmiObj->getMethodParams(paramCls, numParam, paramObj);
69 int retVal = printInt();
70 void* retObj = &retVal;
71 rmiObj->sendReturnObj(retObj, "int");
75 void CallBack_Skeleton::setInt(int _i) {
81 void CallBack_Skeleton::___setInt() {
83 string paramCls[] = { "int" };
86 void* paramObj[] = { ¶m1 };
87 rmiObj->getMethodParams(paramCls, numParam, paramObj);
92 void CallBack_Skeleton::___waitRequestInvokeMethod() {
94 // Loop continuously waiting for incoming bytes
97 rmiObj->getMethodBytes();
98 int methodId = rmiObj->getMethodId();
101 case 0 : ___printInt(); break;
102 case 1 : ___setInt(); break;
104 string error = "Method Id not recognized!";