}
if (PyErr_GivenExceptionMatches(exc, py_mod_bt2_exc_stop_type)) {
- status = BT_MESSAGE_ITERATOR_STATUS_END;
+ status = BT_SELF_MESSAGE_ITERATOR_STATUS_END;
} else if (PyErr_GivenExceptionMatches(exc, py_mod_bt2_exc_try_again_type)) {
- status = BT_MESSAGE_ITERATOR_STATUS_AGAIN;
+ status = BT_SELF_MESSAGE_ITERATOR_STATUS_AGAIN;
} else {
bt2_py_loge_exception();
- status = BT_MESSAGE_ITERATOR_STATUS_ERROR;
+ status = BT_SELF_MESSAGE_ITERATOR_STATUS_ERROR;
}
end:
bt_self_component *self_component,
bt_self_component_port_output *self_component_port_output)
{
- bt_self_message_iterator_status status = BT_MESSAGE_ITERATOR_STATUS_OK;
+ bt_self_message_iterator_status status = BT_SELF_MESSAGE_ITERATOR_STATUS_OK;
PyObject *py_comp_cls = NULL;
PyObject *py_iter_cls = NULL;
PyObject *py_iter_ptr = NULL;
+ PyObject *py_component_port_output_ptr = NULL;
PyObject *py_init_method_result = NULL;
PyObject *py_iter = NULL;
PyObject *py_comp;
/*
* Initialize object:
*
- * py_iter.__init__()
+ * py_iter.__init__(self_output_port)
+ *
+ * through the _init_for_native helper static method.
*
* At this point, py_iter._ptr is set, so this initialization
* function has access to self._component (which gives it the
* user Python component object from which the iterator was
* created).
*/
- py_init_method_result = PyObject_CallMethod(py_iter, "__init__", NULL);
+ py_component_port_output_ptr = SWIG_NewPointerObj(SWIG_as_voidptr(self_component_port_output),
+ SWIGTYPE_p_bt_self_component_port_output, 0);
+ if (!py_component_port_output_ptr) {
+ BT_LOGE_STR("Failed to create a SWIG pointer object.");
+ goto error;
+ }
+
+ py_init_method_result = PyObject_CallMethod(py_iter, "_init_from_native", "O", py_component_port_output_ptr);
if (!py_init_method_result) {
BT_LOGE_STR("User's __init__() method failed.");
bt2_py_loge_exception();
Py_XDECREF(py_comp_cls);
Py_XDECREF(py_iter_cls);
Py_XDECREF(py_iter_ptr);
+ Py_XDECREF(py_component_port_output_ptr);
Py_XDECREF(py_init_method_result);
Py_XDECREF(py_iter);
return status;
bt_message_array_const msgs, uint64_t capacity,
uint64_t *count)
{
- bt_self_message_iterator_status status = BT_MESSAGE_ITERATOR_STATUS_OK;
+ bt_self_message_iterator_status status = BT_SELF_MESSAGE_ITERATOR_STATUS_OK;
PyObject *py_message_iter = bt_self_message_iterator_get_data(message_iterator);
PyObject *py_method_result = NULL;