lib: fully configure graph (add components, connect ports), then run
[babeltrace.git] / lib / graph / iterator.c
index 95429fb509b9cfdfcb6940b345951addf6571f76..51fa8d91f2b9d0f3170f53e4981e981858e55739 100644 (file)
@@ -751,6 +751,9 @@ bt_self_component_port_input_message_iterator_next(
                "iterator is in the wrong state: %!+i", iterator);
        BT_ASSERT(iterator->upstream_component);
        BT_ASSERT(iterator->upstream_component->class);
+       BT_ASSERT_PRE(bt_component_borrow_graph(iterator->upstream_component)->is_configured,
+               "Graph is not configured: %!+g",
+               bt_component_borrow_graph(iterator->upstream_component));
        BT_LIB_LOGD("Getting next self component input port "
                "message iterator's messages: %!+i", iterator);
        comp_cls = iterator->upstream_component->class;
@@ -843,6 +846,12 @@ enum bt_message_iterator_status bt_port_output_message_iterator_next(
        BT_LIB_LOGD("Getting next output port message iterator's messages: "
                "%!+i", iterator);
 
+       /*
+        * As soon as the user calls this function, we mark the graph as
+        * being definitely configured.
+        */
+       bt_graph_set_is_configured(iterator->graph, true);
+
        graph_status = bt_graph_consume_sink_no_check(iterator->graph,
                iterator->colander);
        switch (graph_status) {
This page took 0.025081 seconds and 4 git commands to generate.