lib: make can_seek_beginning and can_seek_ns_from_origin methods return a status
[babeltrace.git] / src / lib / graph / message / iterator.h
index 93d9aa23e122f81d8d0eef56c18bd07b7a3dc389..8014d1fad536c27d8fbd97772a7c014035f17e43 100644 (file)
 struct bt_port;
 struct bt_graph;
 
-enum bt_message_iterator_type {
-       BT_MESSAGE_ITERATOR_TYPE_SELF_COMPONENT_PORT_INPUT,
-       BT_MESSAGE_ITERATOR_TYPE_PORT_OUTPUT,
-};
-
 enum bt_self_component_port_input_message_iterator_state {
        /* Iterator is not initialized */
        BT_SELF_COMPONENT_PORT_INPUT_MESSAGE_ITERATOR_STATE_NON_INITIALIZED,
@@ -70,12 +65,6 @@ enum bt_self_component_port_input_message_iterator_state {
        BT_SELF_COMPONENT_PORT_INPUT_MESSAGE_ITERATOR_STATE_LAST_SEEKING_RETURNED_ERROR,
 };
 
-struct bt_message_iterator {
-       struct bt_object base;
-       enum bt_message_iterator_type type;
-       GPtrArray *msgs;
-};
-
 typedef enum bt_component_class_message_iterator_next_method_status
 (*bt_self_component_port_input_message_iterator_next_method)(
                void *, bt_message_array_const, uint64_t, uint64_t *);
@@ -88,16 +77,17 @@ typedef enum bt_component_class_message_iterator_seek_beginning_method_status
 (*bt_self_component_port_input_message_iterator_seek_beginning_method)(
                void *);
 
-typedef bt_bool
+typedef enum bt_component_class_message_iterator_can_seek_ns_from_origin_method_status
 (*bt_self_component_port_input_message_iterator_can_seek_ns_from_origin_method)(
-               void *, int64_t);
+               void *, int64_t, bt_bool *);
 
-typedef bt_bool
+typedef enum bt_component_class_message_iterator_can_seek_beginning_method_status
 (*bt_self_component_port_input_message_iterator_can_seek_beginning_method)(
-               void *);
+               void *, bt_bool *);
 
 struct bt_self_component_port_input_message_iterator {
-       struct bt_message_iterator base;
+       struct bt_object base;
+       GPtrArray *msgs;
        struct bt_component *upstream_component; /* Weak */
        struct bt_port *upstream_port; /* Weak */
        struct bt_connection *connection; /* Weak */
@@ -199,18 +189,6 @@ struct bt_self_component_port_input_message_iterator {
        void *user_data;
 };
 
-struct bt_port_output_message_iterator {
-       struct bt_message_iterator base;
-       struct bt_graph *graph; /* Owned by this */
-       struct bt_component_sink *colander; /* Owned by this */
-
-       /*
-        * Only used temporarily as a bridge between a colander sink and
-        * the user.
-        */
-       uint64_t count;
-};
-
 BT_HIDDEN
 void bt_self_component_port_input_message_iterator_try_finalize(
                struct bt_self_component_port_input_message_iterator *iterator);
@@ -226,19 +204,19 @@ const char *bt_self_component_port_input_message_iterator_state_string(
 {
        switch (state) {
        case BT_SELF_COMPONENT_PORT_INPUT_MESSAGE_ITERATOR_STATE_ACTIVE:
-               return "BT_SELF_COMPONENT_PORT_INPUT_MESSAGE_ITERATOR_STATE_ACTIVE";
+               return "ACTIVE";
        case BT_SELF_COMPONENT_PORT_INPUT_MESSAGE_ITERATOR_STATE_ENDED:
-               return "BT_SELF_COMPONENT_PORT_INPUT_MESSAGE_ITERATOR_STATE_ENDED";
+               return "ENDED";
        case BT_SELF_COMPONENT_PORT_INPUT_MESSAGE_ITERATOR_STATE_FINALIZING:
-               return "BT_SELF_COMPONENT_PORT_INPUT_MESSAGE_ITERATOR_STATE_FINALIZING";
+               return "FINALIZING";
        case BT_SELF_COMPONENT_PORT_INPUT_MESSAGE_ITERATOR_STATE_FINALIZED:
-               return "BT_SELF_COMPONENT_PORT_INPUT_MESSAGE_ITERATOR_STATE_FINALIZED";
+               return "FINALIZED";
        case BT_SELF_COMPONENT_PORT_INPUT_MESSAGE_ITERATOR_STATE_SEEKING:
-               return "BT_SELF_COMPONENT_PORT_INPUT_MESSAGE_ITERATOR_STATE_SEEKING";
+               return "SEEKING";
        case BT_SELF_COMPONENT_PORT_INPUT_MESSAGE_ITERATOR_STATE_LAST_SEEKING_RETURNED_AGAIN:
-               return "BT_SELF_COMPONENT_PORT_INPUT_MESSAGE_ITERATOR_STATE_LAST_SEEKING_RETURNED_AGAIN";
+               return "LAST_SEEKING_RETURNED_AGAIN";
        case BT_SELF_COMPONENT_PORT_INPUT_MESSAGE_ITERATOR_STATE_LAST_SEEKING_RETURNED_ERROR:
-               return "BT_SELF_COMPONENT_PORT_INPUT_MESSAGE_ITERATOR_STATE_LAST_SEEKING_RETURNED_ERROR";
+               return "LAST_SEEKING_RETURNED_ERROR";
        default:
                return "(unknown)";
        }
This page took 0.025675 seconds and 4 git commands to generate.