Collection resource not notifying its updated model when child resource is added...
[platform/upstream/iotivity.git] / service / simulator / src / server / simulator_single_resource_impl.h
index c54cac9..6aa6a4a 100755 (executable)
@@ -49,6 +49,8 @@ class SimulatorSingleResourceImpl : public SimulatorSingleResource
         std::vector<ObserverInfo> getObserversList();
         void notify(int id);
         void notifyAll();
+        void notify(int id, SimulatorResourceModel &resModel);
+        void notifyAll(SimulatorResourceModel &resModel);
 
         bool getAttribute(const std::string &attrName,
                           SimulatorResourceModel::Attribute &attribute);
@@ -70,7 +72,10 @@ class SimulatorSingleResourceImpl : public SimulatorSingleResource
         std::vector<int> getAttributeUpdationIds();
         void stopUpdation(const int id);
         void setResourceModel(const SimulatorResourceModel &resModel);
+        void setPutErrorResponseModel(const SimulatorResourceModel &resModel);
+        void setPostErrorResponseModel(const SimulatorResourceModel &resModel);
         void notifyApp();
+        void notifyApp(SimulatorResourceModel &resModel);
 
     private:
         SimulatorSingleResourceImpl();
@@ -78,6 +83,7 @@ class SimulatorSingleResourceImpl : public SimulatorSingleResource
         std::shared_ptr<OC::OCResourceResponse> requestOnBaseLineInterface(
             std::shared_ptr<OC::OCResourceRequest> request);
         void resourceModified();
+        bool updateResourceModel(OC::OCRepresentation &ocRep, SimulatorResourceModel &resModel);
 
         SimulatorResource::Type m_type;
         std::string m_name;
@@ -88,6 +94,8 @@ class SimulatorSingleResourceImpl : public SimulatorSingleResource
         std::recursive_mutex m_objectLock;
         std::mutex m_modelLock;
         SimulatorResourceModel m_resModel;
+        SimulatorResourceModel m_putErrorResModel;
+        SimulatorResourceModel m_postErrorResModel;
         ResourceModelChangedCallback m_modelCallback;
         ObserverCallback m_observeCallback;
         UpdateAutomationMngr m_updateAutomationMgr;