![]() |
dfx 0.1.0
Linux-based dynamic dataflow executor
|
The vtable that a plugin must implement to define a Node. More...
#include <dfx-plugins-interface/PluginInterface.h>
Public Attributes | |
| dfx_node_handle_t(* | build )(char const *type, uint32_t id, char const *name, char const *config, dfx_node_api_t const *node_api, size_t node_api_size) |
| Instantiates a new node. | |
| void(* | destroy )(dfx_node_handle_t node) |
| Destroys the node instance and frees associated plugin memory. | |
| int(* | start )(dfx_node_handle_t node, dfx_poller_api_t const *poller, size_t poller_size) |
| Requests the node to start processing. | |
| void(* | stop )(dfx_node_handle_t node) |
| Requests the node to stop processing. | |
| int(* | on_message )(dfx_node_handle_t node, uint32_t port_id, dfx_message_api_t const *msg_api, size_t msg_api_size) |
| Called by the host when a message arrives on an input port. | |
The vtable that a plugin must implement to define a Node.
This defines how the host interacts with the plugin. Each function corresponds to a lifecycle stage or an event in the dataflow graph.
All functions are required except specified otherwise.
| dfx_node_handle_t(* dfx_node_interface_t::build) (char const *type, uint32_t id, char const *name, char const *config, dfx_node_api_t const *node_api, size_t node_api_size) |
Instantiates a new node.
The JSON configuration is already matched against the JSON schema provided during the node type registration if any.
| [in] | type | The registered node type string. |
| [in] | id | The unique instance ID within the graph. |
| [in] | name | The user-defined instance name. |
| [in] | config | JSON configuration string. |
| [in] | node_api | Pointer to host services for this instance. |
| [in] | node_api_size | Size of the dfx_node_api_t struct (for version checking). |
| void(* dfx_node_interface_t::destroy) (dfx_node_handle_t node) |
Destroys the node instance and frees associated plugin memory.
| [in] | node | The node handle returned by the build function. |
| int(* dfx_node_interface_t::on_message) (dfx_node_handle_t node, uint32_t port_id, dfx_message_api_t const *msg_api, size_t msg_api_size) |
Called by the host when a message arrives on an input port.
The handle provided in the msg_api is only valid for the duration of this function. Do not store and re-use it later.
| [in] | node | The node handle returned by the build function. |
| [in] | port_id | The ID assigned during port registration. |
| [in] | msg_api | API to interrogate the message handle. Valid only for the duration of this call. |
| [in] | msg_api_size | Size of the dfx_message_api_t struct. |
| int(* dfx_node_interface_t::start) (dfx_node_handle_t node, dfx_poller_api_t const *poller, size_t poller_size) |
Requests the node to start processing.
The poller parameter is valid only until dfx_node_api_t::notify_stopped is called.
| [in] | node | The node handle returned by the build function. |
| [in] | poller | API to register file descriptors for event-driven processing. |
| [in] | poller_size | Size of the dfx_poller_api_t struct. |
| void(* dfx_node_interface_t::stop) (dfx_node_handle_t node) |
Requests the node to stop processing.
This function is optional and dfx_node_api_t::notify_stopped is immediately called if it is not defined.
| [in] | node | The node handle returned by the build function. |