1. Fix IOT 322, duplicated callback if query contains
multiple 'and' operation to one resource
2. Fix IOT 323, init-term exceptional case
Change-Id: If78af1060c905c52c36aa6cdbf01af1f8a11db73
Signed-off-by: jk13 <jihyeok13.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/416
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
SSM_CLEANUP_ASSERT(g_pQueryEngineInstance->registerQueryEvent(g_pEventReceiver));
CLEANUP:
SSM_CLEANUP_ASSERT(g_pQueryEngineInstance->registerQueryEvent(g_pEventReceiver));
CLEANUP:
+ if (res != SSM_S_OK &&
+ res != SSM_E_INITIALIZED)
{
SAFE_DELETE(g_pEventReceiver);
}
{
SAFE_DELETE(g_pEventReceiver);
}
{
int k = m_root.child_token.at(1).child_token.size();
std::string model_name = "";
{
int k = m_root.child_token.at(1).child_token.size();
std::string model_name = "";
- ModelConditionVec modelcondition;
- ModelCondition model_data;
- for (int i = 0 ; i < k ; i++)
+ std::map<std::string, ModelConditionVec> modelConditionList;
+
+ for (int i = 0; i < k; i++)
- modelcondition.clear();
Token *temp = &(m_root.child_token.at(1).child_token.at(i));
Token *temp = &(m_root.child_token.at(1).child_token.at(i));
if (temp->type == Context)
{
while (1)
if (temp->type == Context)
{
while (1)
+ ModelCondition model_data;
model_data.predicate = m_root.child_token.at(1).child_token.at(i + 1).condition;
model_data.modelProperty.propertyName = temp->model_property.propertyName;
model_data.modelProperty.propertyType = temp->model_property.propertyType;
model_data.modelProperty.propertyValue = temp->model_property.propertyValue;
model_data.predicate = m_root.child_token.at(1).child_token.at(i + 1).condition;
model_data.modelProperty.propertyName = temp->model_property.propertyName;
model_data.modelProperty.propertyType = temp->model_property.propertyType;
model_data.modelProperty.propertyValue = temp->model_property.propertyValue;
- modelcondition.push_back(model_data);
- result->push_back(std::pair<std::string, ModelConditionVec>(model_name, modelcondition));
- ///result->push_back(model_name[i],modelcondition);
+ modelConditionList[model_name].push_back(model_data);
+
+ for (std::map<std::string, ModelConditionVec>::iterator itor = modelConditionList.begin();
+ itor != modelConditionList.end(); ++itor)
+ {
+ result->push_back(std::pair<std::string, ModelConditionVec>(itor->first,
+ itor->second));
+ }
{
SSMRESULT res = SSM_E_FAIL;
{
SSMRESULT res = SSM_E_FAIL;
+ if (g_pSoftSensorManager != NULL)
+ SSM_CLEANUP_ASSERT(SSM_E_INITIALIZED);
+
SSM_CLEANUP_ASSERT(CreateGlobalInstanceRepo());
SSM_CLEANUP_ASSERT(CreateInstance(OID_ISoftSensorManager, (IBase **)&g_pSoftSensorManager));
SSM_CLEANUP_ASSERT(g_pSoftSensorManager->initializeCore(xmlDescription));
CLEANUP:
SSM_CLEANUP_ASSERT(CreateGlobalInstanceRepo());
SSM_CLEANUP_ASSERT(CreateInstance(OID_ISoftSensorManager, (IBase **)&g_pSoftSensorManager));
SSM_CLEANUP_ASSERT(g_pSoftSensorManager->initializeCore(xmlDescription));
CLEANUP:
+ if (res != SSM_S_OK &&
+ res != SSM_E_INITIALIZED)
{
SAFE_RELEASE(g_pSoftSensorManager);
}
{
SAFE_RELEASE(g_pSoftSensorManager);
}
std::string pathSoftSensors;
std::string pathDescription;
std::string pathSoftSensors;
std::string pathDescription;
+ std::string copyDescription = xmlDescription.c_str();
+
- xmlDoc.parse<0>((char *)xmlDescription.c_str());
+ xmlDoc.parse<0>((char *)copyDescription.c_str());
root = xmlDoc.first_node();
root = xmlDoc.first_node();