|
| | Transport (Role role, Endpoint endpoint, nlohmann::json config) |
| | Constructs a transport instance.
|
| | DFX_DISABLE_COPY_AND_MOVE (Transport) |
| | Transport is not copiable nor movable.
|
| virtual | ~Transport ()=default |
| | Virtual destructor ensuring proper cleanup of derived transports.
|
| template<DerivedFromTransport T> |
| bool | is () const noexcept |
| | Check whether this transport is of a given derived type.
|
| template<DerivedFromTransport T> |
| T & | as () noexcept |
| | Cast this transport to a derived type (unchecked).
|
| template<DerivedFromTransport T> |
| T const & | as () const noexcept |
| | Cast this transport to a derived type (unchecked).
|
| virtual void | start (FdWatch::Poller &poller)=0 |
| | Activates the transport and begins I/O operations.
|
| virtual void | stop () noexcept=0 |
| | Deactivates the transport and releases system resources.
|
| Role | role () const noexcept |
| | Returns the Role (Source or Destination) of this transport.
|
| bool | isSource () const noexcept |
| | Returns true if this transport is a source.
|
| bool | isDestination () const noexcept |
| | Returns true if this transport is a destination.
|
| Endpoint const & | endpoint () const noexcept |
| | Gets the endpoint descriptor associated with this transport.
|
| Channel * | channel () const noexcept |
| | Gets the channel which this transport is attached to if any.
|
| Port * | port () const noexcept |
| | Gets the port associated with this transport.
|
| NodePtr | node () const noexcept |
| | Gets the node associated with this transport.
|
| nlohmann::json const & | config () const noexcept |
| | Gets the JSON configuration used to initialize this transport.
|
Abstract base class for all message carriers within the dfx framework.
A Transport encapsulates the physical or logical mechanism used to move data across a Channel. It abstracts the "how" of message delivery—whether via local memory copies, POSIX message queues, or network sockets—allowing the rest of the graph to remain transport-agnostic.
Lifecycle and Initialization
Transports are designed to decouple configuration from activation. This is critical for scenarios like graph validation or GUI editors where objects need to be inspected without opening live sockets or file descriptors.
- Construction: Validates the Endpoint and JSON configuration. No external resources (sockets, FDs) are acquired here.
- Attachment: The Transport is linked to a Channel during Channel construction.
- Start: Invoked during Node::start. This is where the transport joins the FdWatch::Poller and begins active I/O.
- Stop: Invoked during Node::stop. Closes resources and stops I/O.
Transport Roles
Every transport plays a specific Role :