26 queue.push_back(schedule);
32 bool is_cleanup =
false;
34 for (
auto& p_s :
queue) {
35 if (p_s ==
nullptr)
continue;
37 if (millis() >= s.
time) {
45 "Scheduler::execute %s: Executing", s.
name());
70 for (
auto& p_s :
queue) {
71 if (p_s ==
nullptr)
continue;
92 for (
auto it =
queue.begin(); it !=
queue.end(); ++it) {
94 if (p_rule ==
nullptr)
continue;
95 if (!(p_rule)->active) {
Abstract Interface for UDP API.
Definition: IUDPService.h:33
Scheduler which processes all due Schedules (to send out UDP replies)
Definition: Scheduler.h:15
bool is_active
Definition: Scheduler.h:87
int execute(IUDPService &udp)
Execute all due schedules.
Definition: Scheduler.h:30
void setActive(bool flag)
Definition: Scheduler.h:81
bool isActive()
Definition: Scheduler.h:83
void cleanup()
Definition: Scheduler.h:89
int size()
Number of queued schedules.
Definition: Scheduler.h:79
bool isMSearchActive()
Returns true if there is any active schedule with name "MSearch".
Definition: Scheduler.h:69
Vector< Schedule * > queue
Definition: Scheduler.h:86
void add(Schedule *schedule)
Add a schedule to the scheduler.
Definition: Scheduler.h:18
A simple wrapper to provide string functions on char*. If the underlying char* is a const we do not a...
Definition: StrView.h:18
virtual bool equals(const char *str)
checks if the string equals indicated parameter string
Definition: StrView.h:177
Lightweight wrapper around std::vector with Arduino-friendly helpers and a pluggable allocator.
Definition: Vector.h:39
Definition: Allocator.h:13
const char * toString()
Definition: IPAddressAndPort.h:26
An individual Schedule (to send out UDP messages)
Definition: Schedule.h:18
uint64_t end_time
Definition: Schedule.h:25
IPAddressAndPort address
Definition: Schedule.h:29
bool active
Definition: Schedule.h:27
bool report_ip
Definition: Schedule.h:31
virtual const char * name()
Definition: Schedule.h:35
virtual bool process(IUDPService &udp)
Definition: Schedule.h:33
uint64_t time
Definition: Schedule.h:21
uint32_t repeat_ms
Definition: Schedule.h:23