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