|
conduit 0.6.0
Modern C++23 header-only event-dispatching / event-transport library
|
#include <bus.hpp>


Public Member Functions | |
| Bus () | |
| Bus (std::shared_ptr< EventRegistry > registry) | |
| ~Bus () override | |
| Bus (const Bus &)=delete | |
| Bus & | operator= (const Bus &)=delete |
| Bus (Bus &&)=delete | |
| Bus & | operator= (Bus &&)=delete |
| template<typename Tp , typename... Args> | |
| Tp & | use_transport (Args &&... args) |
| void | use_transport (std::shared_ptr< Transport > t) |
| template<typename M , typename... Args> | |
| M & | use_middleware (Args &&... args) |
| void | use_middleware (std::shared_ptr< Middleware > m) |
| const std::shared_ptr< EventRegistry > & | registry () const noexcept |
| Shared registry handle. | |
| template<typename T > | |
| void | register_event () |
Register an event type T with the bus's event registry. | |
| template<typename T , typename F > | |
| Subscription | listen (F &&handler, int priority=comms::Prioritized::DEFAULT_PRIORITY) |
Typed listener; the handler is called with const EventEnvelope& or const T&, or a shared_ptr<EventListener<T>>. | |
| template<typename T > | |
| Subscription | listen (std::shared_ptr< EventListener< T > > listener) |
| template<typename F > | |
| Subscription | listen (const std::string_view pattern, F &&handler, const int priority=comms::Prioritized::DEFAULT_PRIORITY) |
| Runtime listener by exact name or glob pattern. | |
| void | register_subscriber (EventSubscriber &s) |
| void | publish (const EventEnvelope &env) |
| template<typename T > | |
| void | publish (EventBuilder< T > &&b) |
| template<typename T > | |
| void | publish (EventBuilder< T > &b) |
| template<typename T > | |
| auto | publish (T payload) -> void requires(std::is_base_of_v< parcel::ICell, T >) |
| void | drain () const |
| void | shutdown () noexcept |
| void | deliver_to_listeners (const EventEnvelope &v) const |
| Called by transports (e.g. | |
| void | report_transport_error (const std::string_view transport, const std::exception_ptr &ep) const noexcept |
| Surface a transport-level failure (e.g. | |
| void | release (const detail::SubscriptionId id) noexcept override |
| SubscriptionBackref hook. | |
Public Member Functions inherited from conduit::detail::SubscriptionBackref | |
| SubscriptionBackref ()=default | |
| SubscriptionBackref (const SubscriptionBackref &)=default | |
| SubscriptionBackref (SubscriptionBackref &&) noexcept=default | |
| SubscriptionBackref & | operator= (const SubscriptionBackref &)=default |
| SubscriptionBackref & | operator= (SubscriptionBackref &&) noexcept=default |
| virtual | ~SubscriptionBackref ()=default |
|
inline |
|
inlineexplicit |
|
inlineoverride |
|
delete |
|
delete |
|
inline |
Called by transports (e.g.
local::Transport) to perform the actual listener fan-out for an envelope. Public so transports can invoke it after scheduling onto their own executor.
|
inline |
|
inline |
Runtime listener by exact name or glob pattern.
|
inline |
Typed listener; the handler is called with const EventEnvelope& or const T&, or a shared_ptr<EventListener<T>>.
When the handler is a pointer-like to a comms::Prioritized and the caller does not pass an explicit priority, the priority is inherited from the handler.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Register an event type T with the bus's event registry.
listen<T> and typed publish<T> overloads call this implicitly, so most callers never invoke it directly — it's exposed for pattern-only listeners that still want a known type's descriptor registered up front.
|
inline |
|
inlinenoexcept |
Shared registry handle.
Transports that need to decode envelopes off the wire (MQTT, future brokered transports) share this same instance unless given their own at construction time.
|
inlineoverridevirtualnoexcept |
SubscriptionBackref hook.
Implements conduit::detail::SubscriptionBackref.
|
inlinenoexcept |
Surface a transport-level failure (e.g.
an inbound message that failed to decode) through the middleware pipeline. Called by transport adapters from their inbound paths; user code rarely invokes this directly.
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inline |