X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbindings%2Fpython%2Fbt2%2Fbt2%2Fnative_bt_component_class.i.h;h=15ad42900f02402d2a9327b6f7b271f5baba406b;hb=8d8b141db4c46135a35be19e4a1c192f6a36d67b;hp=26d6c217da1268647729ca6ae33562ffde197a30;hpb=c182d7dd711723dd17f6daaaed549aa9cd1351ba;p=babeltrace.git diff --git a/src/bindings/python/bt2/bt2/native_bt_component_class.i.h b/src/bindings/python/bt2/bt2/native_bt_component_class.i.h index 26d6c217..15ad4290 100644 --- a/src/bindings/python/bt2/bt2/native_bt_component_class.i.h +++ b/src/bindings/python/bt2/bt2/native_bt_component_class.i.h @@ -451,6 +451,7 @@ component_class_sink_get_supported_mip_versions( static bt_component_class_init_method_status component_class_source_init( bt_self_component_source *self_component_source, + bt_self_component_source_configuration *config, const bt_value *params, void *init_method_data) { bt_self_component *self_component = bt_self_component_source_as_self_component(self_component_source); @@ -464,6 +465,7 @@ bt_component_class_init_method_status component_class_source_init( static bt_component_class_init_method_status component_class_filter_init( bt_self_component_filter *self_component_filter, + bt_self_component_filter_configuration *config, const bt_value *params, void *init_method_data) { bt_self_component *self_component = bt_self_component_filter_as_self_component(self_component_filter); @@ -477,6 +479,7 @@ bt_component_class_init_method_status component_class_filter_init( static bt_component_class_init_method_status component_class_sink_init( bt_self_component_sink *self_component_sink, + bt_self_component_sink_configuration *config, const bt_value *params, void *init_method_data) { bt_self_component *self_component = bt_self_component_sink_as_self_component(self_component_sink); @@ -932,6 +935,7 @@ static bt_component_class_message_iterator_init_method_status component_class_message_iterator_init( bt_self_message_iterator *self_message_iterator, + bt_self_message_iterator_configuration *config, bt_self_component *self_component, bt_self_component_port_output *self_component_port_output) { @@ -939,6 +943,7 @@ component_class_message_iterator_init( PyObject *py_comp_cls = NULL; PyObject *py_iter_cls = NULL; PyObject *py_iter_ptr = NULL; + PyObject *py_config_ptr = NULL; PyObject *py_component_port_output_ptr = NULL; PyObject *py_init_method_result = NULL; PyObject *py_iter = NULL; @@ -993,15 +998,27 @@ component_class_message_iterator_init( /* * Initialize object: * - * py_iter.__init__(self_output_port) + * py_iter.__init__(config, self_output_port) * - * through the _init_for_native helper static method. + * through the _init_from_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_config_ptr = SWIG_NewPointerObj(SWIG_as_voidptr(config), + SWIGTYPE_p_bt_self_message_iterator_configuration, 0); + if (!py_config_ptr) { + const char *err = "Failed to create a SWIG pointer object"; + + BT_COMP_LOG_CUR_LVL(BT_LOG_ERROR, log_level, self_component, + "%s", err); + BT_CURRENT_THREAD_ERROR_APPEND_CAUSE_FROM_MESSAGE_ITERATOR( + self_message_iterator, err); + goto error; + } + py_component_port_output_ptr = SWIG_NewPointerObj( SWIG_as_voidptr(self_component_port_output), SWIGTYPE_p_bt_self_component_port_output, 0); @@ -1016,7 +1033,8 @@ component_class_message_iterator_init( } py_init_method_result = PyObject_CallMethod(py_iter, - "_bt_init_from_native", "O", py_component_port_output_ptr); + "_bt_init_from_native", "OO", py_config_ptr, + py_component_port_output_ptr); if (!py_init_method_result) { BT_COMP_LOG_CUR_LVL(BT_LOG_ERROR, log_level, self_component, "User's __init__() method failed:"); @@ -1071,24 +1089,30 @@ static bt_component_class_message_iterator_init_method_status component_class_source_message_iterator_init( bt_self_message_iterator *self_message_iterator, + bt_self_message_iterator_configuration *config, bt_self_component_source *self_component_source, bt_self_component_port_output *self_component_port_output) { - bt_self_component *self_component = bt_self_component_source_as_self_component(self_component_source); + bt_self_component *self_component = + bt_self_component_source_as_self_component(self_component_source); - return component_class_message_iterator_init(self_message_iterator, self_component, self_component_port_output); + return component_class_message_iterator_init(self_message_iterator, + config, self_component, self_component_port_output); } static bt_component_class_message_iterator_init_method_status component_class_filter_message_iterator_init( bt_self_message_iterator *self_message_iterator, + bt_self_message_iterator_configuration *config, bt_self_component_filter *self_component_filter, bt_self_component_port_output *self_component_port_output) { - bt_self_component *self_component = bt_self_component_filter_as_self_component(self_component_filter); + bt_self_component *self_component = + bt_self_component_filter_as_self_component(self_component_filter); - return component_class_message_iterator_init(self_message_iterator, self_component, self_component_port_output); + return component_class_message_iterator_init(self_message_iterator, + config, self_component, self_component_port_output); } static