conduit 0.6.0
Modern C++23 header-only event-dispatching / event-transport library
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
conduit::Transport Class Referenceabstract

#include <transport.hpp>

Inheritance diagram for conduit::Transport:
Inheritance graph
[legend]
Collaboration diagram for conduit::Transport:
Collaboration graph
[legend]

Public Member Functions

 Transport ()=default
 
 Transport (const Transport &)=delete
 
 Transport (Transport &&) noexcept=default
 
Transportoperator= (const Transport &)=delete
 
Transportoperator= (Transport &&) noexcept=default
 
 ~Transport () override=default
 
virtual TransportScope scope () const noexcept=0
 
virtual void attach (Bus &bus)
 Attach to a bus.
 
virtual void attach_with_sink (Bus &bus, InboundSink sink)
 Attach to a bus using a caller-supplied inbound sink.
 
virtual void detach () noexcept
 
virtual void dispatch (const EventEnvelopeView &)=0
 
virtual void flush ()
 

Protected Member Functions

void deliver_inbound (const EventEnvelopeView &v) const
 Subclasses call this for inbound delivery instead of touching the bus directly.
 
Busbus () const noexcept
 

Constructor & Destructor Documentation

◆ Transport() [1/3]

conduit::Transport::Transport ( )
default

◆ Transport() [2/3]

conduit::Transport::Transport ( const Transport )
delete

◆ Transport() [3/3]

conduit::Transport::Transport ( Transport &&  )
defaultnoexcept

◆ ~Transport()

conduit::Transport::~Transport ( )
overridedefault

Member Function Documentation

◆ attach()

void conduit::Transport::attach ( Bus bus)
inlinevirtual

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 in conduit::FilteredTransport.

◆ attach_with_sink()

virtual void conduit::Transport::attach_with_sink ( Bus bus,
InboundSink  sink 
)
inlinevirtual

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 in conduit::FilteredTransport, conduit::amqp::Transport, conduit::mqtt::Transport, conduit::nats::Transport, conduit::redis::Transport, and conduit::zmq::Transport.

◆ bus()

Bus * conduit::Transport::bus ( ) const
inlineprotectednoexcept

◆ deliver_inbound()

void conduit::Transport::deliver_inbound ( const EventEnvelopeView v) const
inlineprotected

Subclasses call this for inbound delivery instead of touching the bus directly.

The sink installed at attach time decides what happens next.

◆ detach()

virtual void conduit::Transport::detach ( )
inlinevirtualnoexcept

◆ dispatch()

virtual void conduit::Transport::dispatch ( const EventEnvelopeView )
pure virtual

◆ flush()

virtual void conduit::Transport::flush ( )
inlinevirtual

◆ operator=() [1/2]

Transport & conduit::Transport::operator= ( const Transport )
delete

◆ operator=() [2/2]

Transport & conduit::Transport::operator= ( Transport &&  )
defaultnoexcept

◆ scope()

virtual TransportScope conduit::Transport::scope ( ) const
pure virtualnoexcept

The documentation for this class was generated from the following files: