1 #ifndef BABELTRACE_GRAPH_PRIVATE_COMPONENT_CLASS_SINK_H
2 #define BABELTRACE_GRAPH_PRIVATE_COMPONENT_CLASS_SINK_H
5 * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
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:
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
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
28 /* For enum bt_notification_array */
29 #include <babeltrace/graph/notification.h>
31 /* For enum bt_self_component_status */
32 #include <babeltrace/graph/self-component.h>
34 /* For enum bt_query_status */
35 #include <babeltrace/graph/query-executor.h>
37 /* For struct bt_private_component_class_query_method_return */
38 #include <babeltrace/graph/private-component-class.h>
44 struct bt_self_component_class_sink
;
45 struct bt_component_class_sink
;
46 struct bt_self_component_sink
;
47 struct bt_private_component_class
;
48 struct bt_private_component_class_sink
;
49 struct bt_self_component_port_input
;
50 struct bt_port_output
;
51 struct bt_query_executor
;
54 typedef enum bt_self_component_status
55 (*bt_private_component_class_sink_init_method
)(
56 struct bt_self_component_sink
*self_component
,
57 struct bt_value
*params
, void *init_method_data
);
59 typedef void (*bt_private_component_class_sink_finalize_method
)(
60 struct bt_self_component_sink
*self_component
);
62 typedef enum bt_query_status
63 (*bt_private_component_class_sink_query_method
)(
64 struct bt_self_component_class_sink
*comp_class
,
65 struct bt_query_executor
*query_executor
,
66 const char *object
, struct bt_value
*params
,
67 struct bt_value
**result
);
69 typedef enum bt_self_component_status
70 (*bt_private_component_class_sink_accept_input_port_connection_method
)(
71 struct bt_self_component_sink
*self_component
,
72 struct bt_self_component_port_input
*self_port
,
73 struct bt_port_output
*other_port
);
75 typedef enum bt_self_component_status
76 (*bt_private_component_class_sink_input_port_connected_method
)(
77 struct bt_self_component_sink
*self_component
,
78 struct bt_self_component_port_input
*self_port
,
79 struct bt_port_output
*other_port
);
82 (*bt_private_component_class_sink_input_port_disconnected_method
)(
83 struct bt_self_component_sink
*self_component
,
84 struct bt_self_component_port_input
*self_port
);
86 typedef enum bt_self_component_status
87 (*bt_private_component_class_sink_consume_method
)(
88 struct bt_self_component_sink
*self_component
);
91 struct bt_private_component_class
*
92 bt_private_component_class_sink_borrow_private_component_class(
93 struct bt_private_component_class_sink
*priv_comp_cls_sink
)
95 return (void *) priv_comp_cls_sink
;
99 struct bt_component_class_sink
*
100 bt_private_component_class_sink_borrow_component_class_sink(
101 struct bt_private_component_class_sink
*priv_comp_cls_sink
)
103 return (void *) priv_comp_cls_sink
;
107 struct bt_private_component_class_sink
*bt_private_component_class_sink_create(
109 bt_private_component_class_sink_consume_method method
);
111 extern int bt_private_component_class_sink_set_init_method(
112 struct bt_private_component_class_sink
*comp_class
,
113 bt_private_component_class_sink_init_method method
);
115 extern int bt_private_component_class_sink_set_finalize_method(
116 struct bt_private_component_class_sink
*comp_class
,
117 bt_private_component_class_sink_finalize_method method
);
119 extern int bt_private_component_class_sink_set_accept_input_port_connection_method(
120 struct bt_private_component_class_sink
*comp_class
,
121 bt_private_component_class_sink_accept_input_port_connection_method method
);
123 extern int bt_private_component_class_sink_set_input_port_connected_method(
124 struct bt_private_component_class_sink
*comp_class
,
125 bt_private_component_class_sink_input_port_connected_method method
);
127 extern int bt_private_component_class_sink_set_input_port_disconnected_method(
128 struct bt_private_component_class_sink
*comp_class
,
129 bt_private_component_class_sink_input_port_disconnected_method method
);
131 extern int bt_private_component_class_sink_set_query_method(
132 struct bt_private_component_class_sink
*comp_class
,
133 bt_private_component_class_sink_query_method method
);
139 #endif /* BABELTRACE_GRAPH_PRIVATE_COMPONENT_CLASS_SINK_H */