31 template <
typename... Args>
class Event
76 void emit(Args... args)
const
80 sub.callback(args...);
Event & operator=(const Event &)=delete
SubscriptionId subscribe(Callback callback)
Registers a callback to be invoked when the event fires.
std::size_t subscriberCount() const noexcept
Returns the number of active subscribers.
void emit(Args... args) const
Fires the event, invoking all registered callbacks with the given arguments.
void clear()
Removes all subscribers.
std::function< void(Args...)> Callback
The callback signature for subscribers.
std::vector< Subscriber > subscribers_
Event(Event &&) noexcept=default
bool unsubscribe(SubscriptionId id)
Removes a previously registered subscription.
Event(const Event &)=delete
std::uint64_t SubscriptionId
Unique identifier for an event subscription.
Common type aliases, sentinel constants, and forward declarations used throughout the Contur 2 kernel...