X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=include%2Fbabeltrace%2Fgraph%2Fcomponent-class.h;h=e30c329cf894f4f6d295e7c2c623339e8c388173;hb=1ca80abd6ac25e66d876a358ceee03910e7c0173;hp=fcb171fc44f4629c8a6c2f1ea6a7f60b3b512211;hpb=cc469c423c882333c3b2cede4f933e8a53cbe682;p=babeltrace.git diff --git a/include/babeltrace/graph/component-class.h b/include/babeltrace/graph/component-class.h index fcb171fc..e30c329c 100644 --- a/include/babeltrace/graph/component-class.h +++ b/include/babeltrace/graph/component-class.h @@ -1,5 +1,5 @@ -#ifndef BABELTRACE_COMPONENT_COMPONENT_CLASS_H -#define BABELTRACE_COMPONENT_COMPONENT_CLASS_H +#ifndef BABELTRACE_GRAPH_COMPONENT_CLASS_H +#define BABELTRACE_GRAPH_COMPONENT_CLASS_H /* * Babeltrace - Component Class Interface. @@ -26,6 +26,7 @@ */ #include +#include #include #include @@ -170,8 +171,29 @@ extern struct bt_value *bt_component_class_query( extern enum bt_component_class_type bt_component_class_get_type( struct bt_component_class *component_class); +static inline +bool bt_component_class_is_source(struct bt_component_class *component_class) +{ + return bt_component_class_get_type(component_class) == + BT_COMPONENT_CLASS_TYPE_SOURCE; +} + +static inline +bool bt_component_class_is_filter(struct bt_component_class *component_class) +{ + return bt_component_class_get_type(component_class) == + BT_COMPONENT_CLASS_TYPE_FILTER; +} + +static inline +bool bt_component_class_is_sink(struct bt_component_class *component_class) +{ + return bt_component_class_get_type(component_class) == + BT_COMPONENT_CLASS_TYPE_SINK; +} + #ifdef __cplusplus } #endif -#endif /* BABELTRACE_COMPONENT_COMPONENT_CLASS_H */ +#endif /* BABELTRACE_GRAPH_COMPONENT_CLASS_H */