Always evaluate BT_ASSERT(); add BT_ASSERT_DBG() for debug mode only
[babeltrace.git] / src / bindings / python / bt2 / bt2 / native_bt_message_iterator.i.h
index 2ce15de3ee5be81403d36a2d4e6690c0d22ed41a..deb149cfafd1d132eb655e472aebb222da0d6f74 100644 (file)
  * THE SOFTWARE.
  */
 
+bt_self_component_port_input_message_iterator_create_from_message_iterator_status
+bt_bt2_self_component_port_input_message_iterator_create_from_message_iterator(
+               bt_self_message_iterator *self_msg_iter,
+               bt_self_component_port_input *input_port,
+               bt_self_component_port_input_message_iterator **message_iterator)
+{
+       bt_self_component_port_input_message_iterator_create_from_message_iterator_status
+               status;
+
+       status = bt_self_component_port_input_message_iterator_create_from_message_iterator(
+               self_msg_iter, input_port, message_iterator);
+
+       if (status != BT_SELF_COMPONENT_PORT_INPUT_MESSAGE_ITERATOR_CREATE_FROM_MESSAGE_ITERATOR_STATUS_OK) {
+               *message_iterator = NULL;
+       }
+
+       return status;
+}
+
+bt_self_component_port_input_message_iterator_create_from_sink_component_status
+bt_bt2_self_component_port_input_message_iterator_create_from_sink_component(
+               bt_self_component_sink *self_comp,
+               bt_self_component_port_input *input_port,
+               bt_self_component_port_input_message_iterator **message_iterator)
+{
+       bt_self_component_port_input_message_iterator_create_from_sink_component_status
+               status;
+
+       status = bt_self_component_port_input_message_iterator_create_from_sink_component(
+               self_comp, input_port, message_iterator);
+
+       if (status != BT_SELF_COMPONENT_PORT_INPUT_MESSAGE_ITERATOR_CREATE_FROM_SINK_COMPONENT_STATUS_OK) {
+               *message_iterator = NULL;
+       }
+
+       return status;
+}
+
 static PyObject *bt_bt2_get_user_component_from_user_msg_iter(
                bt_self_message_iterator *self_message_iterator)
 {
        bt_self_component *self_component = bt_self_message_iterator_borrow_component(self_message_iterator);
        PyObject *py_comp;
 
-       BT_ASSERT(self_component);
+       BT_ASSERT_DBG(self_component);
        py_comp = bt_self_component_get_data(self_component);
-       BT_ASSERT(py_comp);
+       BT_ASSERT_DBG(py_comp);
 
        /* Return new reference */
        Py_INCREF(py_comp);
@@ -94,15 +132,3 @@ static PyObject *bt_bt2_self_component_port_input_get_msg_range(
                &messages, &message_count);
        return get_msg_range_common(status, messages, message_count);
 }
-
-static PyObject *bt_bt2_port_output_get_msg_range(
-               bt_port_output_message_iterator *iter)
-{
-       bt_message_array_const messages;
-       uint64_t message_count = 0;
-       bt_message_iterator_next_status status;
-
-       status = bt_port_output_message_iterator_next(iter, &messages,
-               &message_count);
-       return get_msg_range_common(status, messages, message_count);
-}
This page took 0.025283 seconds and 4 git commands to generate.