lib: rename transforming bt_X_borrow_Y() -> bt_X_as_Y()
[babeltrace.git] / include / babeltrace / graph / private-component-class-sink.h
CommitLineData
d94d92ac
PP
1#ifndef BABELTRACE_GRAPH_PRIVATE_COMPONENT_CLASS_SINK_H
2#define BABELTRACE_GRAPH_PRIVATE_COMPONENT_CLASS_SINK_H
3
4/*
5 * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
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
26#include <stdint.h>
27
28/* For enum bt_notification_array */
29#include <babeltrace/graph/notification.h>
30
31/* For enum bt_self_component_status */
32#include <babeltrace/graph/self-component.h>
33
34/* For enum bt_query_status */
35#include <babeltrace/graph/query-executor.h>
36
37/* For struct bt_private_component_class_query_method_return */
38#include <babeltrace/graph/private-component-class.h>
39
40#ifdef __cplusplus
41extern "C" {
42#endif
43
44struct bt_self_component_class_sink;
45struct bt_component_class_sink;
46struct bt_self_component_sink;
47struct bt_private_component_class;
48struct bt_private_component_class_sink;
49struct bt_self_component_port_input;
50struct bt_port_output;
51struct bt_query_executor;
52struct bt_value;
53
54typedef 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);
58
59typedef void (*bt_private_component_class_sink_finalize_method)(
60 struct bt_self_component_sink *self_component);
61
62typedef 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);
68
69typedef 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);
74
75typedef 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);
80
81typedef void
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);
85
86typedef enum bt_self_component_status
87(*bt_private_component_class_sink_consume_method)(
88 struct bt_self_component_sink *self_component);
89
90static inline
91struct bt_private_component_class *
707b7d35 92bt_private_component_class_sink_as_private_component_class(
d94d92ac
PP
93 struct bt_private_component_class_sink *priv_comp_cls_sink)
94{
95 return (void *) priv_comp_cls_sink;
96}
97
98static inline
99struct bt_component_class_sink *
707b7d35 100bt_private_component_class_sink_as_component_class_sink(
d94d92ac
PP
101 struct bt_private_component_class_sink *priv_comp_cls_sink)
102{
103 return (void *) priv_comp_cls_sink;
104}
105
106extern
107struct bt_private_component_class_sink *bt_private_component_class_sink_create(
108 const char *name,
109 bt_private_component_class_sink_consume_method method);
110
111extern 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);
114
115extern 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);
118
119extern 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);
122
123extern 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);
126
127extern 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);
130
131extern 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);
134
135#ifdef __cplusplus
136}
137#endif
138
139#endif /* BABELTRACE_GRAPH_PRIVATE_COMPONENT_CLASS_SINK_H */
This page took 0.02708 seconds and 4 git commands to generate.