Merge branch 'simulator'.
[platform/upstream/iotivity.git] / service / resource-encapsulation / src / resourceCache / include / DataCache.h
index 820960a..025aca6 100644 (file)
@@ -43,6 +43,11 @@ namespace OIC
                 DataCache();
                 ~DataCache();
 
+                DataCache(const DataCache &) = default;
+                DataCache(DataCache &&) = default;
+                DataCache & operator = (const DataCache &) = default;
+                DataCache & operator = (DataCache &&) = default;
+
                 void initializeDataCache(PrimitiveResourcePtr pResource);
 
                 CacheID addSubscriber(CacheCB func, REPORT_FREQUENCY rf, long repeatTime);
@@ -54,6 +59,7 @@ namespace OIC
 
                 void requestGet();
                 bool isEmptySubscriber() const;
+                bool isCachedData() const;
 
             private:
                 // resource instance
@@ -63,10 +69,12 @@ namespace OIC
                 RCSResourceAttributes attributes;
                 CACHE_STATE state;
                 CACHE_MODE mode;
+                bool isReady;
 
                 // subscriber info
                 std::unique_ptr<SubscriberInfo> subscriberList;
                 mutable std::mutex m_mutex;
+                mutable std::mutex att_mutex;
 
                 ExpiryTimer networkTimer;
                 ExpiryTimer pollingTimer;
@@ -78,9 +86,11 @@ namespace OIC
                 TimerCB pTimerCB;
                 TimerCB pPollingCB;
 
+                unsigned int lastSequenceNum;
+
             public:
                 void onObserve(const HeaderOptions &_hos,
-                               const ResponseStatement &_rep, int _result, int _seq);
+                               const ResponseStatement &_rep, int _result, unsigned int _seq);
                 void onGet(const HeaderOptions &_hos, const ResponseStatement &_rep, int _result);
             private:
                 void onTimeOut(const unsigned int timerID);