Working C++ IoTSlave for both IoTSet and IoTRelation; threading works for C++ LifxLig...
[iot2.git] / benchmarks / drivers / Cpp / LabRoom / Room_Skeleton.hpp
index 1cb96d8289b0b10eaf318a79df9fd6922eab0672..fd88f24bb5d1055249e9d9358099f1c9d92c7e2f 100644 (file)
@@ -31,7 +31,13 @@ class Room_Skeleton : public Room
                mainObj = _mainObj;
                callbackAddress = _callbackAddress;
                // Logging
-               log.open("LightBulb_Skeleton_cpp.log");
+               int i=0;
+               string file = "Room_Skeleton_cpp" + to_string(i) + ".log";
+               while (ifstream(file.c_str())) {
+                       i++;
+                       file = "Room_Skeleton_cpp" + to_string(i) + ".log";
+               }
+               log.open(file);
                log << "Callback address: " << callbackAddress << endl;
                log << "Port: " << _port << endl;
                rmiObj = new IoTRMIObject(_port, &_bResult);