Perfecting IoTSlave for C++; Found one issue with SSH/Java process execution in which...
[iot2.git] / benchmarks / Cpp / Lifxtest / LightBulbTest_Stub.hpp
index 5d0c9b0b321787cea37ff0c661cdef1198dd1acd..3e20d5bc533c8dfcdea49bd2b56489dc10d2c335 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _LIGHTBULBTEST_STUB_HPP__
 #define _LIGHTBULBTEST_STUB_HPP__
 #include <iostream>
+#include <fstream>
 #include "LightBulbTest.hpp"
 
 using namespace std;
@@ -14,7 +15,8 @@ class LightBulbTest_Stub : public LightBulbTest
        vector<int> ports;
 
        const static int objectId = 0;
-       
+
+       ofstream log;
 
        public:
 
@@ -23,7 +25,17 @@ class LightBulbTest_Stub : public LightBulbTest
        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() {
@@ -99,14 +111,18 @@ class LightBulbTest_Stub : public LightBulbTest
                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) { 
@@ -145,6 +161,4 @@ class LightBulbTest_Stub : public LightBulbTest
 
 };
 
-//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