Skip to content

API · fair::mq

EventManagerclass

#include <fairmq/EventManager.h>fairmq/EventManager.h:49GitHub ↗

Manages event callbacks from different subscribers.

The event manager stores a set of callbacks and associates them with events depending on the callback signature. The first callback argument must be of a special key type determined by the event type.

Callbacks can be subscribed/unsubscribed based on a subscriber id, the event type, and the callback signature.

Events can be emitted based on event type and callback signature.

The event manager is thread-safe.

Types

template<typename E, typename ... Args>
using Signal = boost::signals2::signal<void(typename E::KeyType, Args...)>

No comment in the header yet.

Functions

template<typename E, typename... Args>
auto Subscribe(
    const std::string& subscriber,
    std::function<void(typename E::KeyType, Args...)> callback
) -> void

No comment in the header yet.

template<typename E, typename ... Args>
auto Unsubscribe(const std::string& subscriber) -> void

No comment in the header yet.

template<typename E, typename ... Args>
auto Emit(typename E::KeyType key, Args... args) const -> void

No comment in the header yet.