bt2: honor self component or query log level when logging
[babeltrace.git] / include / babeltrace2 / graph / component-class-filter.h
CommitLineData
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
37extern "C" {
38#endif
39
fb25b9e3 40typedef bt_component_class_init_method_status
7b53201c 41(*bt_component_class_filter_init_method)(
8eee8ea2
PP
42 bt_self_component_filter *self_component,
43 const bt_value *params, void *init_method_data);
7b53201c
PP
44
45typedef void (*bt_component_class_filter_finalize_method)(
8eee8ea2 46 bt_self_component_filter *self_component);
7b53201c 47
fb25b9e3 48typedef bt_component_class_message_iterator_init_method_status
b09a5592
PP
49(*bt_component_class_filter_message_iterator_init_method)(
50 bt_self_message_iterator *message_iterator,
8eee8ea2
PP
51 bt_self_component_filter *self_component,
52 bt_self_component_port_output *port);
7b53201c
PP
53
54typedef void
b09a5592
PP
55(*bt_component_class_filter_message_iterator_finalize_method)(
56 bt_self_message_iterator *message_iterator);
7b53201c 57
fb25b9e3 58typedef bt_component_class_message_iterator_next_method_status
b09a5592
PP
59(*bt_component_class_filter_message_iterator_next_method)(
60 bt_self_message_iterator *message_iterator,
61 bt_message_array_const msgs, uint64_t capacity,
7b53201c
PP
62 uint64_t *count);
63
fb25b9e3 64typedef bt_component_class_message_iterator_seek_ns_from_origin_method_status
15a52f66
PP
65(*bt_component_class_filter_message_iterator_seek_ns_from_origin_method)(
66 bt_self_message_iterator *message_iterator,
67 int64_t ns_from_origin);
68
fb25b9e3 69typedef bt_component_class_message_iterator_seek_beginning_method_status
15a52f66
PP
70(*bt_component_class_filter_message_iterator_seek_beginning_method)(
71 bt_self_message_iterator *message_iterator);
72
73typedef bt_bool
74(*bt_component_class_filter_message_iterator_can_seek_ns_from_origin_method)(
75 bt_self_message_iterator *message_iterator,
76 int64_t ns_from_origin);
77
78typedef bt_bool
79(*bt_component_class_filter_message_iterator_can_seek_beginning_method)(
80 bt_self_message_iterator *message_iterator);
81
fb25b9e3 82typedef bt_component_class_query_method_status
7b53201c 83(*bt_component_class_filter_query_method)(
8eee8ea2
PP
84 bt_self_component_class_filter *comp_class,
85 const bt_query_executor *query_executor,
86 const char *object, const bt_value *params,
83da519a 87 bt_logging_level logging_level, const bt_value **result);
7b53201c 88
fb25b9e3 89typedef bt_component_class_port_connected_method_status
7b53201c 90(*bt_component_class_filter_input_port_connected_method)(
8eee8ea2
PP
91 bt_self_component_filter *self_component,
92 bt_self_component_port_input *self_port,
93 const bt_port_output *other_port);
7b53201c 94
fb25b9e3 95typedef bt_component_class_port_connected_method_status
7b53201c 96(*bt_component_class_filter_output_port_connected_method)(
8eee8ea2
PP
97 bt_self_component_filter *self_component,
98 bt_self_component_port_output *self_port,
99 const bt_port_input *other_port);
7b53201c 100
834e9996 101static inline
8eee8ea2
PP
102bt_component_class *bt_component_class_filter_as_component_class(
103 bt_component_class_filter *comp_cls_filter)
834e9996 104{
8470daa9 105 return __BT_UPCAST(bt_component_class, comp_cls_filter);
834e9996 106}
d3eb6e8f 107
7b53201c 108extern
8eee8ea2 109bt_component_class_filter *bt_component_class_filter_create(
7b53201c 110 const char *name,
b09a5592 111 bt_component_class_filter_message_iterator_next_method method);
7b53201c 112
fb25b9e3 113extern bt_component_class_set_method_status
4d2e0cb5 114bt_component_class_filter_set_init_method(
8eee8ea2 115 bt_component_class_filter *comp_class,
7b53201c
PP
116 bt_component_class_filter_init_method method);
117
fb25b9e3 118extern bt_component_class_set_method_status
4d2e0cb5 119bt_component_class_filter_set_finalize_method(
8eee8ea2 120 bt_component_class_filter *comp_class,
7b53201c
PP
121 bt_component_class_filter_finalize_method method);
122
fb25b9e3 123extern bt_component_class_set_method_status
4d2e0cb5 124bt_component_class_filter_set_input_port_connected_method(
8eee8ea2 125 bt_component_class_filter *comp_class,
7b53201c
PP
126 bt_component_class_filter_input_port_connected_method method);
127
fb25b9e3 128extern bt_component_class_set_method_status
4d2e0cb5 129bt_component_class_filter_set_output_port_connected_method(
8eee8ea2 130 bt_component_class_filter *comp_class,
7b53201c
PP
131 bt_component_class_filter_output_port_connected_method method);
132
fb25b9e3 133extern bt_component_class_set_method_status
4d2e0cb5 134bt_component_class_filter_set_query_method(
8eee8ea2 135 bt_component_class_filter *comp_class,
7b53201c
PP
136 bt_component_class_filter_query_method method);
137
fb25b9e3 138extern bt_component_class_set_method_status
4d2e0cb5 139bt_component_class_filter_set_message_iterator_init_method(
8eee8ea2 140 bt_component_class_filter *comp_class,
b09a5592 141 bt_component_class_filter_message_iterator_init_method method);
7b53201c 142
fb25b9e3 143extern bt_component_class_set_method_status
4d2e0cb5 144bt_component_class_filter_set_message_iterator_finalize_method(
8eee8ea2 145 bt_component_class_filter *comp_class,
b09a5592 146 bt_component_class_filter_message_iterator_finalize_method method);
7b53201c 147
fb25b9e3 148extern bt_component_class_set_method_status
15a52f66
PP
149bt_component_class_filter_set_message_iterator_seek_ns_from_origin_method(
150 bt_component_class_filter *comp_class,
151 bt_component_class_filter_message_iterator_seek_ns_from_origin_method method);
152
fb25b9e3 153extern bt_component_class_set_method_status
15a52f66
PP
154bt_component_class_filter_set_message_iterator_seek_beginning_method(
155 bt_component_class_filter *comp_class,
156 bt_component_class_filter_message_iterator_seek_beginning_method method);
157
fb25b9e3 158extern bt_component_class_set_method_status
15a52f66
PP
159bt_component_class_filter_set_message_iterator_can_seek_ns_from_origin_method(
160 bt_component_class_filter *comp_class,
161 bt_component_class_filter_message_iterator_can_seek_ns_from_origin_method method);
162
fb25b9e3 163extern bt_component_class_set_method_status
15a52f66
PP
164bt_component_class_filter_set_message_iterator_can_seek_beginning_method(
165 bt_component_class_filter *comp_class,
166 bt_component_class_filter_message_iterator_can_seek_beginning_method method);
167
d3eb6e8f
PP
168#ifdef __cplusplus
169}
170#endif
171
3fd40f46 172#endif /* BABELTRACE2_GRAPH_COMPONENT_CLASS_FILTER_H */
This page took 0.050214 seconds and 4 git commands to generate.