ReactESP 3.3.1
Asynchronous programming for the ESP microcontrollers
Loading...
Searching...
No Matches
reactesp::DelayEvent Class Reference

Event that is triggered after a certain time delay. More...

#include <events.h>

Inheritance diagram for reactesp::DelayEvent:
[legend]
Collaboration diagram for reactesp::DelayEvent:
[legend]

Public Member Functions

 DelayEvent (uint32_t delay, react_callback callback)
 Construct a new Delay Event object.
 DelayEvent (uint64_t delay, react_callback callback)
 Construct a new Delay Event object.
void tick (EventLoop *event_loop) override
Public Member Functions inherited from reactesp::TimedEvent
 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
virtual void add (EventLoop *event_loop) override
virtual void remove (EventLoop *event_loop) override
uint32_t getTriggerTime () const
uint64_t getTriggerTimeMicros () const
bool isEnabled () const
 Check if the event is still active.
virtual void add (std::shared_ptr< EventLoop > event_loop)
virtual void remove (std::shared_ptr< EventLoop > event_loop)
virtual void tick (EventLoop *event_loop)=0
virtual void tick (std::shared_ptr< EventLoop > event_loop)
Public Member Functions inherited from reactesp::Event
 Event (react_callback callback)
 Construct a new Event object.
 Event (const Event &)=delete
 Event (Event &&)=delete
Eventoperator= (const Event &)=delete
Eventoperator= (Event &&)=delete
Public Member Functions inherited from reactesp::EventInterface
virtual ~EventInterface ()=default
 Default virtual destructor.

Additional Inherited Members

Protected Attributes inherited from reactesp::TimedEvent
const uint64_t interval
uint64_t last_trigger_time
bool enabled
Protected Attributes inherited from reactesp::Event
const react_callback callback

Detailed Description

Event that is triggered after a certain time delay.

Definition at line 155 of file events.h.

Constructor & Destructor Documentation

◆ DelayEvent() [1/2]

reactesp::DelayEvent::DelayEvent ( uint32_t delay,
react_callback callback )

Construct a new Delay Event object.

Parameters
delayDelay, in milliseconds
callbackFunction to be called after the delay

Definition at line 40 of file events.cpp.

Here is the call graph for this function:

◆ DelayEvent() [2/2]

reactesp::DelayEvent::DelayEvent ( uint64_t delay,
react_callback callback )

Construct a new Delay Event object.

Parameters
delayDelay, in microseconds
callbackFunction to be called after the delay

Definition at line 45 of file events.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ tick()

void reactesp::DelayEvent::tick ( EventLoop * event_loop)
overridevirtual

Implements reactesp::EventInterface.

Definition at line 50 of file events.cpp.

Here is the call graph for this function:

The documentation for this class was generated from the following files: