1 #ifndef BABELTRACE_GRAPH_COMPONENT_CLASS_SOURCE_H
2 #define BABELTRACE_GRAPH_COMPONENT_CLASS_SOURCE_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_const */
29 #include <babeltrace/graph/notification-const.h>
31 /* For enum bt_self_component_status */
32 #include <babeltrace/graph/self-component.h>
34 /* For enum bt_self_notification_iterator_status */
35 #include <babeltrace/graph/self-notification-iterator.h>
37 /* For enum bt_query_status */
38 #include <babeltrace/graph/component-class.h>
44 struct bt_self_component_class_source
;
45 struct bt_component_class_source
;
46 struct bt_self_component_source
;
47 struct bt_component_class_source
;
48 struct bt_self_component_port_output
;
50 struct bt_query_executor
;
53 typedef 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
);
58 typedef void (*bt_component_class_source_finalize_method
)(
59 struct bt_self_component_source
*self_component
);
61 typedef 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
);
68 (*bt_component_class_source_notification_iterator_finalize_method
)(
69 struct bt_self_notification_iterator
*notification_iterator
);
71 typedef 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
,
77 typedef 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
);
84 typedef 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
);
90 typedef 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
);
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
);
102 struct bt_component_class
*bt_component_class_source_as_component_class(
103 struct bt_component_class_source
*comp_cls_source
)
105 return (void *) comp_cls_source
;
109 struct bt_component_class_source
*bt_component_class_source_create(
111 bt_component_class_source_notification_iterator_next_method method
);
113 extern int bt_component_class_source_set_init_method(
114 struct bt_component_class_source
*comp_class
,
115 bt_component_class_source_init_method method
);
117 extern int bt_component_class_source_set_finalize_method(
118 struct bt_component_class_source
*comp_class
,
119 bt_component_class_source_finalize_method method
);
121 extern 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
);
125 extern 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
);
129 extern 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
);
133 extern int bt_component_class_source_set_query_method(
134 struct bt_component_class_source
*comp_class
,
135 bt_component_class_source_query_method method
);
137 extern 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
);
141 extern 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
);
149 #endif /* BABELTRACE_GRAPH_COMPONENT_CLASS_SOURCE_H */