plugin-so: use list of components instead of glib hash table
[babeltrace.git] / include / babeltrace / graph / component-class-internal.h
index 03314845d9f3536493fbec9606898cca86a3737b..02671eafd8c1614448c99cc7771958116b35037a 100644 (file)
 #include <babeltrace/graph/component-class-sink.h>
 #include <babeltrace/babeltrace-internal.h>
 #include <babeltrace/object-internal.h>
+#include <babeltrace/list-internal.h>
 #include <babeltrace/types.h>
 #include <glib.h>
 
 struct bt_component_class;
+struct bt_plugin_so_shared_lib_handle;
 
 typedef void (*bt_component_class_destroy_listener_func)(
                struct bt_component_class *class, void *data);
@@ -65,6 +67,8 @@ struct bt_component_class {
        /* Array of struct bt_component_class_destroy_listener */
        GArray *destroy_listeners;
        bt_bool frozen;
+       struct bt_list_head node;
+       struct bt_plugin_so_shared_lib_handle *so_handle;
 };
 
 struct bt_component_class_iterator_methods {
@@ -99,4 +103,21 @@ BT_HIDDEN
 void bt_component_class_add_destroy_listener(struct bt_component_class *class,
                bt_component_class_destroy_listener_func func, void *data);
 
+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:
+               return "BT_COMPONENT_CLASS_TYPE_SINK";
+       case BT_COMPONENT_CLASS_TYPE_FILTER:
+               return "BT_COMPONENT_CLASS_TYPE_FILTER";
+       default:
+               return "(unknown)";
+       }
+}
+
 #endif /* BABELTRACE_COMPONENT_COMPONENT_CLASS_INTERNAL_H */
This page took 0.023188 seconds and 4 git commands to generate.