Soletta™ Framework
|
Static flow is a parent node that creates its children nodes and routes packets between them. More...
Data Structures | |
struct | sol_flow_static_conn_spec |
Structure for the specification of a connection. More... | |
struct | sol_flow_static_node_spec |
Structure for the specification of a node. More... | |
struct | sol_flow_static_port_spec |
Structure for the specification of node ports. More... | |
struct | sol_flow_static_spec |
Specification of how a static flow should work. More... | |
Macros | |
#define | SOL_FLOW_STATIC_CONN_SPEC_GUARD { .src = UINT16_MAX } |
Guard element of the connections spec array. More... | |
#define | SOL_FLOW_STATIC_NODE_SPEC_GUARD { } |
Guard element of the nodes spec array. More... | |
#define | SOL_FLOW_STATIC_PORT_SPEC_GUARD { .node = UINT16_MAX } |
Guard element of the ports spec array. More... | |
Typedefs | |
typedef struct sol_flow_static_conn_spec | sol_flow_static_conn_spec |
Structure for the specification of a connection. More... | |
typedef struct sol_flow_static_node_spec | sol_flow_static_node_spec |
Structure for the specification of a node. More... | |
typedef struct sol_flow_static_port_spec | sol_flow_static_port_spec |
Structure for the specification of node ports. More... | |
typedef struct sol_flow_static_spec | sol_flow_static_spec |
Specification of how a static flow should work. More... | |
Functions | |
struct sol_flow_node * | sol_flow_static_get_node (struct sol_flow_node *node, uint16_t index) |
Get a container node's children node by index. More... | |
struct sol_flow_node * | sol_flow_static_new (struct sol_flow_node *parent, const struct sol_flow_static_node_spec nodes[], const struct sol_flow_static_conn_spec conns[]) |
Creates a new "static flow" node. More... | |
struct sol_flow_node_type * | sol_flow_static_new_type (const struct sol_flow_static_spec *spec) |
Creates a new "static flow" (container) type. More... | |
Static flow is a parent node that creates its children nodes and routes packets between them.
It follows an specification received upon creation. The configuration
of the flow (connections made) will not change at runtime – thus the name static.
The specification consists in two arrays: one indicating each node type, and the other indicating each connection as a sequence of (source node, source port, destination node, destination port) tuples.
The connection specification is used to dispatch connections when messages are sent. This approach provides a very low memory overhead but still perfomant way to route the packets.
#define SOL_FLOW_STATIC_CONN_SPEC_GUARD { .src = UINT16_MAX } |
Guard element of the connections spec array.
#define SOL_FLOW_STATIC_NODE_SPEC_GUARD { } |
Guard element of the nodes spec array.
#define SOL_FLOW_STATIC_PORT_SPEC_GUARD { .node = UINT16_MAX } |
Guard element of the ports spec array.
typedef struct sol_flow_static_conn_spec sol_flow_static_conn_spec |
Structure for the specification of a connection.
typedef struct sol_flow_static_node_spec sol_flow_static_node_spec |
Structure for the specification of a node.
typedef struct sol_flow_static_port_spec sol_flow_static_port_spec |
Structure for the specification of node ports.
typedef struct sol_flow_static_spec sol_flow_static_spec |
Specification of how a static flow should work.
struct sol_flow_node* sol_flow_static_get_node | ( | struct sol_flow_node * | node, |
uint16_t | index | ||
) |
Get a container node's children node by index.
node | The node to get the child node from |
index | The index of the child node in node (position in the sol_flow_static_node_spec array) |
NULL
, on errors. struct sol_flow_node* sol_flow_static_new | ( | struct sol_flow_node * | parent, |
const struct sol_flow_static_node_spec | nodes[], | ||
const struct sol_flow_static_conn_spec | conns[] | ||
) |
Creates a new "static flow" node.
Nodes should be created in the sol_main_callbacks::startup function, and at least the root one must be a "static flow" node. This function will create one of those "by hand", if all the child nodes and connections are provided.
parent | The parent node. Pass NULL if you're creating the root node of the flow. |
nodes | A SOL_FLOW_STATIC_PORT_SPEC_GUARD terminated array of node specification structs |
conns | A SOL_FLOW_STATIC_CONN_SPEC_GUARD terminated array of port connections of the nodes declared in nodes. This array must be sorted by node index and port indexes. |
For a higher level construct to get your root static flow node, consider using sol_flow_builder_new() family of functions.
NULL
. Referenced by startup().
struct sol_flow_node_type* sol_flow_static_new_type | ( | const struct sol_flow_static_spec * | spec | ) |
Creates a new "static flow" (container) type.
This allows one to create a static flow type "by hand" and fine- tune it. Exported input/output ports may be declared, as well as options forwarding.
spec | A specification of the type to be created. The data inside the spec is assumed to still be valid until the type is deleted. |
NULL
.