Commit | Line | Data |
---|---|---|
3fd40f46 PP |
1 | #ifndef BABELTRACE2_GRAPH_COMPONENT_CLASS_FILTER_H |
2 | #define BABELTRACE2_GRAPH_COMPONENT_CLASS_FILTER_H | |
d3e4dcd8 PP |
3 | |
4 | /* | |
0dcb770f | 5 | * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation |
d3e4dcd8 PP |
6 | * |
7 | * Permission is hereby granted, free of charge, to any person obtaining a copy | |
8 | * of this software and associated documentation files (the "Software"), to deal | |
9 | * in the Software without restriction, including without limitation the rights | |
10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
11 | * copies of the Software, and to permit persons to whom the Software is | |
12 | * furnished to do so, subject to the following conditions: | |
13 | * | |
14 | * The above copyright notice and this permission notice shall be included in | |
15 | * all copies or substantial portions of the Software. | |
16 | * | |
17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |
23 | * SOFTWARE. | |
24 | */ | |
25 | ||
9df34b44 PP |
26 | #ifndef __BT_IN_BABELTRACE_H |
27 | # error "Please include <babeltrace2/babeltrace.h> instead." | |
28 | #endif | |
29 | ||
7b53201c PP |
30 | #include <stdint.h> |
31 | ||
71c5da58 | 32 | #include <babeltrace2/graph/component-class.h> |
71c5da58 | 33 | #include <babeltrace2/types.h> |
83da519a PP |
34 | #include <babeltrace2/logging.h> |
35 | ||
d3e4dcd8 PP |
36 | #ifdef __cplusplus |
37 | extern "C" { | |
38 | #endif | |
39 | ||
be788861 PP |
40 | typedef bt_component_class_get_supported_mip_versions_method_status |
41 | (*bt_component_class_filter_get_supported_mip_versions_method)( | |
42 | bt_self_component_class_filter *comp_class, | |
43 | const bt_value *params, void *init_method_data, | |
44 | bt_logging_level log_level, | |
45 | bt_integer_range_set_unsigned *supported_versions); | |
46 | ||
fb25b9e3 | 47 | typedef bt_component_class_init_method_status |
7b53201c | 48 | (*bt_component_class_filter_init_method)( |
8eee8ea2 PP |
49 | bt_self_component_filter *self_component, |
50 | const bt_value *params, void *init_method_data); | |
7b53201c PP |
51 | |
52 | typedef void (*bt_component_class_filter_finalize_method)( | |
8eee8ea2 | 53 | bt_self_component_filter *self_component); |
7b53201c | 54 | |
fb25b9e3 | 55 | typedef bt_component_class_message_iterator_init_method_status |
b09a5592 PP |
56 | (*bt_component_class_filter_message_iterator_init_method)( |
57 | bt_self_message_iterator *message_iterator, | |
8eee8ea2 PP |
58 | bt_self_component_filter *self_component, |
59 | bt_self_component_port_output *port); | |
7b53201c PP |
60 | |
61 | typedef void | |
b09a5592 PP |
62 | (*bt_component_class_filter_message_iterator_finalize_method)( |
63 | bt_self_message_iterator *message_iterator); | |
7b53201c | 64 | |
fb25b9e3 | 65 | typedef bt_component_class_message_iterator_next_method_status |
b09a5592 PP |
66 | (*bt_component_class_filter_message_iterator_next_method)( |
67 | bt_self_message_iterator *message_iterator, | |
68 | bt_message_array_const msgs, uint64_t capacity, | |
7b53201c PP |
69 | uint64_t *count); |
70 | ||
fb25b9e3 | 71 | typedef bt_component_class_message_iterator_seek_ns_from_origin_method_status |
15a52f66 PP |
72 | (*bt_component_class_filter_message_iterator_seek_ns_from_origin_method)( |
73 | bt_self_message_iterator *message_iterator, | |
74 | int64_t ns_from_origin); | |
75 | ||
fb25b9e3 | 76 | typedef bt_component_class_message_iterator_seek_beginning_method_status |
15a52f66 PP |
77 | (*bt_component_class_filter_message_iterator_seek_beginning_method)( |
78 | bt_self_message_iterator *message_iterator); | |
79 | ||
9e8e8b43 | 80 | typedef bt_component_class_message_iterator_can_seek_ns_from_origin_method_status |
15a52f66 PP |
81 | (*bt_component_class_filter_message_iterator_can_seek_ns_from_origin_method)( |
82 | bt_self_message_iterator *message_iterator, | |
9e8e8b43 | 83 | int64_t ns_from_origin, bt_bool *can_seek); |
15a52f66 | 84 | |
9e8e8b43 | 85 | typedef bt_component_class_message_iterator_can_seek_beginning_method_status |
15a52f66 | 86 | (*bt_component_class_filter_message_iterator_can_seek_beginning_method)( |
9e8e8b43 | 87 | bt_self_message_iterator *message_iterator, bt_bool *can_seek); |
15a52f66 | 88 | |
fb25b9e3 | 89 | typedef bt_component_class_query_method_status |
7b53201c | 90 | (*bt_component_class_filter_query_method)( |
8eee8ea2 | 91 | bt_self_component_class_filter *comp_class, |
bf403eb2 | 92 | bt_private_query_executor *query_executor, |
8eee8ea2 | 93 | const char *object, const bt_value *params, |
f6e305ce | 94 | void *method_data, const bt_value **result); |
7b53201c | 95 | |
fb25b9e3 | 96 | typedef bt_component_class_port_connected_method_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 | |
fb25b9e3 | 102 | typedef bt_component_class_port_connected_method_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 | 111 | { |
8470daa9 | 112 | return __BT_UPCAST(bt_component_class, comp_cls_filter); |
834e9996 | 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 | |
be788861 PP |
120 | extern bt_component_class_set_method_status |
121 | bt_component_class_filter_set_get_supported_mip_versions_method( | |
122 | bt_component_class_filter *comp_class, | |
123 | bt_component_class_filter_get_supported_mip_versions_method method); | |
124 | ||
fb25b9e3 | 125 | extern bt_component_class_set_method_status |
4d2e0cb5 | 126 | bt_component_class_filter_set_init_method( |
8eee8ea2 | 127 | bt_component_class_filter *comp_class, |
7b53201c PP |
128 | bt_component_class_filter_init_method method); |
129 | ||
fb25b9e3 | 130 | extern bt_component_class_set_method_status |
4d2e0cb5 | 131 | bt_component_class_filter_set_finalize_method( |
8eee8ea2 | 132 | bt_component_class_filter *comp_class, |
7b53201c PP |
133 | bt_component_class_filter_finalize_method method); |
134 | ||
fb25b9e3 | 135 | extern bt_component_class_set_method_status |
4d2e0cb5 | 136 | bt_component_class_filter_set_input_port_connected_method( |
8eee8ea2 | 137 | bt_component_class_filter *comp_class, |
7b53201c PP |
138 | bt_component_class_filter_input_port_connected_method method); |
139 | ||
fb25b9e3 | 140 | extern bt_component_class_set_method_status |
4d2e0cb5 | 141 | bt_component_class_filter_set_output_port_connected_method( |
8eee8ea2 | 142 | bt_component_class_filter *comp_class, |
7b53201c PP |
143 | bt_component_class_filter_output_port_connected_method method); |
144 | ||
fb25b9e3 | 145 | extern bt_component_class_set_method_status |
4d2e0cb5 | 146 | bt_component_class_filter_set_query_method( |
8eee8ea2 | 147 | bt_component_class_filter *comp_class, |
7b53201c PP |
148 | bt_component_class_filter_query_method method); |
149 | ||
fb25b9e3 | 150 | extern bt_component_class_set_method_status |
4d2e0cb5 | 151 | bt_component_class_filter_set_message_iterator_init_method( |
8eee8ea2 | 152 | bt_component_class_filter *comp_class, |
b09a5592 | 153 | bt_component_class_filter_message_iterator_init_method method); |
7b53201c | 154 | |
fb25b9e3 | 155 | extern bt_component_class_set_method_status |
4d2e0cb5 | 156 | bt_component_class_filter_set_message_iterator_finalize_method( |
8eee8ea2 | 157 | bt_component_class_filter *comp_class, |
b09a5592 | 158 | bt_component_class_filter_message_iterator_finalize_method method); |
7b53201c | 159 | |
fb25b9e3 | 160 | extern bt_component_class_set_method_status |
15a52f66 PP |
161 | bt_component_class_filter_set_message_iterator_seek_ns_from_origin_method( |
162 | bt_component_class_filter *comp_class, | |
163 | bt_component_class_filter_message_iterator_seek_ns_from_origin_method method); | |
164 | ||
fb25b9e3 | 165 | extern bt_component_class_set_method_status |
15a52f66 PP |
166 | bt_component_class_filter_set_message_iterator_seek_beginning_method( |
167 | bt_component_class_filter *comp_class, | |
168 | bt_component_class_filter_message_iterator_seek_beginning_method method); | |
169 | ||
fb25b9e3 | 170 | extern bt_component_class_set_method_status |
15a52f66 PP |
171 | bt_component_class_filter_set_message_iterator_can_seek_ns_from_origin_method( |
172 | bt_component_class_filter *comp_class, | |
173 | bt_component_class_filter_message_iterator_can_seek_ns_from_origin_method method); | |
174 | ||
fb25b9e3 | 175 | extern bt_component_class_set_method_status |
15a52f66 PP |
176 | bt_component_class_filter_set_message_iterator_can_seek_beginning_method( |
177 | bt_component_class_filter *comp_class, | |
178 | bt_component_class_filter_message_iterator_can_seek_beginning_method method); | |
179 | ||
d3eb6e8f PP |
180 | #ifdef __cplusplus |
181 | } | |
182 | #endif | |
183 | ||
3fd40f46 | 184 | #endif /* BABELTRACE2_GRAPH_COMPONENT_CLASS_FILTER_H */ |