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-static.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 "sol-flow.h"
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
52 typedef struct sol_flow_static_node_spec {
53  const struct sol_flow_node_type *type;
54  const char *name;
55  const struct sol_flow_node_options *opts;
57 
61 typedef struct sol_flow_static_conn_spec {
62  uint16_t src;
63  uint16_t src_port;
64  uint16_t dst;
65  uint16_t dst_port;
67 
71 typedef struct sol_flow_static_port_spec {
72  uint16_t node;
73  uint16_t port;
75 
76 /* Use these guards as the last element of the spec arrays. */
77 
81 #define SOL_FLOW_STATIC_NODE_SPEC_GUARD { }
82 
86 #define SOL_FLOW_STATIC_CONN_SPEC_GUARD { .src = UINT16_MAX }
87 
91 #define SOL_FLOW_STATIC_PORT_SPEC_GUARD { .node = UINT16_MAX }
92 
93 
100 typedef struct sol_flow_static_spec {
101 #ifndef SOL_NO_API_VERSION
102 #define SOL_FLOW_STATIC_API_VERSION (1)
103  uint16_t api_version;
104 #endif
105  uint16_t flags;
106 
113 
121 
130 
139 
146  int (*child_opts_set)(const struct sol_flow_node_type *type,
147  uint16_t child_index,
148  const struct sol_flow_node_options *opts,
149  struct sol_flow_node_options *child_opts);
150 
157  void (*dispose)(const void *type_data);
159 
186 
197 struct sol_flow_node *sol_flow_static_get_node(struct sol_flow_node *node, uint16_t index);
198 
213  const struct sol_flow_static_spec *spec);
214 
219 #ifdef __cplusplus
220 }
221 #endif
const char * name
Name for the specific type's instance.
Definition: sol-flow-static.h:54
uint16_t flags
Definition: sol-flow-static.h:105
struct sol_flow_static_node_spec sol_flow_static_node_spec
Structure for the specification of a node.
uint16_t node
Node index.
Definition: sol-flow-static.h:72
uint16_t port
Port index.
Definition: sol-flow-static.h:73
struct sol_flow_node * sol_flow_static_get_node(struct sol_flow_node *node, uint16_t index)
Get a container node's children node by index.
const struct sol_flow_static_port_spec * exported_out
Array specifying which output ports from the flow are going to be exported by the static flow...
Definition: sol-flow-static.h:138
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 sol_flow_node
A node is an entity that has input/output ports.
Definition: sol-flow.h:71
uint16_t dst_port
Destination node port index.
Definition: sol-flow-static.h:65
struct sol_flow_node * sol_flow_static_new(struct sol_flow_node *parent, const struct sol_flow_static_node_spec nodes[], const struct sol_flow_static_conn_spec conns[])
Creates a new "static flow" node.
Specification of how a static flow should work.
Definition: sol-flow-static.h:100
struct sol_flow_static_conn_spec sol_flow_static_conn_spec
Structure for the specification of a connection.
The node type describes the capabilities and operations of a node.
Definition: sol-flow.h:796
int(* child_opts_set)(const struct sol_flow_node_type *type, uint16_t child_index, const struct sol_flow_node_options *opts, struct sol_flow_node_options *child_opts)
Function to allow the static flow control the options used to create its nodes.
Definition: sol-flow-static.h:146
uint16_t src
Source node index.
Definition: sol-flow-static.h:62
const struct sol_flow_node_type * type
Node type.
Definition: sol-flow-static.h:53
Structure for the specification of a node.
Definition: sol-flow-static.h:52
Structure for the specification of node ports.
Definition: sol-flow-static.h:71
const struct sol_flow_static_node_spec * nodes
Array specifying the node types that are used by the static flow.
Definition: sol-flow-static.h:112
const struct sol_flow_static_conn_spec * conns
Array specifying the connections between nodes in the static flow.
Definition: sol-flow-static.h:120
struct sol_flow_static_spec sol_flow_static_spec
Specification of how a static flow should work.
Structure for the specification of a connection.
Definition: sol-flow-static.h:61
uint16_t src_port
Source node port index.
Definition: sol-flow-static.h:63
These routines are used for Soletta flows manipulation.
void(* dispose)(const void *type_data)
Function called after the static type is disposed.
Definition: sol-flow-static.h:157
static struct sol_flow_static_node_spec nodes[]
Definition: lowlevel.c:71
static const struct sol_flow_static_conn_spec conns[]
Definition: lowlevel.c:92
struct sol_flow_static_port_spec sol_flow_static_port_spec
Structure for the specification of node ports.
uint16_t dst
Destination node index.
Definition: sol-flow-static.h:64
const struct sol_flow_static_port_spec * exported_in
Array specifying which input ports from the flow are going to be exported by the static flow...
Definition: sol-flow-static.h:129
const struct sol_flow_node_options * opts
Options for the specific type's instance.
Definition: sol-flow-static.h:55
struct sol_flow_node_type * sol_flow_static_new_type(const struct sol_flow_static_spec *spec)
Creates a new "static flow" (container) type.