Gcc fix for SoftSensorResource, ResourceClientTest
authorMarkus Jung <markus.jung@samsung.com>
Mon, 3 Aug 2015 09:36:18 +0000 (18:36 +0900)
committerMadan Lanka <lanka.madan@samsung.com>
Mon, 3 Aug 2015 11:04:43 +0000 (11:04 +0000)
Added algorithm header file and conditionvariable header file

Change-Id: I4db4ad7d9079973925ecbcd558ffe3ded1f581d4
Signed-off-by: Markus Jung <markus.jung@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/2060
Reviewed-by: Madan Lanka <lanka.madan@samsung.com>
Tested-by: Madan Lanka <lanka.madan@samsung.com>
service/resource-encapsulation/src/resourceContainer/examples/SoftSensorSampleBundle/src/SoftSensorBundleActivator.cpp
service/resource-encapsulation/src/resourceContainer/src/SoftSensorResource.cpp
service/resource-encapsulation/unittests/ResourceClientTest.cpp

index 77b618f..c45cb7b 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "SoftSensorBundleActivator.h"
 #include "DiscomfortIndexSensorResource.h"
+#include <algorithm>
 
 SoftSensorBundleActivator *bundle;
 
@@ -113,4 +114,4 @@ extern "C" void externalCreateResource(resourceInfo resourceInfo)
 extern "C" void externalDestroyResource(BundleResource *pBundleResource)
 {
     bundle->destroyResource(pBundleResource);
-}
\ No newline at end of file
+}
index 5178384..7767e11 100644 (file)
@@ -19,6 +19,7 @@
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
 #include "SoftSensorResource.h"
+#include <algorithm>
 
 using namespace OIC::Service;
 namespace OIC
@@ -60,11 +61,9 @@ namespace OIC
 
         void SoftSensorResource::setAttribute(std::string key, RCSResourceAttributes::Value &&value)
         {
-            std::list<std::string>::iterator itor = std::find(m_inputList.begin(), m_inputList.end(), key);
-
             BundleResource::setAttribute(key, value.toString());
 
-            if (itor != m_inputList.end())
+            if (std::find(m_inputList.begin(), m_inputList.end(), key) != m_inputList.end())
                 executeLogic();
         }
 
index 9486e90..c51d1a5 100644 (file)
@@ -23,6 +23,7 @@
 #include "RCSDiscoveryManager.h"
 #include "RCSResourceObject.h"
 #include "PrimitiveResource.h"
+#include <condition_variable>
 
 #include <mutex>