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 Structures | Typedefs | Functions

The Flow Parser is used to transform a textual description (either FBP or other metatypes) into node types that can be used in a flow. More...

Data Structures

struct  sol_flow_parser_client
 Flow Parser's client structure. More...
 

Typedefs

typedef struct sol_flow_parser sol_flow_parser
 Flow Parser handle. More...
 
typedef struct
sol_flow_parser_client 
sol_flow_parser_client
 Flow Parser's client structure. More...
 

Functions

struct sol_flow_node_typesol_flow_parse_buffer (struct sol_flow_parser *parser, const struct sol_buffer *buf, const char *filename)
 Parses a flow description contained in buf and returns the resulting node type. More...
 
struct sol_flow_node_typesol_flow_parse_buffer_metatype (struct sol_flow_parser *parser, const char *metatype, const struct sol_buffer *buf, const char *filename)
 Parsers a buf of a given metatype and returns the resulting node type. More...
 
struct sol_flow_node_typesol_flow_parse_string (struct sol_flow_parser *parser, const char *str, const char *filename)
 Similar to sol_flow_parse_buffer but accepts C string. More...
 
struct sol_flow_node_typesol_flow_parse_string_metatype (struct sol_flow_parser *parser, const char *metatype, const char *str, const char *filename)
 Similar to sol_flow_parse_buffer_metatype but accepts C string. More...
 
int sol_flow_parser_del (struct sol_flow_parser *parser)
 Destroy a sol_flow_parser instance. More...
 
struct sol_flow_parsersol_flow_parser_new (const struct sol_flow_parser_client *client, const struct sol_flow_resolver *resolver)
 Creates a new instance of sol_flow_parser. More...
 

Detailed Description

The Flow Parser is used to transform a textual description (either FBP or other metatypes) into node types that can be used in a flow.

The node types created are owned by the parser object, so the parser can only be deleted after all its types are not used anymore.

Typedef Documentation

Flow Parser handle.

Flow Parser's client structure.

Function Documentation

struct sol_flow_node_type* sol_flow_parse_buffer ( struct sol_flow_parser parser,
const struct sol_buffer buf,
const char *  filename 
)

Parses a flow description contained in buf and returns the resulting node type.

Parameters
parserThe Flow Parser handle
bufFlow description to be parsed. The buffer will be initialized in this function.
filenameName of the file which content is in buf
Returns
Resulting node type of the parsed FBP on success, NULL otherwise.
struct sol_flow_node_type* sol_flow_parse_buffer_metatype ( struct sol_flow_parser parser,
const char *  metatype,
const struct sol_buffer buf,
const char *  filename 
)

Parsers a buf of a given metatype and returns the resulting node type.

Parameters
parserThe Flow Parser handle
metatypeContent's type (e.g. "fbp", or "js")
bufContent to be parsed
filenameName of the file which content is in buf
Returns
Resulting node type of the parsed FBP on success, NULL otherwise.
struct sol_flow_node_type* sol_flow_parse_string ( struct sol_flow_parser parser,
const char *  str,
const char *  filename 
)

Similar to sol_flow_parse_buffer but accepts C string.

It will calculate the size of str and call sol_flow_parse_buffer with the equivalent parameters.

Parameters
parserThe Flow Parser handle
strFlow description to be parsed
filenameName of the file which content is in str
Returns
Resulting node type of the parsed FBP on success, NULL otherwise.
struct sol_flow_node_type* sol_flow_parse_string_metatype ( struct sol_flow_parser parser,
const char *  metatype,
const char *  str,
const char *  filename 
)

Similar to sol_flow_parse_buffer_metatype but accepts C string.

It will calculate the size of str and call sol_flow_parse_buffer with the equivalent parameters.

Parameters
parserThe Flow Parser handle
metatypeContent's type (e.g. "fbp", or "js")
strContent to be parsed
filenameName of the file which content is in str
Returns
Resulting node type of the parsed FBP on success, NULL otherwise.
int sol_flow_parser_del ( struct sol_flow_parser parser)

Destroy a sol_flow_parser instance.

Parameters
parserFlow parser to be destroyed
Returns
0 on success, error code (always negative) otherwise
struct sol_flow_parser* sol_flow_parser_new ( const struct sol_flow_parser_client client,
const struct sol_flow_resolver resolver 
)

Creates a new instance of sol_flow_parser.

Parameters
clientParser's client
resolverResolver to be used
Note
Passing NULL to resolver will set the default resolver.
Returns
A new Flow Parser instance, NULL on error.