Logo Pico-Framework A web-first embedded framework for C++
Loading...
Searching...
No Matches
EventManager.h File Reference

Event pub/sub manager for embedded applications using FreeRTOS. More...

#include <vector>
#include <type_traits>
#include <FreeRTOS.h>
#include <task.h>
#include <semphr.h>
#include <queue.h>
#include "events/Event.h"
#include "framework/FrameworkController.h"
+ Include dependency graph for EventManager.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  EventManager
 Manages the system-wide event queue and subscriptions. More...
 
struct  EventManager::Subscriber
 

Detailed Description

Author
Ian Archbell

Part of the PicoFramework application framework. This module provides the EventManager class, which allows tasks to subscribe to specific event types and post events to a global queue.

The EventManager uses a FreeRTOS queue to manage events and supports both task and ISR contexts for posting events.

Tasks can subscribe to specific event types using a bitmask and receive notifications via onEvent() or FreeRTOS task notifications. It is possible to broadcast events to all subscribers or target specific tasks based on their subscriptions.

This design allows for flexible event-driven programming in embedded systems, enabling modular and decoupled task management.

The EventManager is implemented as a singleton, ensuring that there is only one global event queue shared across the application.

Note
Events are represented by the Event class, which encapsulates the event type and any associated data. You can extend the Event class to include additional information as needed for your application.
This is designed to be used in conjunction with the FrameworkTask class, which provides the onEvent() method for handling events.
Version
0.1
Date
2025-03-26
License:\n MIT License
Author
Ian Archbell

Part of the PicoFramework application framework. This module provides the EventManager class, which allows tasks to subscribe to specific event types and post events to a global queue.

The EventManager uses a FreeRTOS queue to manage events and supports both task and ISR contexts for posting events.

Tasks can subscribe to specific event types using a bitmask and receive notifications via onEvent() or FreeRTOS task notifications. It is possible to broadcast events to all subscribers or target specific tasks based on their subscriptions.

This design allows for flexible event-driven programming in embedded systems, enabling modular and decoupled task management.

The EventManager is implemented as a singleton, ensuring that there is only one global event queue shared across the application.

Note
Events are represented by the Event class, which encapsulates the event type and any associated data. You can extend the Event class to include additional information as needed for your application.
This is designed to be used in conjunction with the FrameworkTask class, which provides the onEvent() method for handling events.
Version
0.2
Date
2025-04-22
License:\n MIT License

Definition in file EventManager.h.