Normalize public header include guards
[babeltrace.git] / include / babeltrace / graph / component-class.h
index fcb171fc44f4629c8a6c2f1ea6a7f60b3b512211..e30c329cf894f4f6d295e7c2c623339e8c388173 100644 (file)
@@ -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 <stdint.h>
+#include <stdbool.h>
 #include <babeltrace/graph/component-status.h>
 #include <babeltrace/graph/notification-iterator.h>
 
@@ -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 */
This page took 0.028175 seconds and 4 git commands to generate.