callbackAddress = _callbackAddress;
ports = _ports;
// Logging
- log.open("LightBulbTest_Stub_cpp.log");
+ int i=0;
+ string file = "LightBulbTest_Stub_cpp" + to_string(i) + ".log";
+ while (ifstream(file.c_str())) {
+ i++;
+ file = "LightBulbTest_Stub_cpp" + to_string(i) + ".log";
+ }
+ log.open(file);
log << "Port: " << _port << endl;
log << "Skeleton address: " << _skeletonAddress << endl;
log << "Callback address: " << callbackAddress << endl;
}
}
- void turnOn() {
+ void turnOn() {
+ log << "Calling turnOn() in stub!" << endl;
int methodId = 2;
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;
}
double getBrightness() {
return retVal;
}
- void turnOff() {
+ void turnOff() {
+ log << "Calling turnOff() in stub!" << endl;
int methodId = 1;
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;
}
bool getState() {