SensESP 2.7.2
Universal Signal K sensor toolkit ESP32
Loading...
Searching...
No Matches
observable.cpp
Go to the documentation of this file.
1#include "observable.h"
2
3namespace sensesp {
4
5Observable::Observable(Observable&& other) : observers{other.observers} {}
6
8 for (auto o : observers) {
9 o();
10 }
11}
12
13void Observable::attach(std::function<void()> observer) {
14 observers.push_front(observer);
15}
16
17} // namespace sensesp
Construct a new transform based on a single function.
A base class which allow observers to attach callbacks to themselves. The callbacks will be called wh...
Definition observable.h:16
void attach(std::function< void()> observer)