Imported Upstream version 0.9.1
[platform/upstream/iotivity.git] / service / soft-sensor-manager / SSMCore / src / SensorProcessor / ContextExecutor.cpp
index 668421f..e5f8078 100644 (file)
@@ -31,8 +31,6 @@ SSMRESULT CContextExecutor::finalConstruct()
 
     SSM_CLEANUP_ASSERT(m_pContextRepository->registerResourceFinderEvent(this));
 
-    SSM_CLEANUP_ASSERT(m_pContextRepository->startResourceFinder());
-
 CLEANUP:
     return res;
 }
@@ -148,7 +146,7 @@ void CContextExecutor::registerContext(TypeofEvent callType, ISSMResource *pSSMR
     }
 }
 
-void CContextExecutor::onExecute(IN void *pArg)
+void CContextExecutor::onExecute(void *pArg)
 {
     intptr_t         *pMessage = (intptr_t *)pArg;
 
@@ -189,7 +187,7 @@ void CContextExecutor::onExecute(IN void *pArg)
     }
 }
 
-void CContextExecutor::onTerminate(IN void *pArg)
+void CContextExecutor::onTerminate(void *pArg)
 {
     intptr_t         *pMessage = (intptr_t *)pArg;
 
@@ -294,9 +292,8 @@ int CContextExecutor::onEvent(std::string type, TypeofEvent callType,
             runLogic(inputData, softSensorName);
         }
     }
-    else //This data is primitive
+    else if (m_registeredResources.find(type) != m_registeredResources.end()) //This data is primitive
     {
-        //TODO: Temporally added for primitive data testing
         addOutput(ctxData);
     }
 
@@ -308,6 +305,10 @@ void  CContextExecutor::unregisterContext(TypeofEvent callType, ISSMResource *pS
 {
     std::vector<ISSMResource *> baseList;
 
+    //////////
+    ///TODO: Need to clean up m_mapResourceLookup list
+    //////////
+
     //This is primitive sensor
     if (pSSMResource->inputList.size() == 0)
     {
@@ -396,4 +397,4 @@ void CContextExecutor::runLogic(std::vector<ContextData> inputData, std::string
         m_ctxEventList[softSensor]->onCtxEvent(SPF_START, inputData);
     }
     m_mtxLibraryIO.unlock();
-}
\ No newline at end of file
+}