added max-age and content-format
Fork of mbedConnectorInterface by
Diff: api/ResourceObserver.h
- Revision:
- 31:bacc63106754
- Parent:
- 30:113c2a1d8db2
--- a/api/ResourceObserver.h Tue Apr 07 21:30:03 2015 +0000 +++ b/api/ResourceObserver.h Wed Apr 08 15:49:56 2015 +0000 @@ -31,8 +31,9 @@ /** Default Constructor @param resource input the resource to observe + @param sleep_time input the amount of time to sleep between observations */ - ResourceObserver(DynamicResource *resource); + ResourceObserver(DynamicResource *resource,int sleep_time); /** Copy Constructor @@ -48,9 +49,30 @@ begin the observation (ABSTRACT) */ virtual void beginObservation() = 0; + + /** + stop the observation (ABSTRACT) + */ + virtual void stopObservation() = 0; + /** + we are observing? + */ + bool isObserving(); + + /** + get our sleep time + */ + int getSleepTime(); + protected: + DynamicResource *getResource(); + void setObserving(bool observing); + + private: DynamicResource *m_resource; + bool m_is_observing; + int m_sleep_time; }; #endif // __RESOURCE_OBSERVER_H__ \ No newline at end of file