dfx 0.1.0
Linux-based dynamic dataflow executor
Loading...
Searching...
No Matches
dfx_transport_interface_t Struct Reference

The Transport Plugin Interface. More...

#include <dfx-plugins-interface/PluginInterface.h>

Public Attributes

void(* destroy )(dfx_transport_handle_t handle)
 Permanently destroys a transport and releases its memory.
Factory Methods
dfx_transport_handle_t(* build_source )(char const *scheme, char const *address, char const *node, char const *port, char const *config, dfx_on_message_received_t on_message_received, void *host_ctx)
 Creates a new Source transport instance.
dfx_transport_handle_t(* build_destination )(char const *scheme, char const *address, char const *node, char const *port, char const *config)
 Creates a new Destination transport instance.
Lifecycle Management
int(* start )(dfx_transport_handle_t handle, dfx_poller_api_t const *poller, size_t poller_size)
 Activates the transport.
void(* stop )(dfx_transport_handle_t handle)
 Deactivates the transport. Should unregister all FDs from the poller.
Data Operations
int(* transmit_message )(dfx_transport_handle_t handle, uint8_t const *message, size_t length)
 Sends a message using a Destination transport.
int64_t(* pending_message_count )(dfx_transport_handle_t handle)
 Returns the number of messages currently buffered in the transport.

Detailed Description

The Transport Plugin Interface.

Plugins must fill this struct when calling dfx_registration_api_t::register_transport All functions are required except specified otherwise.

Member Data Documentation

◆ build_destination

dfx_transport_handle_t(* dfx_transport_interface_t::build_destination) (char const *scheme, char const *address, char const *node, char const *port, char const *config)

Creates a new Destination transport instance.

Parameters
[in]schemeThe scheme part of the URI of this transport.
[in]addressThe address part of the URI of this transport.
[in]nodeThe node name associated with this transport.
[in]portThe port name associated with this transport.
[in]configAdditional transport configuration in JSON.
Returns
Opaque handle to the plugin's transport instance.
See also
dfx::Core::DestinationTransport

◆ build_source

dfx_transport_handle_t(* dfx_transport_interface_t::build_source) (char const *scheme, char const *address, char const *node, char const *port, char const *config, dfx_on_message_received_t on_message_received, void *host_ctx)

Creates a new Source transport instance.

Parameters
[in]schemeThe scheme part of the URI of this transport.
[in]addressThe address part of the URI of this transport.
[in]nodeThe node name associated with this transport.
[in]portThe port name associated with this transport.
[in]configAdditional transport configuration in JSON.
[in]on_message_receivedCallback to call when a new message is ready for the host.
[in]host_ctxContext to pass back to the callback.
Returns
Opaque handle to the plugin's transport instance.
See also
dfx::Core::SourceTransport

◆ destroy

void(* dfx_transport_interface_t::destroy) (dfx_transport_handle_t handle)

Permanently destroys a transport and releases its memory.

Parameters
[in]handleThe transport (either source or destination) to destroy.

◆ pending_message_count

int64_t(* dfx_transport_interface_t::pending_message_count) (dfx_transport_handle_t handle)

Returns the number of messages currently buffered in the transport.

This function is optional; if the plugin sets this pointer to NULL, the host will assume the count is unknown (-1).

Parameters
[in]handleThe queried destination transport.
Returns
The number of pending message or -1 if unknown.

◆ start

int(* dfx_transport_interface_t::start) (dfx_transport_handle_t handle, dfx_poller_api_t const *poller, size_t poller_size)

Activates the transport.

The poller pointer is only valid until the stop function returns.

Parameters
[in]handleThe transport (either source or destination) to start.
[in]pollerA vtable of event loop operations valid for the transport's lifetime.
[in]poller_sizeThe size of the poller vtable.
Returns
0 on success, any other value on failure.

◆ stop

void(* dfx_transport_interface_t::stop) (dfx_transport_handle_t handle)

Deactivates the transport. Should unregister all FDs from the poller.

Parameters
[in]handleThe transport (either source or destination) to stop.

◆ transmit_message

int(* dfx_transport_interface_t::transmit_message) (dfx_transport_handle_t handle, uint8_t const *message, size_t length)

Sends a message using a Destination transport.

Parameters
[in]handleThe destination transport used to send the message.
[in]messageA fully-formed packed message.
[in]lengthThe size of the message buffer.
Returns
0 on success, any other value on failure.

The documentation for this struct was generated from the following file: