{
public:
typedef std::function<OCStackResult(std::shared_ptr<PrimitiveResource>,
- const RCSResourceAttributes &)> DataCacheCB;
+ const RCSResourceAttributes &, int)> DataCacheCB;
typedef std::shared_ptr<ObserveCache> Ptr;
public:
ObserveCache & operator = (const ObserveCache &) = delete;
ObserveCache & operator = (ObserveCache &&) = delete;
- void startCache(DataCacheCB func);
+ void startCache(DataCacheCB func, bool reportAll = false);
void stopCache();
CACHE_STATE getCacheState() const;
RCSResourceAttributes m_attributes;
CACHE_STATE m_state;
+ std::mutex m_cbMutex;
DataCacheCB m_reportCB;
std::atomic<bool> m_isStart;
private:
static void verifyObserveCB(const HeaderOptions &_hos,
const ResponseStatement &_rep, int _result,
- unsigned int _seq, weakDataCache ptr);
+ unsigned int _seq, weakDataCache ptr, bool reportAll);
void onObserve(const HeaderOptions &_hos,
- const ResponseStatement &_rep, int _result, unsigned int _seq);
+ const ResponseStatement &_rep, int _result, unsigned int _seq, bool reportAll);
bool convertOCResultToSuccess(OCStackResult ret);
};
} // namespace Service