Soletta™ Framework
Framework for making IoT devices

Full online documentation | C API Index
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Fields
sol_flow_metatype_context Struct Reference

Meta type context. More...

#include <sol-flow-metatype.h>

Data Fields

struct sol_str_slice contents
 Parameters for the metatype that is being created. More...
 
struct sol_str_slice name
 The node name that is being created. More...
 
int(* read_file )(const struct sol_flow_metatype_context *ctx, const char *name, struct sol_buffer *buf)
 Opens a file for the meta type. More...
 
int(* store_type )(const struct sol_flow_metatype_context *ctx, struct sol_flow_node_type *type)
 Stores the meta type in the Soletta infrastructure. More...
 

Detailed Description

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.

Field Documentation

struct sol_str_slice sol_flow_metatype_context::contents

Parameters for the metatype that is being created.

struct sol_str_slice sol_flow_metatype_context::name

The node name that is being created.

int(* sol_flow_metatype_context::read_file)(const struct sol_flow_metatype_context *ctx, const char *name, struct sol_buffer *buf)

Opens a file for the meta type.

Parameters
ctxThe metatype context.
nameThe file path.
bufWhere the file contents should be stored. The buffer will be initiliazed inside the function.
Returns
0 on success, negative value on failure.
int(* sol_flow_metatype_context::store_type)(const struct sol_flow_metatype_context *ctx, struct sol_flow_node_type *type)

Stores the meta type in the Soletta infrastructure.

Any node types produced by the creator function should be stored using this function, it takes ownership of the type. This means that one does not need to worry about freeing the node, because Soletta will do that for one.

Parameters
ctxThe metatype context.
typeThe type to be stored.
Returns
0 on success, negative value on failure.

The documentation for this struct was generated from the following file: