X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=include%2Fbabeltrace%2Fgraph%2Fcomponent-class-internal.h;h=66d920d65b6325250065f619161614432a632a8f;hb=312c056ae3d374b253fa0cfe5ed576c0b0e5e569;hp=364299c63bccad896e7f5c68ee096998ac560a04;hpb=0d8b4d8edb6b11ddd7f4e6adc77b9390a0db0b20;p=babeltrace.git diff --git a/include/babeltrace/graph/component-class-internal.h b/include/babeltrace/graph/component-class-internal.h index 364299c6..66d920d6 100644 --- a/include/babeltrace/graph/component-class-internal.h +++ b/include/babeltrace/graph/component-class-internal.h @@ -1,5 +1,5 @@ -#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 @@ -35,10 +35,12 @@ #include #include #include -#include +#include +#include #include 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); @@ -64,20 +66,21 @@ struct bt_component_class { } methods; /* Array of struct bt_component_class_destroy_listener */ GArray *destroy_listeners; - bool frozen; + bt_bool frozen; + struct bt_list_head node; + struct bt_plugin_so_shared_lib_handle *so_handle; }; -struct bt_component_class_iterator_methods { +struct bt_component_class_notification_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; - bt_component_class_notification_iterator_seek_time_method seek_time; }; struct bt_component_class_source { struct bt_component_class parent; struct { - struct bt_component_class_iterator_methods iterator; + struct bt_component_class_notification_iterator_methods iterator; } methods; }; @@ -91,12 +94,29 @@ struct bt_component_class_sink { struct bt_component_class_filter { struct bt_component_class parent; struct { - struct bt_component_class_iterator_methods iterator; + struct bt_component_class_notification_iterator_methods iterator; } methods; }; BT_HIDDEN -int bt_component_class_add_destroy_listener(struct bt_component_class *class, +void bt_component_class_add_destroy_listener(struct bt_component_class *class, bt_component_class_destroy_listener_func func, void *data); -#endif /* BABELTRACE_COMPONENT_COMPONENT_CLASS_INTERNAL_H */ +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_GRAPH_COMPONENT_CLASS_INTERNAL_H */