Fix: do not allow a notif. iter. to call the user's "next" method once finalized
[babeltrace.git] / include / babeltrace / graph / notification-iterator-internal.h
index 7b748e7bff10fd4c78b4181b2a5b5325eb489203..f54547442b805764d44c964b6651875869bcd868 100644 (file)
@@ -180,4 +180,22 @@ const char *bt_notification_iterator_status_string(
        }
 };
 
+static inline
+const char *bt_notification_iterator_state_string(
+               enum bt_notification_iterator_state state)
+{
+       switch (state) {
+       case BT_NOTIFICATION_ITERATOR_STATE_ACTIVE:
+               return "BT_NOTIFICATION_ITERATOR_STATE_ACTIVE";
+       case BT_NOTIFICATION_ITERATOR_STATE_ENDED:
+               return "BT_NOTIFICATION_ITERATOR_STATE_ENDED";
+       case BT_NOTIFICATION_ITERATOR_STATE_FINALIZED:
+               return "BT_NOTIFICATION_ITERATOR_STATE_FINALIZED";
+       case BT_NOTIFICATION_ITERATOR_STATE_FINALIZED_AND_ENDED:
+               return "BT_NOTIFICATION_ITERATOR_STATE_FINALIZED_AND_ENDED";
+       default:
+               return "(unknown)";
+       }
+};
+
 #endif /* BABELTRACE_COMPONENT_NOTIFICATION_ITERATOR_INTERNAL_H */
This page took 0.025097 seconds and 4 git commands to generate.