A synchronous, in-process source transport.
More...
#include <dfx-core/transports/sources/LocalSource.hpp>
|
| bool | send (MessagePtr message) |
| | Synchronously pushes a message into the channel.
|
| void | start (FdWatch::Poller &) override |
| | Activates the transport and begins I/O operations.
|
| void | stop () noexcept override |
| | Deactivates the transport and releases system resources.
|
| | SourceTransport (Endpoint endpoint, nlohmann::json config) |
| | Constructs a SourceTransport with the Role::Source role.
|
| | SourceTransport (Endpoint endpoint, nlohmann::json config) |
| | Constructs a SourceTransport with the Role::Source role.
|
| | 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).
|
| 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.
|
A synchronous, in-process source transport.
LocalSource is used by OutputPort to send messages to a Channel within the same process. It acts as a direct pass-through, converting a method call into a channel transmission without intermediate buffering or context switching.
- Note
- This transport has no asynchronous components and therefore start() and stop() are no-ops.
◆ send()
| bool dfx::Core::LocalSource::send |
( |
MessagePtr | message | ) |
|
|
inline |
Synchronously pushes a message into the channel.
This is the primary entry point used by OutputPort::sendMessage.
- Parameters
-
| message | The message pointer to transmit. |
- Returns
true if the message was accepted by the channel.
◆ SourceTransport()
| dfx::Core::SourceTransport::SourceTransport |
( |
Endpoint | endpoint, |
|
|
nlohmann::json | config ) |
|
inline |
Constructs a SourceTransport with the Role::Source role.
- Parameters
-
| endpoint | The originating endpoint descriptor. |
| config | Additional JSON configuration specific to this transport instance. |
◆ start()
Activates the transport and begins I/O operations.
- Parameters
-
| poller | The event loop poller used to watch File Descriptors. |
Implements dfx::Core::Transport.
◆ stop()
| void dfx::Core::LocalSource::stop |
( |
| ) |
|
|
inlineoverridevirtualnoexcept |
The documentation for this class was generated from the following file: