|
MayaFlux 0.4.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 | publish (const StreamEvent &event) |
| Publish an event to all subscribers of its type. | |
| 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. | |
Private Attributes | |
| std::mutex | m_mutex |
| Mutex for thread safety. | |
| std::unordered_map< EventType, std::vector< std::weak_ptr< Subscription > > > | m_subscribers |
| Subscribers by event type. | |
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.