![]() |
dfx 0.1.0
Linux-based dynamic dataflow executor
|
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. | |
The Transport Plugin Interface.
Plugins must fill this struct when calling dfx_registration_api_t::register_transport All functions are required except specified otherwise.
| 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.
| [in] | scheme | The scheme part of the URI of this transport. |
| [in] | address | The address part of the URI of this transport. |
| [in] | node | The node name associated with this transport. |
| [in] | port | The port name associated with this transport. |
| [in] | config | Additional transport configuration in JSON. |
| 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.
| [in] | scheme | The scheme part of the URI of this transport. |
| [in] | address | The address part of the URI of this transport. |
| [in] | node | The node name associated with this transport. |
| [in] | port | The port name associated with this transport. |
| [in] | config | Additional transport configuration in JSON. |
| [in] | on_message_received | Callback to call when a new message is ready for the host. |
| [in] | host_ctx | Context to pass back to the callback. |
| void(* dfx_transport_interface_t::destroy) (dfx_transport_handle_t handle) |
Permanently destroys a transport and releases its memory.
| [in] | handle | The transport (either source or destination) to destroy. |
| 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).
| [in] | handle | The queried destination transport. |
| 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.
| [in] | handle | The transport (either source or destination) to start. |
| [in] | poller | A vtable of event loop operations valid for the transport's lifetime. |
| [in] | poller_size | The size of the poller vtable. |
| void(* dfx_transport_interface_t::stop) (dfx_transport_handle_t handle) |
Deactivates the transport. Should unregister all FDs from the poller.
| [in] | handle | The transport (either source or destination) to stop. |
| 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.
| [in] | handle | The destination transport used to send the message. |
| [in] | message | A fully-formed packed message. |
| [in] | length | The size of the message buffer. |