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

A Resolver matches type names to an actual node_type and possibly a companion options. More...

Data Structures

struct  sol_flow_resolver
 Resolver's structure. More...
 

Typedefs

typedef struct sol_flow_resolver sol_flow_resolver
 Resolver's structure. More...
 

Functions

const struct sol_flow_resolversol_flow_get_builtins_resolver (void)
 Resolver for built-in node types. More...
 
const struct sol_flow_resolversol_flow_get_default_resolver (void)
 The default resolver set at compile time. More...
 
int sol_flow_resolve (const struct sol_flow_resolver *resolver, const char *id, const struct sol_flow_node_type **type, struct sol_flow_node_named_options *named_opts)
 Function used to resolve id into a node type. More...
 

Detailed Description

A Resolver matches type names to an actual node_type and possibly a companion options.

Typically, it would match type names directly, but other uses exist, e.g. a resolver could match IDs from a configuration file to concrete types.

It's possible to have different Resolvers by using different heuristics to implement the revolve callback.

Typedef Documentation

Resolver's structure.

Function Documentation

const struct sol_flow_resolver* sol_flow_get_builtins_resolver ( void  )

Resolver for built-in node types.

A Resolver implementation that interprets IDs as node type names and return the appropriate built-in node type.

Examples:
/src/samples/flow/c-api/find-type.c.

Referenced by show_resolved_type().

const struct sol_flow_resolver* sol_flow_get_default_resolver ( void  )

The default resolver set at compile time.

int sol_flow_resolve ( const struct sol_flow_resolver resolver,
const char *  id,
const struct sol_flow_node_type **  type,
struct sol_flow_node_named_options named_opts 
)

Function used to resolve id into a node type.

It uses resolver to translate id into a node type (returned in type) and its options if available after resolution.

When resolver is NULL, the default resolver is used.

sol_flow_node_named_options_fini() must be used to delete members in case of success.

Parameters
resolverThe resolver to be used to solve this id.
idId to be resolved
typeThe node type for id if success, NULL otherwise
named_optsOptions for the resolved node type if available, NULL otherwise
Returns
0 in case of success, error code (always negative) otherwise
Examples:
/src/samples/flow/c-api/find-type.c.

Referenced by show_resolved_type().