ReactESP 3.0.1
Asynchronous programming for the ESP microcontrollers
|
TimedEvents are called based on elapsing of time. More...
#include <ReactESP.h>
Public Member Functions | |
TimedEvent (uint32_t interval, react_callback callback) | |
Construct a new Timed Event object. | |
TimedEvent (uint64_t interval, react_callback callback) | |
Construct a new Timed Event object. | |
bool | operator< (const TimedEvent &other) const |
Return the current time since the device restart in microseconds. | |
void | add (EventLoop *event_loop) override |
void | remove (EventLoop *event_loop) override |
uint32_t | getTriggerTime () const |
uint64_t | getTriggerTimeMicros () const |
bool | isEnabled () const |
![]() | |
Event (react_callback callback) | |
Construct a new Event object. | |
Event (const Event &)=delete | |
Event (Event &&)=delete | |
Event & | operator= (const Event &)=delete |
Event & | operator= (Event &&)=delete |
![]() | |
virtual | ~EventInterface ()=default |
Default virtual destructor. | |
virtual void | tick (EventLoop *event_loop)=0 |
Protected Attributes | |
const uint64_t | interval |
uint64_t | last_trigger_time |
bool | enabled |
![]() | |
const react_callback | callback |
TimedEvents are called based on elapsing of time.
Definition at line 63 of file ReactESP.h.
|
inline |
Construct a new Timed Event object.
interval | Interval or delay for the event, in milliseconds |
callback | Function to be called when the event is triggered |
Definition at line 76 of file ReactESP.h.
|
inline |
Construct a new Timed Event object.
interval | Interval, in microseconds |
callback | Function to be called when the event is triggered |
Definition at line 87 of file ReactESP.h.
|
overridevirtual |
Implements reactesp::EventInterface.
Definition at line 29 of file ReactESP.cpp.
|
inline |
Definition at line 96 of file ReactESP.h.
|
inline |
Definition at line 99 of file ReactESP.h.
|
inline |
Definition at line 102 of file ReactESP.h.
bool reactesp::TimedEvent::operator< | ( | const TimedEvent & | other | ) | const |
Return the current time since the device restart in microseconds.
Returns the time since the device restart. Even though the time is in microseconds, a 64-bit integer is all but guaranteed not to rewrap, ever.
Definition at line 24 of file ReactESP.cpp.
|
overridevirtual |
Implements reactesp::EventInterface.
Definition at line 33 of file ReactESP.cpp.
|
protected |
Definition at line 67 of file ReactESP.h.
|
protected |
Definition at line 65 of file ReactESP.h.
|
protected |
Definition at line 66 of file ReactESP.h.