Soletta™ Framework
|
These routines are used to manipulate the flow meta types. More...
Data Structures | |
struct | sol_flow_metatype |
Struct that describes a meta type. More... | |
struct | sol_flow_metatype_context |
Meta type context. More... | |
struct | sol_flow_metatype_option_description |
Struct that describes the meta type options. More... | |
struct | sol_flow_metatype_port_description |
Struct that describes the meta type ports. More... | |
Macros | |
#define | SOL_FLOW_METATYPE(_NAME, decl...) |
Exports a meta type. More... | |
#define | SOL_FLOW_METATYPE_API_VERSION (1) |
Defines the current version of the meta type API. More... | |
Typedefs | |
typedef struct sol_flow_metatype | sol_flow_metatype |
Struct that describes a meta type. More... | |
typedef struct sol_flow_metatype_context | sol_flow_metatype_context |
Meta type context. More... | |
typedef int(* | sol_flow_metatype_create_type_func )(const struct sol_flow_metatype_context *ctx, struct sol_flow_node_type **type) |
A callback used to create the meta type itself. More... | |
typedef int(* | sol_flow_metatype_generate_code_func )(const struct sol_flow_metatype_context *ctx, struct sol_buffer *out) |
A callback used by sol-fbp-generator to generate the meta type C code. More... | |
typedef struct sol_flow_metatype_option_description | sol_flow_metatype_option_description |
Struct that describes the meta type options. More... | |
typedef int(* | sol_flow_metatype_options_description_func )(struct sol_vector *opts) |
A callback used create the options description of a meta type. More... | |
typedef struct sol_flow_metatype_port_description | sol_flow_metatype_port_description |
Struct that describes the meta type ports. More... | |
typedef int(* | sol_flow_metatype_ports_description_func )(const struct sol_flow_metatype_context *ctx, struct sol_vector *in, struct sol_vector *out) |
A callback used create the port description of a meta type. More... | |
Functions | |
sol_flow_metatype_generate_code_func | sol_flow_metatype_get_generate_code_end_func (const struct sol_str_slice name) |
Searchs for the callback that generates the end code of a given meta type. More... | |
sol_flow_metatype_generate_code_func | sol_flow_metatype_get_generate_code_start_func (const struct sol_str_slice name) |
Searchs for the callback that generates the start code of a given meta type. More... | |
sol_flow_metatype_generate_code_func | sol_flow_metatype_get_generate_code_type_func (const struct sol_str_slice name) |
Searchs for the callback that generates the body code of a given meta type. More... | |
sol_flow_metatype_options_description_func | sol_flow_metatype_get_options_description_func (const struct sol_str_slice name) |
Searchs for callback that describes the options of a given meta type. More... | |
const char * | sol_flow_metatype_get_options_symbol (const struct sol_str_slice name) |
Searchs for the metatype options symbol. More... | |
sol_flow_metatype_ports_description_func | sol_flow_metatype_get_ports_description_func (const struct sol_str_slice name) |
Searchs for callback that describes the ports of a given meta type. More... | |
These routines are used to manipulate the flow meta types.
Meta type nodes are nodes that are created on-the-fly. This means that there is no json file describing what are the node ports, open/close functions, private data and etc.
One usually needs to create a meta type node for two reasons:
To use a meta type using flow, one must declare it using the DECLARE keyword, take a look in the example.
The first part of the declare statement is responsible for identifying what will be the node type in the flow code, the second part is the name of the meta type that is going to be created and the last part are the arguments for the meta type.
As a concrete example, the code below creates a composed meta type.
The example above, uses the Soletta's composed-new meta type. This meta type is responsible for grouping various packet types and output them as one single packet with all the input values.
#define SOL_FLOW_METATYPE | ( | _NAME, | |
decl... | |||
) |
Exports a meta type.
This macro should be used to declare a meta type, making it visible to Soletta.
_NAME | The meta type name. This name will be appended to the sol_flow_metatype variable name. |
decl | The meta type declarations. |
Example:
#define SOL_FLOW_METATYPE_API_VERSION (1) |
Defines the current version of the meta type API.
typedef struct sol_flow_metatype sol_flow_metatype |
Struct that describes a meta type.
This structs is used to declare a meta type, it contains the create type, code generation, port description functions and the name of the meta type.
typedef struct sol_flow_metatype_context sol_flow_metatype_context |
Meta type context.
This is used when the meta type is being created or its code is being generated. It contains useful information like the the node name, the parameters for the meta type and some helper functions.
typedef int(* sol_flow_metatype_create_type_func)(const struct sol_flow_metatype_context *ctx, struct sol_flow_node_type **type) |
A callback used to create the meta type itself.
This function is used to create a meta type, this means that this function must setup the node properties, ports and etc.
ctx | The meta type context. |
type | The meta type node that shall be used by Soletta. |
typedef int(* sol_flow_metatype_generate_code_func)(const struct sol_flow_metatype_context *ctx, struct sol_buffer *out) |
A callback used by sol-fbp-generator to generate the meta type C code.
This function is called by sol-fbp-generator in order generate the meta type code to be compiled. The code generation is divded in three steps:
The code generation functions are set using the struct sol_flow_metatype during the meta type definition.
ctx | The meta type context. |
out | A buffer where the meta type should append its code. |
Struct that describes the meta type options.
This struct is used by the sol_fbp_generator in order to check if the node options are correct. The sol-fbp-generator will call sol_flow_metatype_options_description_func() callback in order to obtain an array of options description.
typedef int(* sol_flow_metatype_options_description_func)(struct sol_vector *opts) |
A callback used create the options description of a meta type.
One must add sol_flow_metatype_option_description
elements in the given vector.
opts | Where the options descriptions should be inserted. |
Struct that describes the meta type ports.
This struct is used by the sol_fbp_generator in order to check if the node connections are valid. The sol-fbp-generator will call sol_flow_metatype_ports_description_func() callback in order to obtain an array of input and output ports description.
typedef int(* sol_flow_metatype_ports_description_func)(const struct sol_flow_metatype_context *ctx, struct sol_vector *in, struct sol_vector *out) |
A callback used create the port description of a meta type.
ctx | The meta type context. |
in | Where the input port descriptions should be inserted. |
out | Where the output port descriptions should be inserted. |
sol_flow_metatype_generate_code_func sol_flow_metatype_get_generate_code_end_func | ( | const struct sol_str_slice | name | ) |
Searchs for the callback that generates the end code of a given meta type.
name | The meta type name |
NULL
if not found. sol_flow_metatype_generate_code_func sol_flow_metatype_get_generate_code_start_func | ( | const struct sol_str_slice | name | ) |
Searchs for the callback that generates the start code of a given meta type.
name | The meta type name. |
NULL
if not found. sol_flow_metatype_generate_code_func sol_flow_metatype_get_generate_code_type_func | ( | const struct sol_str_slice | name | ) |
Searchs for the callback that generates the body code of a given meta type.
name | The meta type name. |
NULL
if not found. sol_flow_metatype_options_description_func sol_flow_metatype_get_options_description_func | ( | const struct sol_str_slice | name | ) |
Searchs for callback that describes the options of a given meta type.
name | The meta type name. |
NULL
if not found. const char* sol_flow_metatype_get_options_symbol | ( | const struct sol_str_slice | name | ) |
Searchs for the metatype options symbol.
name | The meta type name. |
NULL
if not found. sol_flow_metatype_ports_description_func sol_flow_metatype_get_ports_description_func | ( | const struct sol_str_slice | name | ) |
Searchs for callback that describes the ports of a given meta type.
name | The meta type name. |
NULL
if not found.