1 #ifndef _ROOMSMART_STUB_HPP__
2 #define _ROOMSMART_STUB_HPP__
5 #include "RoomSmart.hpp"
9 class RoomSmart_Stub : public RoomSmart
14 string callbackAddress;
17 const static int objectId = 0;
24 RoomSmart_Stub(int _port, const char* _skeletonAddress, string _callbackAddress, int _rev, bool* _bResult, vector<int> _ports) {
25 callbackAddress = _callbackAddress;
29 string file = "RoomSmart_Stub_cpp" + to_string(i) + ".log";
30 while (ifstream(file.c_str())) {
32 file = "RoomSmart_Stub_cpp" + to_string(i) + ".log";
35 log << "Port: " << _port << endl;
36 log << "Skeleton address: " << _skeletonAddress << endl;
37 log << "Callback address: " << callbackAddress << endl;
38 log << "Rev: " << _rev << endl;
39 log << "bResult: " << *_bResult << endl;
40 log << "Ports: " << _ports[0] << endl;
41 rmiCall = new IoTRMICall(_port, _skeletonAddress, _rev, _bResult);
42 log << "Established connection with skeleton!" << endl;
46 if (rmiCall != NULL) {
53 log << "Calling getRoomID() in stub!" << endl;
55 string retType = "int";
57 string paramCls[] = { };
58 void* paramObj[] = { };
60 void* retObj = &retVal;
61 log << "About to remote call!" << endl;
62 rmiCall->remoteCall(objectId, methodId, retType, paramCls, paramObj, numParam, retObj);
63 log << "Remote call performed!" << endl;