Ditto 4.7.2
Loading...
Searching...
No Matches
Observer.hpp
1#ifndef _DITTO_OBSERVER_
2#define _DITTO_OBSERVER_
3
4namespace ditto {
5
11class Observer {
12private:
16 virtual void on_stop() = 0;
17
18protected:
23 bool stopped;
24
28 Observer();
33 ~Observer();
34
35public:
39 void stop();
40
44 bool is_stopped();
45};
46
47} // namespace ditto
48
49#endif
An observation token returned by any observation API in the Ditto SDK. Retain this object to continue...
Definition Observer.hpp:11
void stop()
Stops the observation and cleans up all associated resources.
Definition Observer.cpp:10
bool is_stopped()
Returns true is the Observer was stopped.
Definition Observer.cpp:17
Observer()
Constructs a new Observer.
Definition Observer.cpp:4
bool stopped
Track if the Observer has already been stopped so we don't stop it twice when destroying the object.
Definition Observer.hpp:23
~Observer()
Destroy the Abstract Observer object canceling the observer if it hasn't been done in stop
Definition Observer.cpp:8