Modify unused parameter in cancelResourceCache().
Change return type of cancelResourceCache() to CacheID
Fix Sconscript for Resource Manipulation.
Change-Id: I3723619599d40a081c58133d12a75d487ddcc8cc
Signed-off-by: jyong2.kim <jyong2.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1421
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Madan Lanka <lanka.madan@samsung.com>
Reviewed-by: Hun-je Yeon <hunje.yeon@samsung.com>
Reviewed-by: Younghyun Joo <yh_.joo@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
# Build notification manager project
SConscript('notification-manager/SConscript')
- # Build resource-manipulation project
- #SCconscript('resource-manipulation/SConscript')
+ # Build resource-manipulation project
+ #SConscript('resource-manipulation/SConscript')
#else:
# SConscript('notification-manager/SampleApp/arduino/SConscript')
Import('env')
-SConscript('common/SConscript')
-#SConscript('resourceBroker/SConscript')
-#SConscript('resourceCache/SConscript')
-SConscript('serverBuilder/SConscript')
-SConscript('resourceContainer/SConscript')
+SConscript('modules/common/SConscript')
+#SConscript('modules/resourceBroker/SConscript')
+#SConscript('modules/resourceCache/SConscript')
+SConscript('modules/serverBuilder/SConscript')
+SConscript('modules/resourceContainer/SConscript')
#SConscript('sdk/SConscript')
CacheID requestResourceCache(
PrimitiveResourcePtr pResource,
CacheCB func = NULL, REPORT_FREQUENCY rf = REPORT_FREQUENCY::NONE, long time = 0l);
- OCStackResult cancelResourceCache(PrimitiveResourcePtr pResource, CacheID id);
+ CacheID cancelResourceCache(CacheID id);
OCStackResult updateResourceCache(PrimitiveResourcePtr pResource);
const ResourceAttributes getCachedData(PrimitiveResourcePtr pResource) const;
}
}
-
ResourceCacheManager * ResourceCacheManager::getInstance()
{
if(s_instance == nullptr)
PrimitiveResourcePtr pResource, CacheCB func,
REPORT_FREQUENCY rf, long reportTime)
{
- CacheID ret = 0;
+ CacheID retID = 0;
if(rf != REPORT_FREQUENCY::NONE)
{
if(func == NULL)
{
- return ret;
+ return retID;
}
if(!reportTime)
{
newHandler = std::make_shared<DataCache>(pResource, func, rf, reportTime);
s_cacheDataList->push_back(newHandler);
}
- ret = newHandler->addSubscriber(func, rf, reportTime);
+ retID = newHandler->addSubscriber(func, rf, reportTime);
- return ret;
+ return retID;
}
-OCStackResult ResourceCacheManager::cancelResourceCache(PrimitiveResourcePtr pResource, CacheID id)
+CacheID ResourceCacheManager::cancelResourceCache(CacheID id)
{
- OCStackResult ret = OC_STACK_ERROR;
-
+ CacheID retID = 0;
if(id == 0)
{
- return ret;
+ return retID;
}
- // TODO cancel cache
- CacheID retID = 0;
- DataCachePtr deleteCacheHandler = findDataCache(pResource);
- if(deleteCacheHandler == nullptr)
+ DataCachePtr foundCacheHandler = findDataCache(id);
+ if(foundCacheHandler == nullptr)
{
- return ret;
+ return retID;
}
else
{
- retID = deleteCacheHandler->deleteSubscriber(id);
+ retID = foundCacheHandler->deleteSubscriber(id);
}
- if(retID == id)
- {
- ret = OC_STACK_OK;
- }
-
- return ret;
+ return retID;
}
DataCachePtr ResourceCacheManager::findDataCache(PrimitiveResourcePtr pResource) const