|
MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
|
Thread-safe event subscription and publishing system for Lila. More...
#include <EventBus.hpp>
Collaboration diagram for Lila::EventBus:Public Member Functions | |
| void | subscribe (EventType type, const std::shared_ptr< Subscription > &subscriber) |
| Subscribe to an event type with a Subscription object. | |
| template<EventHandler Handler> | |
| void | subscribe (EventType type, Handler &&handler) |
| Subscribe to an event type with a handler function. | |
| void | publish (const StreamEvent &event) |
| Publish an event to all subscribers of its type. | |
Private Attributes | |
| std::unordered_map< EventType, std::vector< std::weak_ptr< Subscription > > > | m_subscribers |
| Subscribers by event type. | |
| std::mutex | m_mutex |
| Mutex for thread safety. | |
Thread-safe event subscription and publishing system for Lila.
The EventBus allows components to subscribe to specific event types and receive notifications when those events are published. Supports both Subscription objects and simple handler functions.
Thread safety: All subscription and publishing operations are protected by a mutex.
Definition at line 180 of file EventBus.hpp.