SensESP
3.0.1
Universal Signal K sensor toolkit ESP32
Loading...
Searching...
No Matches
resettable.h
Go to the documentation of this file.
1
#ifndef SENSESP_SYSTEM_RESETTABLE_H_
2
#define SENSESP_SYSTEM_RESETTABLE_H_
3
4
#include <queue>
5
6
namespace
sensesp
{
7
8
class
ResettableCompare;
9
20
class
Resettable
{
21
public
:
22
Resettable
(
int
priority = 0);
23
24
virtual
void
reset
() {}
25
26
const
int
get_reset_priority
()
const
{
return
priority; }
27
28
void
set_reset_priority
(
int
priority) { this->priority = priority; }
29
30
static
void
reset_all
();
31
32
friend
class
ResettableCompare
;
33
34
private
:
35
int
priority;
36
37
static
std::priority_queue<Resettable*, std::vector<Resettable*>,
38
ResettableCompare
>
39
reset_list;
40
};
41
42
class
ResettableCompare
{
43
public
:
44
bool
operator()
(
const
Resettable
* a,
const
Resettable
* b) {
45
return
a->priority < b->priority;
46
}
47
};
48
49
}
// namespace sensesp
50
51
#endif
sensesp::ResettableCompare
Definition
resettable.h:42
sensesp::ResettableCompare::operator()
bool operator()(const Resettable *a, const Resettable *b)
Definition
resettable.h:44
sensesp::Resettable
Automatic calling of the reset() method when the device needs to be reset.
Definition
resettable.h:20
sensesp::Resettable::reset_all
static void reset_all()
Definition
resettable.cpp:14
sensesp::Resettable::reset
virtual void reset()
Definition
resettable.h:24
sensesp::Resettable::Resettable
Resettable(int priority=0)
Definition
resettable.cpp:10
sensesp::Resettable::get_reset_priority
const int get_reset_priority() const
Definition
resettable.h:26
sensesp::Resettable::set_reset_priority
void set_reset_priority(int priority)
Definition
resettable.h:28
sensesp
Definition
sensesp.cpp:7
src
sensesp
system
resettable.h
Generated by
1.12.0