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
sol-flow-builder.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Soletta (TM) Project
3  *
4  * Copyright (C) 2015 Intel Corporation. All rights reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 
19 #pragma once
20 
21 #include <stdbool.h>
22 
23 #include "sol-flow.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
58 struct sol_flow_builder;
60 
70 
79 
88 void sol_flow_builder_set_resolver(struct sol_flow_builder *builder, const struct sol_flow_resolver *resolver);
89 
107 int sol_flow_builder_set_type_description(struct sol_flow_builder *builder, const char *name, const char *category, const char *description, const char *author, const char *url, const char *license, const char *version);
108 
123 int sol_flow_builder_add_node(struct sol_flow_builder *builder, const char *name, const struct sol_flow_node_type *type, const struct sol_flow_node_options *option);
124 
142 int sol_flow_builder_add_node_by_type(struct sol_flow_builder *builder, const char *name, const char *type_name, const char *const *options_strv);
143 
167 int sol_flow_builder_connect(struct sol_flow_builder *builder, const char *src_name, const char *src_port_name, int src_port_idx, const char *dst_name, const char *dst_port_name, int dst_port_idx);
168 
186 int sol_flow_builder_connect_by_index(struct sol_flow_builder *builder, const char *src_name, uint16_t src_port_index, const char *dst_name, uint16_t dst_port_index);
187 
204 int sol_flow_builder_export_port_in(struct sol_flow_builder *builder, const char *node_name, const char *port_name, int port_idx, const char *exported_name);
205 
222 int sol_flow_builder_export_port_out(struct sol_flow_builder *builder, const char *node_name, const char *port_name, int port_idx, const char *exported_name);
223 
237 int sol_flow_builder_export_option(struct sol_flow_builder *builder, const char *node_name, const char *option_name, const char *exported_name);
238 
252 
257 #ifdef __cplusplus
258 }
259 #endif
int sol_flow_builder_add_node(struct sol_flow_builder *builder, const char *name, const struct sol_flow_node_type *type, const struct sol_flow_node_options *option)
Add a node to the nodes spec of the resulting flow.
static struct sol_flow_builder * builder
Definition: simple-c-type.c:44
int sol_flow_builder_export_port_in(struct sol_flow_builder *builder, const char *node_name, const char *port_name, int port_idx, const char *exported_name)
Exports an input port of a node using exported_name as identifier.
int sol_flow_builder_connect(struct sol_flow_builder *builder, const char *src_name, const char *src_port_name, int src_port_idx, const char *dst_name, const char *dst_port_name, int dst_port_idx)
Add a connection (via port names) to the conn spec of the resulting flow.
int sol_flow_builder_export_port_out(struct sol_flow_builder *builder, const char *node_name, const char *port_name, int port_idx, const char *exported_name)
Exports an output port of a node using exported_name as identifier.
Node options are a set of attributes defined by the Node Type that can change the behavior of a Node...
Definition: sol-flow.h:552
struct sol_flow_node_type * sol_flow_builder_get_node_type(struct sol_flow_builder *builder)
Returns the node type generated by the builder.
struct sol_flow_builder sol_flow_builder
Builder's handle.
Definition: sol-flow-builder.h:59
Resolver's structure.
Definition: sol-flow-resolver.h:54
The node type describes the capabilities and operations of a node.
Definition: sol-flow.h:796
int sol_flow_builder_connect_by_index(struct sol_flow_builder *builder, const char *src_name, uint16_t src_port_index, const char *dst_name, uint16_t dst_port_index)
Add a connection to the conn spec of the resulting flow.
int sol_flow_builder_add_node_by_type(struct sol_flow_builder *builder, const char *name, const char *type_name, const char *const *options_strv)
Add a node (via its type's name) to the nodes spec of the resulting flow.
int sol_flow_builder_del(struct sol_flow_builder *builder)
Destroy a sol_flow_builder instance.
int sol_flow_builder_export_option(struct sol_flow_builder *builder, const char *node_name, const char *option_name, const char *exported_name)
Exports an given option of a node using exported_name as identifier.
int sol_flow_builder_set_type_description(struct sol_flow_builder *builder, const char *name, const char *category, const char *description, const char *author, const char *url, const char *license, const char *version)
Set the type description to be used by the builder.
struct sol_flow_builder * sol_flow_builder_new(void)
Creates a new instance of a sol_flow_builder.
These routines are used for Soletta flows manipulation.
void sol_flow_builder_set_resolver(struct sol_flow_builder *builder, const struct sol_flow_resolver *resolver)
Set the Resolver to be used by the builder's resulting flow.