1 #ifndef BABELTRACE_GRAPH_PRIVATE_COMPONENT_CLASS_SOURCE_H
2 #define BABELTRACE_GRAPH_PRIVATE_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 */
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 enum bt_self_notification_iterator_status */
38 #include <babeltrace/graph/self-notification-iterator.h>
40 /* For struct bt_private_component_class_query_method_return */
41 #include <babeltrace/graph/private-component-class.h>
47 struct bt_self_component_class_source
;
48 struct bt_component_class_source
;
49 struct bt_self_component_source
;
50 struct bt_private_component_class
;
51 struct bt_private_component_class_source
;
52 struct bt_self_component_port_output
;
54 struct bt_query_executor
;
57 typedef enum bt_self_component_status
58 (*bt_private_component_class_source_init_method
)(
59 struct bt_self_component_source
*self_component
,
60 struct bt_value
*params
, void *init_method_data
);
62 typedef void (*bt_private_component_class_source_finalize_method
)(
63 struct bt_self_component_source
*self_component
);
65 typedef enum bt_self_notification_iterator_status
66 (*bt_private_component_class_source_notification_iterator_init_method
)(
67 struct bt_self_notification_iterator
*notification_iterator
,
68 struct bt_self_component_source
*self_component
,
69 struct bt_self_component_port_output
*port
);
72 (*bt_private_component_class_source_notification_iterator_finalize_method
)(
73 struct bt_self_notification_iterator
*notification_iterator
);
75 typedef enum bt_self_notification_iterator_status
76 (*bt_private_component_class_source_notification_iterator_next_method
)(
77 struct bt_self_notification_iterator
*notification_iterator
,
78 bt_notification_array notifs
, uint64_t capacity
,
81 typedef enum bt_query_status
82 (*bt_private_component_class_source_query_method
)(
83 struct bt_self_component_class_source
*comp_class
,
84 struct bt_query_executor
*query_executor
,
85 const char *object
, struct bt_value
*params
,
86 struct bt_value
**result
);
88 typedef enum bt_self_component_status
89 (*bt_private_component_class_source_accept_output_port_connection_method
)(
90 struct bt_self_component_source
*self_component
,
91 struct bt_self_component_port_output
*self_port
,
92 struct bt_port_input
*other_port
);
94 typedef enum bt_self_component_status
95 (*bt_private_component_class_source_output_port_connected_method
)(
96 struct bt_self_component_source
*self_component
,
97 struct bt_self_component_port_output
*self_port
,
98 struct bt_port_input
*other_port
);
101 (*bt_private_component_class_source_output_port_disconnected_method
)(
102 struct bt_self_component_source
*self_component
,
103 struct bt_self_component_port_output
*self_port
);
106 struct bt_private_component_class
*
107 bt_private_component_class_source_borrow_private_component_class(
108 struct bt_private_component_class_source
*priv_comp_cls_source
)
110 return (void *) priv_comp_cls_source
;
114 struct bt_component_class_source
*
115 bt_private_component_class_source_borrow_component_class_source(
116 struct bt_private_component_class_source
*priv_comp_cls_source
)
118 return (void *) priv_comp_cls_source
;
122 struct bt_private_component_class_source
*
123 bt_private_component_class_source_create(
125 bt_private_component_class_source_notification_iterator_next_method method
);
127 extern int bt_private_component_class_source_set_init_method(
128 struct bt_private_component_class_source
*comp_class
,
129 bt_private_component_class_source_init_method method
);
131 extern int bt_private_component_class_source_set_finalize_method(
132 struct bt_private_component_class_source
*comp_class
,
133 bt_private_component_class_source_finalize_method method
);
135 extern int bt_private_component_class_source_set_accept_output_port_connection_method(
136 struct bt_private_component_class_source
*comp_class
,
137 bt_private_component_class_source_accept_output_port_connection_method method
);
139 extern int bt_private_component_class_source_set_output_port_connected_method(
140 struct bt_private_component_class_source
*comp_class
,
141 bt_private_component_class_source_output_port_connected_method method
);
143 extern int bt_private_component_class_source_set_output_port_disconnected_method(
144 struct bt_private_component_class_source
*comp_class
,
145 bt_private_component_class_source_output_port_disconnected_method method
);
147 extern int bt_private_component_class_source_set_query_method(
148 struct bt_private_component_class_source
*comp_class
,
149 bt_private_component_class_source_query_method method
);
151 extern int bt_private_component_class_source_set_notification_iterator_init_method(
152 struct bt_private_component_class_source
*comp_class
,
153 bt_private_component_class_source_notification_iterator_init_method method
);
155 extern int bt_private_component_class_source_set_notification_iterator_finalize_method(
156 struct bt_private_component_class_source
*comp_class
,
157 bt_private_component_class_source_notification_iterator_finalize_method method
);
163 #endif /* BABELTRACE_GRAPH_PRIVATE_COMPONENT_CLASS_SOURCE_H */