-#ifndef BABELTRACE_COMPONENT_COMPONENT_CLASS_INTERNAL_H
-#define BABELTRACE_COMPONENT_COMPONENT_CLASS_INTERNAL_H
+#ifndef BABELTRACE_GRAPH_COMPONENT_CLASS_INTERNAL_H
+#define BABELTRACE_GRAPH_COMPONENT_CLASS_INTERNAL_H
/*
- * BabelTrace - Component Class Internal
- *
* Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
* Copyright 2017 Philippe Proulx <pproulx@efficios.com>
*
* SOFTWARE.
*/
-#include <babeltrace/graph/component.h>
+#include <babeltrace/graph/component-const.h>
#include <babeltrace/graph/component-class.h>
#include <babeltrace/graph/component-class-source.h>
#include <babeltrace/graph/component-class-filter.h>
GString *name;
GString *description;
GString *help;
- struct {
- bt_component_class_init_method init;
- bt_component_class_finalize_method finalize;
- bt_component_class_query_method query;
- bt_component_class_accept_port_connection_method accept_port_connection;
- bt_component_class_port_connected_method port_connected;
- bt_component_class_port_disconnected_method port_disconnected;
- } methods;
+
/* Array of struct bt_component_class_destroy_listener */
GArray *destroy_listeners;
- bt_bool frozen;
+ bool frozen;
struct bt_list_head node;
struct bt_plugin_so_shared_lib_handle *so_handle;
};
-struct bt_component_class_iterator_methods {
- bt_component_class_notification_iterator_init_method init;
- bt_component_class_notification_iterator_finalize_method finalize;
- bt_component_class_notification_iterator_next_method next;
-};
-
struct bt_component_class_source {
struct bt_component_class parent;
struct {
- struct bt_component_class_iterator_methods iterator;
+ bt_component_class_source_init_method init;
+ bt_component_class_source_finalize_method finalize;
+ bt_component_class_source_notification_iterator_init_method notif_iter_init;
+ bt_component_class_source_notification_iterator_finalize_method notif_iter_finalize;
+ bt_component_class_source_notification_iterator_next_method notif_iter_next;
+ bt_component_class_source_query_method query;
+ bt_component_class_source_accept_output_port_connection_method accept_output_port_connection;
+ bt_component_class_source_output_port_connected_method output_port_connected;
+ bt_component_class_source_output_port_disconnected_method output_port_disconnected;
} methods;
};
struct bt_component_class_sink {
struct bt_component_class parent;
struct {
+ bt_component_class_sink_init_method init;
+ bt_component_class_sink_finalize_method finalize;
+ bt_component_class_sink_query_method query;
+ bt_component_class_sink_accept_input_port_connection_method accept_input_port_connection;
+ bt_component_class_sink_input_port_connected_method input_port_connected;
+ bt_component_class_sink_input_port_disconnected_method input_port_disconnected;
bt_component_class_sink_consume_method consume;
} methods;
};
struct bt_component_class_filter {
struct bt_component_class parent;
struct {
- struct bt_component_class_iterator_methods iterator;
+ bt_component_class_filter_init_method init;
+ bt_component_class_filter_finalize_method finalize;
+ bt_component_class_filter_notification_iterator_init_method notif_iter_init;
+ bt_component_class_filter_notification_iterator_finalize_method notif_iter_finalize;
+ bt_component_class_filter_notification_iterator_next_method notif_iter_next;
+ bt_component_class_filter_query_method query;
+ bt_component_class_filter_accept_input_port_connection_method accept_input_port_connection;
+ bt_component_class_filter_accept_output_port_connection_method accept_output_port_connection;
+ bt_component_class_filter_input_port_connected_method input_port_connected;
+ bt_component_class_filter_output_port_connected_method output_port_connected;
+ bt_component_class_filter_input_port_disconnected_method input_port_disconnected;
+ bt_component_class_filter_output_port_disconnected_method output_port_disconnected;
} methods;
};
void bt_component_class_add_destroy_listener(struct bt_component_class *class,
bt_component_class_destroy_listener_func func, void *data);
+BT_HIDDEN
+void _bt_component_class_freeze(
+ const struct bt_component_class *component_class);
+
+#ifdef BT_DEV_MODE
+# define bt_component_class_freeze _bt_component_class_freeze
+#else
+# define bt_component_class_freeze(_cc)
+#endif
+
static inline
const char *bt_component_class_type_string(enum bt_component_class_type type)
{
switch (type) {
- case BT_COMPONENT_CLASS_TYPE_UNKNOWN:
- return "BT_COMPONENT_CLASS_TYPE_UNKNOWN";
case BT_COMPONENT_CLASS_TYPE_SOURCE:
return "BT_COMPONENT_CLASS_TYPE_SOURCE";
case BT_COMPONENT_CLASS_TYPE_SINK:
}
}
-#endif /* BABELTRACE_COMPONENT_COMPONENT_CLASS_INTERNAL_H */
+#endif /* BABELTRACE_GRAPH_COMPONENT_CLASS_INTERNAL_H */