SensESP 3.0.1
Universal Signal K sensor toolkit ESP32
Loading...
Searching...
No Matches
resettable.cpp
Go to the documentation of this file.
1#include "sensesp.h"
2
3#include "resettable.h"
4
5namespace sensesp {
6
7std::priority_queue<Resettable*, std::vector<Resettable*>, ResettableCompare>
8 Resettable::reset_list;
9
10Resettable::Resettable(int priority) : priority(priority) {
11 reset_list.push(this);
12}
13
15 ESP_LOGI(__FILENAME__, "Resetting all resettable objects");
16 while (!reset_list.empty()) {
17 auto& resettable = *reset_list.top();
18 resettable.reset();
19 reset_list.pop();
20 }
21}
22
23} // namespace sensesp
static void reset_all()
Resettable(int priority=0)