Soletta™ Framework
|
Structure for the specification of a single node. More...
#include <sol-flow-single.h>
Data Fields | |
struct sol_flow_node_options | base |
base guarantees sol_flow_node_options compatibility. More... | |
const uint16_t * | connected_ports_in |
indexes of input ports that should be connected. More... | |
const uint16_t * | connected_ports_out |
indexes of output ports that should be connected. More... | |
const struct sol_flow_node_options * | options |
options to give to the actual base type. More... | |
void(* | process )(void *user_data, struct sol_flow_node *node, uint16_t port, const struct sol_flow_packet *packet) |
callback to deliver outgoing packets. More... | |
const void * | user_data |
user data to give to callback process() . More... | |
Structure for the specification of a single node.
This option is used to instatiate a single-node that wrappes an inner node of a given type specified at sol_flow_single_new_type().
It is used internally by sol_flow_single_new() or explicitly by those calling sol_flow_new() manually.
It contains a struct sol_flow_node_options header (base
) so it conforms to the options protocol. Be sure to fill its api_version
with SOL_FLOW_NODE_OPTIONS_API_VERSION and sub_api
with SOL_FLOW_SINGLE_OPTIONS_API_VERSION, or use SOL_FLOW_SINGLE_OPTIONS_DEFAULTS() to help you.
struct sol_flow_node_options sol_flow_single_options::base |
base guarantees sol_flow_node_options compatibility.
its sub_api must be set to SOL_FLOW_SINGLE_OPTIONS_API_VERSION.
const uint16_t* sol_flow_single_options::connected_ports_in |
indexes of input ports that should be connected.
If non-NULL, must be an array terminated with UINT16_MAX
. See SOL_FLOW_SINGLE_CONNECTIONS().
const uint16_t* sol_flow_single_options::connected_ports_out |
indexes of output ports that should be connected.
If non-NULL, must be an array terminated with UINT16_MAX
. See SOL_FLOW_SINGLE_CONNECTIONS().
process()
. Then it is mandatory to connect to ports one wants to receive packets, but this is not checked due performance reasons. const struct sol_flow_node_options* sol_flow_single_options::options |
options to give to the actual base type.
If thie single node type wraps SOL_FLOW_NODE_TYPE_CONSOLE, then the options member should be of that sub_api and will be passed to SOL_FLOW_NODE_TYPE_CONSOLE->open()
.
void(* sol_flow_single_options::process)(void *user_data, struct sol_flow_node *node, uint16_t port, const struct sol_flow_packet *packet) |
callback to deliver outgoing packets.
If non-NULL, this callback is used to deliver packets produced by the base node, with the first parameter user_data
being the sibling member of the same name, node
being the wrapper single node (not the actual instance to avoid miscommunications), port
is the index of producing output port and packet
is the produced packet to be delivered, it will be automatically deleted after this function returns, so don't keep a reference to it.
If NULL, the packet is dropped.
connected_ports_out
. const void* sol_flow_single_options::user_data |
user data to give to callback process()
.