lib: rename plural file names to singular
[babeltrace.git] / include / babeltrace / graph / component-class-source.h
CommitLineData
1ca80abd
PP
1#ifndef BABELTRACE_GRAPH_COMPONENT_CLASS_SOURCE_H
2#define BABELTRACE_GRAPH_COMPONENT_CLASS_SOURCE_H
d3e4dcd8
PP
3
4/*
d3e4dcd8
PP
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
0d72b8c3
PP
26#include <stdint.h>
27
28/* For enum bt_notification_array_const */
29#include <babeltrace/graph/notification-const.h>
30
31/* For enum bt_self_component_status */
32#include <babeltrace/graph/self-component.h>
33
34/* For enum bt_self_notification_iterator_status */
35#include <babeltrace/graph/self-notification-iterator.h>
36
37/* For enum bt_query_status */
38#include <babeltrace/graph/component-class.h>
39
d3e4dcd8
PP
40#ifdef __cplusplus
41extern "C" {
42#endif
43
0d72b8c3
PP
44struct bt_self_component_class_source;
45struct bt_component_class_source;
46struct bt_self_component_source;
d94d92ac 47struct bt_component_class_source;
0d72b8c3
PP
48struct bt_self_component_port_output;
49struct bt_port_input;
50struct bt_query_executor;
51struct bt_value;
52
53typedef enum bt_self_component_status
54(*bt_component_class_source_init_method)(
55 struct bt_self_component_source *self_component,
56 const struct bt_value *params, void *init_method_data);
57
58typedef void (*bt_component_class_source_finalize_method)(
59 struct bt_self_component_source *self_component);
60
61typedef enum bt_self_notification_iterator_status
62(*bt_component_class_source_notification_iterator_init_method)(
63 struct bt_self_notification_iterator *notification_iterator,
64 struct bt_self_component_source *self_component,
65 struct bt_self_component_port_output *port);
66
67typedef void
68(*bt_component_class_source_notification_iterator_finalize_method)(
69 struct bt_self_notification_iterator *notification_iterator);
70
71typedef enum bt_self_notification_iterator_status
72(*bt_component_class_source_notification_iterator_next_method)(
73 struct bt_self_notification_iterator *notification_iterator,
74 bt_notification_array_const notifs, uint64_t capacity,
75 uint64_t *count);
76
77typedef enum bt_query_status
78(*bt_component_class_source_query_method)(
79 struct bt_self_component_class_source *comp_class,
80 const struct bt_query_executor *query_executor,
81 const char *object, const struct bt_value *params,
82 const struct bt_value **result);
83
84typedef enum bt_self_component_status
85(*bt_component_class_source_accept_output_port_connection_method)(
86 struct bt_self_component_source *self_component,
87 struct bt_self_component_port_output *self_port,
88 const struct bt_port_input *other_port);
89
90typedef enum bt_self_component_status
91(*bt_component_class_source_output_port_connected_method)(
92 struct bt_self_component_source *self_component,
93 struct bt_self_component_port_output *self_port,
94 const struct bt_port_input *other_port);
95
96typedef void
97(*bt_component_class_source_output_port_disconnected_method)(
98 struct bt_self_component_source *self_component,
99 struct bt_self_component_port_output *self_port);
d94d92ac
PP
100
101static inline
0d72b8c3 102struct bt_component_class *bt_component_class_source_as_component_class(
d94d92ac
PP
103 struct bt_component_class_source *comp_cls_source)
104{
105 return (void *) comp_cls_source;
106}
d3eb6e8f 107
0d72b8c3
PP
108extern
109struct bt_component_class_source *bt_component_class_source_create(
110 const char *name,
111 bt_component_class_source_notification_iterator_next_method method);
112
113extern int bt_component_class_source_set_init_method(
114 struct bt_component_class_source *comp_class,
115 bt_component_class_source_init_method method);
116
117extern int bt_component_class_source_set_finalize_method(
118 struct bt_component_class_source *comp_class,
119 bt_component_class_source_finalize_method method);
120
121extern int bt_component_class_source_set_accept_output_port_connection_method(
122 struct bt_component_class_source *comp_class,
123 bt_component_class_source_accept_output_port_connection_method method);
124
125extern int bt_component_class_source_set_output_port_connected_method(
126 struct bt_component_class_source *comp_class,
127 bt_component_class_source_output_port_connected_method method);
128
129extern int bt_component_class_source_set_output_port_disconnected_method(
130 struct bt_component_class_source *comp_class,
131 bt_component_class_source_output_port_disconnected_method method);
132
133extern int bt_component_class_source_set_query_method(
134 struct bt_component_class_source *comp_class,
135 bt_component_class_source_query_method method);
136
137extern int bt_component_class_source_set_notification_iterator_init_method(
138 struct bt_component_class_source *comp_class,
139 bt_component_class_source_notification_iterator_init_method method);
140
141extern int bt_component_class_source_set_notification_iterator_finalize_method(
142 struct bt_component_class_source *comp_class,
143 bt_component_class_source_notification_iterator_finalize_method method);
144
d3e4dcd8
PP
145#ifdef __cplusplus
146}
147#endif
148
1ca80abd 149#endif /* BABELTRACE_GRAPH_COMPONENT_CLASS_SOURCE_H */
This page took 0.040392 seconds and 4 git commands to generate.