Common System 0.2.0
Common interfaces and patterns for system integration
Loading...
Searching...
No Matches
kcenon::common::concepts::EventBusLike Concept Referenceexport

A type that satisfies the event bus interface requirements. More...

#include <event.h>

Concept definition

template<typename T>
concept kcenon::common::concepts::EventBusLike = requires(T t, uint64_t id) {
{ t.start() } -> std::same_as<void>;
{ t.stop() } -> std::same_as<void>;
{ t.is_running() } -> std::convertible_to<bool>;
{ t.unsubscribe(id) } -> std::same_as<void>;
}
A type that satisfies the event bus interface requirements.
Definition event.h:252

Detailed Description

A type that satisfies the event bus interface requirements.

Types satisfying this concept can publish events and manage subscriptions.

Example usage:

template<EventBusLike B, EventType E>
void broadcast(B& bus, const E& event) {
bus.publish(event);
}

Definition at line 252 of file event.h.