#ifndef _LIGHTBULBTEST_STUB_HPP__
#define _LIGHTBULBTEST_STUB_HPP__
#include <iostream>
+#include <fstream>
#include "LightBulbTest.hpp"
using namespace std;
vector<int> ports;
const static int objectId = 0;
-
+
+ ofstream log;
public:
LightBulbTest_Stub(int _port, const char* _skeletonAddress, string _callbackAddress, int _rev, bool* _bResult, vector<int> _ports) {
callbackAddress = _callbackAddress;
ports = _ports;
+ // Logging
+ log.open("LightBulbTest_Stub_cpp.log");
+ log << "Port: " << _port << endl;
+ log << "Skeleton address: " << _skeletonAddress << endl;
+ log << "Callback address: " << callbackAddress << endl;
+ log << "Rev: " << _rev << endl;
+ log << "bResult: " << *_bResult << endl;
+ log << "Ports: " << _ports[0] << endl;
rmiCall = new IoTRMICall(_port, _skeletonAddress, _rev, _bResult);
+ log << "Established connection with skeleton!" << endl;
+ //log.close();
}
~LightBulbTest_Stub() {
return retVal;
}
- void init() {
+ void init() {
+ log << "Calling init() in stub!" << endl;
int methodId = 0;
string retType = "void";
int numParam = 0;
string paramCls[] = { };
void* paramObj[] = { };
void* retObj = NULL;
+ log << "About to remote call!" << endl;
rmiCall->remoteCall(objectId, methodId, retType, paramCls, paramObj, numParam, retObj);
+ log << "Remote call performed!" << endl;
+ log.close();
}
void setTemperature(int _temperature) {
};
-//typedef LightBulbTest_Stub* create_t(int _port, const char* _skeletonAddress, string _callbackAddress, int _rev, bool* _bResult, vector<int> _ports);
-//typedef void destroy_t(LightBulbTest_Stub*);
#endif