Zero-heap static topic-based publish/subscribe router. Fans out events to multiple registered delegate subscribers per topic ID without dynamic memory allocation.
More...
|
| void | clear () noexcept |
| | Reset all topic subscriptions.
|
| |
| constexpr | EventRouter () noexcept=default |
| |
| size_t | publish (uint32_t topicId, const EventVariant &event) const noexcept |
| | Publish an event variant to all subscribers of a specific topic.
|
| |
| template<typename Event > |
| size_t | publishEvent (uint32_t topicId, const Event &event) const noexcept |
| | Publish a concrete event to all subscribers of a specific topic.
|
| |
| bool | subscribe (uint32_t topicId, DelegateType subscriber) noexcept |
| | Subscribe a delegate callback to a specific topic ID.
|
| |
| template<typename Event , typename Callable > |
| bool | subscribeEvent (uint32_t topicId, Callable callable) noexcept |
| | Subscribe a typed event handler lambda to a specific topic ID.
|
| |
| size_t | topicCount () const noexcept |
| | Total active topics currently configured.
|
| |
template<typename EventVariant, size_t MaxSubscribersPerTopic = 8, size_t MaxTopics = 8>
class corium::EventRouter< EventVariant, MaxSubscribersPerTopic, MaxTopics >
Zero-heap static topic-based publish/subscribe router. Fans out events to multiple registered delegate subscribers per topic ID without dynamic memory allocation.
- Template Parameters
-
| EventVariant | Variant containing all supported event types. |
| MaxSubscribersPerTopic | Maximum subscribers registered per topic (default: 8). |
| MaxTopics | Maximum distinct topics supported (default: 8). |