lib: fully configure graph (add components, connect ports), then run
[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/*
e2f7325d 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
0d72b8c3
PP
27#include <stdint.h>
28
4cdfc5e8 29/* For bt_self_component_status */
0d72b8c3
PP
30#include <babeltrace/graph/self-component.h>
31
4cdfc5e8 32/* For bt_self_message_iterator_status */
d6e69534 33#include <babeltrace/graph/self-message-iterator.h>
0d72b8c3 34
4cdfc5e8 35/* For bt_query_status */
0d72b8c3
PP
36#include <babeltrace/graph/component-class.h>
37
d0cf29ee
PP
38/* For bt_component_class_status */
39#include <babeltrace/graph/component-class-const.h>
40
b19ff26f
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,
d6e69534 45 * bt_self_component_port_output, bt_value, bt_message_array_const
b19ff26f
PP
46 */
47#include <babeltrace/types.h>
48
d3e4dcd8
PP
49#ifdef __cplusplus
50extern "C" {
51#endif
52
4cdfc5e8 53typedef bt_self_component_status
0d72b8c3 54(*bt_component_class_filter_init_method)(
b19ff26f
PP
55 bt_self_component_filter *self_component,
56 const bt_value *params, void *init_method_data);
0d72b8c3
PP
57
58typedef void (*bt_component_class_filter_finalize_method)(
b19ff26f 59 bt_self_component_filter *self_component);
0d72b8c3 60
4cdfc5e8 61typedef bt_self_message_iterator_status
d6e69534
PP
62(*bt_component_class_filter_message_iterator_init_method)(
63 bt_self_message_iterator *message_iterator,
b19ff26f
PP
64 bt_self_component_filter *self_component,
65 bt_self_component_port_output *port);
0d72b8c3
PP
66
67typedef void
d6e69534
PP
68(*bt_component_class_filter_message_iterator_finalize_method)(
69 bt_self_message_iterator *message_iterator);
0d72b8c3 70
4cdfc5e8 71typedef bt_self_message_iterator_status
d6e69534
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,
0d72b8c3
PP
75 uint64_t *count);
76
4cdfc5e8 77typedef bt_query_status
0d72b8c3 78(*bt_component_class_filter_query_method)(
b19ff26f
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);
0d72b8c3 83
4cdfc5e8 84typedef bt_self_component_status
0d72b8c3 85(*bt_component_class_filter_accept_input_port_connection_method)(
b19ff26f
PP
86 bt_self_component_filter *self_component,
87 bt_self_component_port_input *self_port,
88 const bt_port_output *other_port);
0d72b8c3 89
4cdfc5e8 90typedef bt_self_component_status
0d72b8c3 91(*bt_component_class_filter_accept_output_port_connection_method)(
b19ff26f
PP
92 bt_self_component_filter *self_component,
93 bt_self_component_port_output *self_port,
94 const bt_port_input *other_port);
0d72b8c3 95
4cdfc5e8 96typedef bt_self_component_status
0d72b8c3 97(*bt_component_class_filter_input_port_connected_method)(
b19ff26f
PP
98 bt_self_component_filter *self_component,
99 bt_self_component_port_input *self_port,
100 const bt_port_output *other_port);
0d72b8c3 101
4cdfc5e8 102typedef bt_self_component_status
0d72b8c3 103(*bt_component_class_filter_output_port_connected_method)(
b19ff26f
PP
104 bt_self_component_filter *self_component,
105 bt_self_component_port_output *self_port,
106 const bt_port_input *other_port);
0d72b8c3 107
d94d92ac 108static inline
b19ff26f
PP
109bt_component_class *bt_component_class_filter_as_component_class(
110 bt_component_class_filter *comp_cls_filter)
d94d92ac
PP
111{
112 return (void *) comp_cls_filter;
113}
d3eb6e8f 114
0d72b8c3 115extern
b19ff26f 116bt_component_class_filter *bt_component_class_filter_create(
0d72b8c3 117 const char *name,
d6e69534 118 bt_component_class_filter_message_iterator_next_method method);
0d72b8c3 119
d0cf29ee
PP
120extern bt_component_class_status
121bt_component_class_filter_set_init_method(
b19ff26f 122 bt_component_class_filter *comp_class,
0d72b8c3
PP
123 bt_component_class_filter_init_method method);
124
d0cf29ee
PP
125extern bt_component_class_status
126bt_component_class_filter_set_finalize_method(
b19ff26f 127 bt_component_class_filter *comp_class,
0d72b8c3
PP
128 bt_component_class_filter_finalize_method method);
129
d0cf29ee
PP
130extern bt_component_class_status
131bt_component_class_filter_set_accept_input_port_connection_method(
b19ff26f 132 bt_component_class_filter *comp_class,
0d72b8c3
PP
133 bt_component_class_filter_accept_input_port_connection_method method);
134
d0cf29ee
PP
135extern bt_component_class_status
136bt_component_class_filter_set_accept_output_port_connection_method(
b19ff26f 137 bt_component_class_filter *comp_class,
0d72b8c3
PP
138 bt_component_class_filter_accept_output_port_connection_method method);
139
d0cf29ee
PP
140extern bt_component_class_status
141bt_component_class_filter_set_input_port_connected_method(
b19ff26f 142 bt_component_class_filter *comp_class,
0d72b8c3
PP
143 bt_component_class_filter_input_port_connected_method method);
144
d0cf29ee
PP
145extern bt_component_class_status
146bt_component_class_filter_set_output_port_connected_method(
b19ff26f 147 bt_component_class_filter *comp_class,
0d72b8c3
PP
148 bt_component_class_filter_output_port_connected_method method);
149
d0cf29ee
PP
150extern bt_component_class_status
151bt_component_class_filter_set_query_method(
b19ff26f 152 bt_component_class_filter *comp_class,
0d72b8c3
PP
153 bt_component_class_filter_query_method method);
154
d0cf29ee
PP
155extern bt_component_class_status
156bt_component_class_filter_set_message_iterator_init_method(
b19ff26f 157 bt_component_class_filter *comp_class,
d6e69534 158 bt_component_class_filter_message_iterator_init_method method);
0d72b8c3 159
d0cf29ee
PP
160extern bt_component_class_status
161bt_component_class_filter_set_message_iterator_finalize_method(
b19ff26f 162 bt_component_class_filter *comp_class,
d6e69534 163 bt_component_class_filter_message_iterator_finalize_method method);
0d72b8c3 164
d3eb6e8f
PP
165#ifdef __cplusplus
166}
167#endif
168
90157d89 169#endif /* BABELTRACE_GRAPH_COMPONENT_CLASS_FILTER_H */
This page took 0.042936 seconds and 4 git commands to generate.