|
conduit 0.6.0
Modern C++23 header-only event-dispatching / event-transport library
|
Wrapper that gates events flowing through an inner transport on both legs. More...
#include <filtered_transport.hpp>


Public Types | |
| using | Predicate = std::function< bool(const EventEnvelopeView &)> |
Public Member Functions | |
| FilteredTransport (std::shared_ptr< Transport > inner, Predicate outbound={}, Predicate inbound={}) | |
| TransportScope | scope () const noexcept override |
| void | attach (Bus &bus) override |
| Attach to a bus. | |
| void | attach_with_sink (Bus &bus, InboundSink sink) override |
| Attach to a bus using a caller-supplied inbound sink. | |
| void | detach () noexcept override |
| void | dispatch (const EventEnvelopeView &v) override |
| void | flush () override |
| const std::shared_ptr< Transport > & | inner () const noexcept |
Public Member Functions inherited from conduit::Transport | |
| Transport ()=default | |
| Transport (const Transport &)=delete | |
| Transport (Transport &&) noexcept=default | |
| Transport & | operator= (const Transport &)=delete |
| Transport & | operator= (Transport &&) noexcept=default |
| ~Transport () override=default | |
Additional Inherited Members | |
Protected Member Functions inherited from conduit::Transport | |
| void | deliver_inbound (const EventEnvelopeView &v) const |
| Subclasses call this for inbound delivery instead of touching the bus directly. | |
| Bus * | bus () const noexcept |
Wrapper that gates events flowing through an inner transport on both legs.
The outbound predicate runs in dispatch() — false suppresses the publish. The inbound predicate runs on the sink installed at attach time — false suppresses delivery to the bus's listeners. Either predicate may be empty, meaning "pass everything." A predicate that throws is treated the same as one that returned false; the envelope is dropped.
scope(), detach(), and flush() simply forward to the inner transport — wrappers don't shift the local/remote scope or own broker connections.
| using conduit::FilteredTransport::Predicate = std::function<bool(const EventEnvelopeView&)> |
|
inlineexplicit |
|
inlineoverridevirtual |
Attach to a bus.
The base implementation builds an inbound sink that forwards to bus.deliver_to_listeners and delegates to attach_with_sink. Subclasses that need to do per-attach work (open connections, subscribe to topics) should override attach_with_sink.
Reimplemented from conduit::Transport.
|
inlineoverridevirtual |
Attach to a bus using a caller-supplied inbound sink.
Wrappers use this to intercept the inbound leg without each transport needing to re-implement the hook.
Reimplemented from conduit::Transport.
|
inlineoverridevirtualnoexcept |
Reimplemented from conduit::Transport.
|
inlineoverridevirtual |
Implements conduit::Transport.
|
inlineoverridevirtual |
Reimplemented from conduit::Transport.
|
inlinenoexcept |
|
inlineoverridevirtualnoexcept |
Implements conduit::Transport.