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

Main event loop of a EventLoop program. More...

#include <ReactESP.h>

Public Member Functions

 EventLoop ()
 Construct a new EventLoop object.
 
 EventLoop (const EventLoop &)=delete
 
 EventLoop (EventLoop &&)=delete
 
EventLoopoperator= (const EventLoop &)=delete
 
EventLoopoperator= (EventLoop &&)=delete
 
void tick ()
 
DelayEventonDelay (uint32_t delay, react_callback callback)
 Create a new DelayEvent.
 
DelayEventonDelayMicros (uint64_t delay, react_callback callback)
 Create a new DelayEvent.
 
RepeatEventonRepeat (uint32_t interval, react_callback callback)
 Create a new RepeatEvent.
 
RepeatEventonRepeatMicros (uint64_t interval, react_callback callback)
 Create a new RepeatEvent.
 
StreamEventonAvailable (Stream &stream, react_callback callback)
 Create a new StreamEvent.
 
ISREventonInterrupt (uint8_t pin_number, int mode, react_callback callback)
 Create a new ISREvent (interrupt event)
 
TickEventonTick (react_callback callback)
 Create a new TickEvent.
 
void remove (Event *event)
 Remove a event from the list of active events.
 

Friends

class Event
 
class TimedEvent
 
class RepeatEvent
 
class UntimedEvent
 
class ISREvent
 

Detailed Description

Main event loop of a EventLoop program.

Definition at line 265 of file ReactESP.h.

Constructor & Destructor Documentation

◆ EventLoop() [1/3]

reactesp::EventLoop::EventLoop ( )
inline

Construct a new EventLoop object.

Definition at line 276 of file ReactESP.h.

◆ EventLoop() [2/3]

reactesp::EventLoop::EventLoop ( const EventLoop & )
delete

◆ EventLoop() [3/3]

reactesp::EventLoop::EventLoop ( EventLoop && )
delete

Member Function Documentation

◆ onAvailable()

StreamEvent * reactesp::EventLoop::onAvailable ( Stream & stream,
react_callback callback )

Create a new StreamEvent.

Parameters
streamArduino Stream object to monitor
callbackCallback function
Returns
StreamEvent*

Definition at line 172 of file ReactESP.cpp.

Here is the caller graph for this function:

◆ onDelay()

DelayEvent * reactesp::EventLoop::onDelay ( uint32_t delay,
react_callback callback )

Create a new DelayEvent.

Parameters
delayDelay, in milliseconds
callbackCallback function
Returns
DelayEvent*

Definition at line 146 of file ReactESP.cpp.

Here is the caller graph for this function:

◆ onDelayMicros()

DelayEvent * reactesp::EventLoop::onDelayMicros ( uint64_t delay,
react_callback callback )

Create a new DelayEvent.

Parameters
delayDelay, in microseconds
callbackCallback function
Returns
DelayEvent*

Definition at line 152 of file ReactESP.cpp.

◆ onInterrupt()

ISREvent * reactesp::EventLoop::onInterrupt ( uint8_t pin_number,
int mode,
react_callback callback )

Create a new ISREvent (interrupt event)

Parameters
pin_numberGPIO pin number
modeOne of CHANGE, RISING, FALLING
callbackInterrupt handler to call. This should be a very simple function, ideally setting a flag variable or incrementing a counter. The function should be defined with ICACHE_RAM_ATTR.
Returns
ISREvent*

Definition at line 178 of file ReactESP.cpp.

Here is the caller graph for this function:

◆ onRepeat()

RepeatEvent * reactesp::EventLoop::onRepeat ( uint32_t interval,
react_callback callback )

Create a new RepeatEvent.

Parameters
delayInterval, in milliseconds
callbackCallback function
Returns
RepeatEvent*

Definition at line 159 of file ReactESP.cpp.

Here is the caller graph for this function:

◆ onRepeatMicros()

RepeatEvent * reactesp::EventLoop::onRepeatMicros ( uint64_t interval,
react_callback callback )

Create a new RepeatEvent.

Parameters
delayInterval, in microseconds
callbackCallback function
Returns
RepeatEvent*

Definition at line 165 of file ReactESP.cpp.

◆ onTick()

TickEvent * reactesp::EventLoop::onTick ( react_callback callback)

Create a new TickEvent.

Parameters
callbackCallback function to be called at every loop execution
Returns
TickEvent*

Definition at line 185 of file ReactESP.cpp.

Here is the caller graph for this function:

◆ operator=() [1/2]

EventLoop & reactesp::EventLoop::operator= ( const EventLoop & )
delete

◆ operator=() [2/2]

EventLoop & reactesp::EventLoop::operator= ( EventLoop && )
delete

◆ remove()

void reactesp::EventLoop::remove ( Event * event)

Remove a event from the list of active events.

Parameters
eventEvent to remove

Definition at line 191 of file ReactESP.cpp.

◆ tick()

void reactesp::EventLoop::tick ( )

Definition at line 141 of file ReactESP.cpp.

Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ Event

friend class Event
friend

Definition at line 266 of file ReactESP.h.

◆ ISREvent

friend class ISREvent
friend

Definition at line 270 of file ReactESP.h.

◆ RepeatEvent

friend class RepeatEvent
friend

Definition at line 268 of file ReactESP.h.

◆ TimedEvent

friend class TimedEvent
friend

Definition at line 267 of file ReactESP.h.

◆ UntimedEvent

friend class UntimedEvent
friend

Definition at line 269 of file ReactESP.h.


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