Parking Garage Control System
ESP32 Parking Garage – ESP-IDF/FreeRTOS
Loading...
Searching...
No Matches
IEventBus Class Referenceabstract

Interface for event bus. More...

#include <IEventBus.h>

Inheritance diagram for IEventBus:

Public Member Functions

virtual ~IEventBus ()=default
 
virtual void subscribe (EventType type, std::function< void(const Event &)> handler)=0
 Subscribe to specific event type.
 
virtual void publish (const Event &event)=0
 Publish event to all subscribers.
 
virtual void processAllPending ()=0
 Process all pending events (for synchronous testing)
 
virtual bool waitForEvent (Event &outEvent, uint32_t timeoutMs)=0
 Wait for next event (blocking, for FreeRTOS tasks)
 

Detailed Description

Interface for event bus.

Provides publish-subscribe mechanism for event-driven architecture. Thread-safe implementation required for FreeRTOS multi-tasking.

Constructor & Destructor Documentation

◆ ~IEventBus()

virtual IEventBus::~IEventBus ( )
virtualdefault

Member Function Documentation

◆ processAllPending()

virtual void IEventBus::processAllPending ( )
pure virtual

Process all pending events (for synchronous testing)

Implemented in FreeRtosEventBus.

◆ publish()

virtual void IEventBus::publish ( const Event &  event)
pure virtual

Publish event to all subscribers.

Parameters
eventEvent to publish

Implemented in FreeRtosEventBus.

◆ subscribe()

virtual void IEventBus::subscribe ( EventType  type,
std::function< void(const Event &)>  handler 
)
pure virtual

Subscribe to specific event type.

Parameters
typeEvent type to subscribe to
handlerCallback function called when event occurs

Implemented in FreeRtosEventBus.

◆ waitForEvent()

virtual bool IEventBus::waitForEvent ( Event &  outEvent,
uint32_t  timeoutMs 
)
pure virtual

Wait for next event (blocking, for FreeRTOS tasks)

Parameters
outEventOutput event structure
timeoutMsTimeout in milliseconds (portMAX_DELAY for infinite)
Returns
true if event received, false on timeout

Implemented in FreeRtosEventBus.


The documentation for this class was generated from the following file:
Coverage