lib: fully configure graph (add components, connect ports), then run
[deliverable/babeltrace.git] / include / babeltrace / graph / component-class-filter.h
CommitLineData
1ca80abd
PP
1#ifndef BABELTRACE_GRAPH_COMPONENT_CLASS_FILTER_H
2#define BABELTRACE_GRAPH_COMPONENT_CLASS_FILTER_H
d3e4dcd8
PP
3
4/*
0554db57 5 * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
d3e4dcd8
PP
6 * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files (the "Software"), to deal
10 * in the Software without restriction, including without limitation the rights
11 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 * copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 * SOFTWARE.
25 */
26
96ffdc46
PP
27#include <stdint.h>
28
b7c5b62e 29/* For bt_self_component_status */
96ffdc46
PP
30#include <babeltrace/graph/self-component.h>
31
b7c5b62e 32/* For bt_self_message_iterator_status */
c14831f0 33#include <babeltrace/graph/self-message-iterator.h>
96ffdc46 34
b7c5b62e 35/* For bt_query_status */
96ffdc46
PP
36#include <babeltrace/graph/component-class.h>
37
3f7f8234
PP
38/* For bt_component_class_status */
39#include <babeltrace/graph/component-class-const.h>
40
b9879703
PP
41/*
42 * For bt_component_class, bt_component_class_filter, bt_port_input,
43 * bt_port_output, bt_query_executor, bt_self_component_class_filter,
44 * bt_self_component_filter, bt_self_component_port_input,
c14831f0 45 * bt_self_component_port_output, bt_value, bt_message_array_const
b9879703
PP
46 */
47#include <babeltrace/types.h>
48
d3e4dcd8
PP
49#ifdef __cplusplus
50extern "C" {
51#endif
52
b7c5b62e 53typedef bt_self_component_status
96ffdc46 54(*bt_component_class_filter_init_method)(
b9879703
PP
55 bt_self_component_filter *self_component,
56 const bt_value *params, void *init_method_data);
96ffdc46
PP
57
58typedef void (*bt_component_class_filter_finalize_method)(
b9879703 59 bt_self_component_filter *self_component);
96ffdc46 60
b7c5b62e 61typedef bt_self_message_iterator_status
c14831f0
PP
62(*bt_component_class_filter_message_iterator_init_method)(
63 bt_self_message_iterator *message_iterator,
b9879703
PP
64 bt_self_component_filter *self_component,
65 bt_self_component_port_output *port);
96ffdc46
PP
66
67typedef void
c14831f0
PP
68(*bt_component_class_filter_message_iterator_finalize_method)(
69 bt_self_message_iterator *message_iterator);
96ffdc46 70
b7c5b62e 71typedef bt_self_message_iterator_status
c14831f0
PP
72(*bt_component_class_filter_message_iterator_next_method)(
73 bt_self_message_iterator *message_iterator,
74 bt_message_array_const msgs, uint64_t capacity,
96ffdc46
PP
75 uint64_t *count);
76
b7c5b62e 77typedef bt_query_status
96ffdc46 78(*bt_component_class_filter_query_method)(
b9879703
PP
79 bt_self_component_class_filter *comp_class,
80 const bt_query_executor *query_executor,
81 const char *object, const bt_value *params,
82 const bt_value **result);
96ffdc46 83
b7c5b62e 84typedef bt_self_component_status
96ffdc46 85(*bt_component_class_filter_accept_input_port_connection_method)(
b9879703
PP
86 bt_self_component_filter *self_component,
87 bt_self_component_port_input *self_port,
88 const bt_port_output *other_port);
96ffdc46 89
b7c5b62e 90typedef bt_self_component_status
96ffdc46 91(*bt_component_class_filter_accept_output_port_connection_method)(
b9879703
PP
92 bt_self_component_filter *self_component,
93 bt_self_component_port_output *self_port,
94 const bt_port_input *other_port);
96ffdc46 95
b7c5b62e 96typedef bt_self_component_status
96ffdc46 97(*bt_component_class_filter_input_port_connected_method)(
b9879703
PP
98 bt_self_component_filter *self_component,
99 bt_self_component_port_input *self_port,
100 const bt_port_output *other_port);
96ffdc46 101
b7c5b62e 102typedef bt_self_component_status
96ffdc46 103(*bt_component_class_filter_output_port_connected_method)(
b9879703
PP
104 bt_self_component_filter *self_component,
105 bt_self_component_port_output *self_port,
106 const bt_port_input *other_port);
96ffdc46 107
d27a81b2 108static inline
b9879703
PP
109bt_component_class *bt_component_class_filter_as_component_class(
110 bt_component_class_filter *comp_cls_filter)
d27a81b2
PP
111{
112 return (void *) comp_cls_filter;
113}
d3eb6e8f 114
96ffdc46 115extern
b9879703 116bt_component_class_filter *bt_component_class_filter_create(
96ffdc46 117 const char *name,
c14831f0 118 bt_component_class_filter_message_iterator_next_method method);
96ffdc46 119
3f7f8234
PP
120extern bt_component_class_status
121bt_component_class_filter_set_init_method(
b9879703 122 bt_component_class_filter *comp_class,
96ffdc46
PP
123 bt_component_class_filter_init_method method);
124
3f7f8234
PP
125extern bt_component_class_status
126bt_component_class_filter_set_finalize_method(
b9879703 127 bt_component_class_filter *comp_class,
96ffdc46
PP
128 bt_component_class_filter_finalize_method method);
129
3f7f8234
PP
130extern bt_component_class_status
131bt_component_class_filter_set_accept_input_port_connection_method(
b9879703 132 bt_component_class_filter *comp_class,
96ffdc46
PP
133 bt_component_class_filter_accept_input_port_connection_method method);
134
3f7f8234
PP
135extern bt_component_class_status
136bt_component_class_filter_set_accept_output_port_connection_method(
b9879703 137 bt_component_class_filter *comp_class,
96ffdc46
PP
138 bt_component_class_filter_accept_output_port_connection_method method);
139
3f7f8234
PP
140extern bt_component_class_status
141bt_component_class_filter_set_input_port_connected_method(
b9879703 142 bt_component_class_filter *comp_class,
96ffdc46
PP
143 bt_component_class_filter_input_port_connected_method method);
144
3f7f8234
PP
145extern bt_component_class_status
146bt_component_class_filter_set_output_port_connected_method(
b9879703 147 bt_component_class_filter *comp_class,
96ffdc46
PP
148 bt_component_class_filter_output_port_connected_method method);
149
3f7f8234
PP
150extern bt_component_class_status
151bt_component_class_filter_set_query_method(
b9879703 152 bt_component_class_filter *comp_class,
96ffdc46
PP
153 bt_component_class_filter_query_method method);
154
3f7f8234
PP
155extern bt_component_class_status
156bt_component_class_filter_set_message_iterator_init_method(
b9879703 157 bt_component_class_filter *comp_class,
c14831f0 158 bt_component_class_filter_message_iterator_init_method method);
96ffdc46 159
3f7f8234
PP
160extern bt_component_class_status
161bt_component_class_filter_set_message_iterator_finalize_method(
b9879703 162 bt_component_class_filter *comp_class,
c14831f0 163 bt_component_class_filter_message_iterator_finalize_method method);
96ffdc46 164
d3eb6e8f
PP
165#ifdef __cplusplus
166}
167#endif
168
90157d89 169#endif /* BABELTRACE_GRAPH_COMPONENT_CLASS_FILTER_H */
This page took 0.065319 seconds and 5 git commands to generate.