X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=include%2Fbabeltrace%2Fgraph%2Fcomponent-class-internal.h;h=70eb2ee806dfd2fb6b0245333b9f0a73d9e1a87d;hb=ab0d387b552819367102a7a5f7340aa4e7530a4f;hp=03314845d9f3536493fbec9606898cca86a3737b;hpb=a2136ecadbc2d14c24d07126c65fd59611c29277;p=babeltrace.git diff --git a/include/babeltrace/graph/component-class-internal.h b/include/babeltrace/graph/component-class-internal.h index 03314845..70eb2ee8 100644 --- a/include/babeltrace/graph/component-class-internal.h +++ b/include/babeltrace/graph/component-class-internal.h @@ -99,4 +99,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 */