lib: pass config objects to component init methods
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 17 Sep 2019 16:44:36 +0000 (12:44 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 25 Sep 2019 18:19:31 +0000 (14:19 -0400)
This patch introduces configuration objects that are passed to init
methods of components.  The goal is to make it possible to have
parameters that can be set during the component's init phase, and not
after.

At the moment, they are not used for anything, they are only there for
future use.  For that reason, we currently just pass the value NULL as
the config objects to the components.  This should be fine, since the
components should not do anything with the config objects for now.

Similarly, we have configuration Python objects passed to __init__
methods of _UserMessageIterator objects.  These configuration objects
are empty, but we can connect them with the corresponding SWIG pointer
once we actually add a method in them.

I added tests to verify that the config objects the components receive
have the right types.

Change-Id: If7568160e225c1eb8343eb212f8b4961f5472836
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2063
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
52 files changed:
include/babeltrace2/graph/component-class-filter.h
include/babeltrace2/graph/component-class-sink.h
include/babeltrace2/graph/component-class-source.h
include/babeltrace2/types.h
src/bindings/python/bt2/bt2/component.py
src/bindings/python/bt2/bt2/native_bt_component_class.i.h
src/bindings/python/bt2/bt2/trace_collection_message_iterator.py
src/lib/graph/component-class-sink-simple.c
src/lib/graph/graph.c
src/plugins/ctf/fs-sink/fs-sink.c
src/plugins/ctf/fs-sink/fs-sink.h
src/plugins/ctf/fs-src/fs.c
src/plugins/ctf/fs-src/fs.h
src/plugins/ctf/lttng-live/lttng-live.c
src/plugins/ctf/lttng-live/lttng-live.h
src/plugins/lttng-utils/debug-info/debug-info.c
src/plugins/lttng-utils/debug-info/debug-info.h
src/plugins/text/details/details.c
src/plugins/text/details/details.h
src/plugins/text/dmesg/dmesg.c
src/plugins/text/dmesg/dmesg.h
src/plugins/text/pretty/pretty.c
src/plugins/text/pretty/pretty.h
src/plugins/utils/counter/counter.c
src/plugins/utils/counter/counter.h
src/plugins/utils/dummy/dummy.c
src/plugins/utils/dummy/dummy.h
src/plugins/utils/muxer/muxer.c
src/plugins/utils/muxer/muxer.h
src/plugins/utils/trimmer/trimmer.c
src/plugins/utils/trimmer/trimmer.h
tests/bindings/python/bt2/test_clock_class.py
tests/bindings/python/bt2/test_component.py
tests/bindings/python/bt2/test_connection.py
tests/bindings/python/bt2/test_error.py
tests/bindings/python/bt2/test_event.py
tests/bindings/python/bt2/test_event_class.py
tests/bindings/python/bt2/test_field.py
tests/bindings/python/bt2/test_field_class.py
tests/bindings/python/bt2/test_graph.py
tests/bindings/python/bt2/test_message.py
tests/bindings/python/bt2/test_message_iterator.py
tests/bindings/python/bt2/test_port.py
tests/bindings/python/bt2/utils.py
tests/data/auto-source-discovery/grouping/bt_plugin_test.py
tests/data/auto-source-discovery/params-log-level/bt_plugin_test.py
tests/data/cli/params/bt_plugin_params.py
tests/data/plugins/flt.utils.muxer/bt_plugin_muxer_test.py
tests/data/plugins/flt.utils.trimmer/bt_plugin_trimmer_test.py
tests/lib/test_graph_topo.c
tests/lib/test_simple_sink.c
tests/lib/test_trace_ir_ref.c

index c4c5d1de2cf0f706f6a89f9759d54b06218f37bc..b95e18fc50f0b8e76ce9a4c606c1c83ae9f74dfd 100644 (file)
@@ -47,6 +47,7 @@ typedef bt_component_class_get_supported_mip_versions_method_status
 typedef bt_component_class_init_method_status
 (*bt_component_class_filter_init_method)(
                bt_self_component_filter *self_component,
+               bt_self_component_filter_configuration *config,
                const bt_value *params, void *init_method_data);
 
 typedef void (*bt_component_class_filter_finalize_method)(
index d2ebe549fdb1e86c1372173dab8710d805ae2474..3f6b1f2e56cc5c71701d9dc81f926048e5af3ca5 100644 (file)
@@ -47,6 +47,7 @@ typedef bt_component_class_get_supported_mip_versions_method_status
 typedef bt_component_class_init_method_status
 (*bt_component_class_sink_init_method)(
                bt_self_component_sink *self_component,
+               bt_self_component_sink_configuration *config,
                const bt_value *params, void *init_method_data);
 
 typedef void (*bt_component_class_sink_finalize_method)(
index 7856cea486013c5f0305733e0d8b508f5c0308bc..e523440313b36611d9026d7658b149f1d0b8edea 100644 (file)
@@ -47,6 +47,7 @@ typedef bt_component_class_get_supported_mip_versions_method_status
 typedef bt_component_class_init_method_status
 (*bt_component_class_source_init_method)(
                bt_self_component_source *self_component,
+               bt_self_component_source_configuration *config,
                const bt_value *params, void *init_method_data);
 
 typedef void (*bt_component_class_source_finalize_method)(
index 3e61f325069cb1eb052b8240eff6ad6d8e3c349e..d9b883ac85d491abd24bddadcf3a909b9b1fcd85 100644 (file)
@@ -138,12 +138,15 @@ typedef struct bt_self_component_class_filter bt_self_component_class_filter;
 typedef struct bt_self_component_class_sink bt_self_component_class_sink;
 typedef struct bt_self_component_class_source bt_self_component_class_source;
 typedef struct bt_self_component_filter bt_self_component_filter;
+typedef struct bt_self_component_filter_configuration bt_self_component_filter_configuration;
 typedef struct bt_self_component_port bt_self_component_port;
 typedef struct bt_self_component_port_input bt_self_component_port_input;
 typedef struct bt_self_component_port_input_message_iterator bt_self_component_port_input_message_iterator;
 typedef struct bt_self_component_port_output bt_self_component_port_output;
 typedef struct bt_self_component_sink bt_self_component_sink;
+typedef struct bt_self_component_sink_configuration bt_self_component_sink_configuration;
 typedef struct bt_self_component_source bt_self_component_source;
+typedef struct bt_self_component_source_configuration bt_self_component_source_configuration;
 typedef struct bt_self_message_iterator bt_self_message_iterator;
 typedef struct bt_self_plugin bt_self_plugin;
 typedef struct bt_stream bt_stream;
index a14b78e78e12bbb57eef3f1cfe5b58ea3adf9ab4..c4be7368121d6b1393b05c3db30adb7261e2e2ce 100644 (file)
@@ -510,6 +510,9 @@ class _UserComponentType(type):
         # create instance, not user-initialized yet
         self = cls.__new__(cls)
 
+        # config object
+        config = cls._config_pycls()
+
         # pointer to native self component object (weak/borrowed)
         self._bt_ptr = comp_ptr
 
@@ -519,7 +522,7 @@ class _UserComponentType(type):
         else:
             params = None
 
-        self.__init__(params, obj)
+        self.__init__(config, params, obj)
         return self
 
     def __call__(cls, *args, **kwargs):
@@ -638,6 +641,29 @@ class _UserComponentType(type):
             native_bt.bt2_unregister_cc_ptr_to_py_cls(cc_ptr)
 
 
+# Configuration objects for components.
+#
+# These are passed in __init__ to allow components to change some configuration
+# parameters during initialization and not after. As you can see, they are not
+# used at the moment, but are there in case we want to add such parameters.
+
+
+class _UserComponentConfiguration:
+    pass
+
+
+class _UserSourceComponentConfiguration(_UserComponentConfiguration):
+    pass
+
+
+class _UserFilterComponentConfiguration(_UserComponentConfiguration):
+    pass
+
+
+class _UserSinkComponentConfiguration(_UserComponentConfiguration):
+    pass
+
+
 # Subclasses must provide these methods or property:
 #
 #   - _bt_as_not_self_specific_component_ptr: static method, must return the passed
@@ -682,7 +708,7 @@ class _UserComponent(metaclass=_UserComponentType):
         ptr = self._bt_as_self_component_ptr(self._bt_ptr)
         return native_bt.self_component_get_graph_mip_version(ptr)
 
-    def __init__(self, params=None, obj=None):
+    def __init__(self, config, params, obj):
         pass
 
     def _user_finalize(self):
@@ -775,6 +801,7 @@ class _UserSourceComponent(_UserComponent, _SourceComponentConst):
     _bt_as_self_component_ptr = staticmethod(
         native_bt.self_component_source_as_self_component
     )
+    _config_pycls = _UserSourceComponentConfiguration
 
     @property
     def _output_ports(self):
@@ -808,6 +835,7 @@ class _UserFilterComponent(_UserComponent, _FilterComponentConst):
     _bt_as_self_component_ptr = staticmethod(
         native_bt.self_component_filter_as_self_component
     )
+    _config_pycls = _UserFilterComponentConfiguration
 
     @property
     def _output_ports(self):
@@ -865,6 +893,7 @@ class _UserSinkComponent(_UserComponent, _SinkComponentConst):
     _bt_as_self_component_ptr = staticmethod(
         native_bt.self_component_sink_as_self_component
     )
+    _config_pycls = _UserSinkComponentConfiguration
 
     def _bt_graph_is_configured_from_native(self):
         self._user_graph_is_configured()
index 26d6c217da1268647729ca6ae33562ffde197a30..b97193d3ee540202b95a667352acd4a5cc63be86 100644 (file)
@@ -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);
index 097e1c8b6e8b37deb3028183f861809ecf56c7af..6c1991f93f3ae3e839f55a7a7937659957e7d4d2 100644 (file)
@@ -259,7 +259,7 @@ def _get_ns(obj):
 
 
 class _TraceCollectionMessageIteratorProxySink(bt2_component._UserSinkComponent):
-    def __init__(self, params, msg_list):
+    def __init__(self, config, params, msg_list):
         assert type(msg_list) is list
         self._msg_list = msg_list
         self._add_input_port('in')
index cbf6781186d904b0d4e8d7bf8fbd2e062549fb06..6a9d2e5395464610027b78f54a0050f2b972e6e0 100644 (file)
@@ -52,7 +52,8 @@ struct simple_sink_data {
 
 static
 enum bt_component_class_init_method_status simple_sink_init(
-               struct bt_self_component_sink *self_comp,
+               bt_self_component_sink *self_comp,
+               bt_self_component_sink_configuration *config,
                const struct bt_value *params, void *init_method_data)
 {
        int status = BT_FUNC_STATUS_OK;
index 70c42c6a3f007c646bbe5fe61de8b27492ab6680..b3e41d320db112db8ac65421974c7ed96a06107d 100644 (file)
@@ -59,7 +59,7 @@ typedef enum bt_graph_listener_func_status
                const void *, void *);
 
 typedef enum bt_component_class_init_method_status
-(*comp_init_method_t)(const void *, const void *, void *);
+(*comp_init_method_t)(const void *, void *, const void *, void *);
 
 struct bt_graph_listener {
        bt_graph_listener_removed_func removed;
@@ -1330,8 +1330,12 @@ int add_component_with_init_method_data(
        bt_value_freeze(params);
 
        if (init_method) {
+               /*
+                * There is no use for config objects right now, so just pass
+                * NULL.
+                */
                BT_LOGD_STR("Calling user's initialization method.");
-               init_status = init_method(component, params, init_method_data);
+               init_status = init_method(component, NULL, params, init_method_data);
                BT_LOGD("User method returned: status=%s",
                        bt_common_func_status_string(init_status));
                if (init_status != BT_FUNC_STATUS_OK) {
index 977cc143745887456b8fb242708a25b1868c7537..88396bcfc65537acec003eb3c54dbea92c500b65 100644 (file)
@@ -169,7 +169,9 @@ end:
 
 BT_HIDDEN
 bt_component_class_init_method_status ctf_fs_sink_init(
-               bt_self_component_sink *self_comp_sink, const bt_value *params,
+               bt_self_component_sink *self_comp_sink,
+               bt_self_component_sink_configuration *config,
+               const bt_value *params,
                void *init_method_data)
 {
        bt_component_class_init_method_status status =
index d1c95c789cd1b9d10d211170ae5893e465786bef..9f39c2963c6f0361dde26d66444db7c5b367b88c 100644 (file)
@@ -68,6 +68,7 @@ struct fs_sink_comp {
 BT_HIDDEN
 bt_component_class_init_method_status ctf_fs_sink_init(
                bt_self_component_sink *component,
+               bt_self_component_sink_configuration *config,
                const bt_value *params,
                void *init_method_data);
 
index cf3cc7145c7ccbd73b7143de70230c3c313f57c5..83df6dbed98e06af7cb02e8ecdd73c61b2693163 100644 (file)
@@ -2391,6 +2391,7 @@ end:
 BT_HIDDEN
 bt_component_class_init_method_status ctf_fs_init(
                bt_self_component_source *self_comp_src,
+               bt_self_component_source_configuration *config,
                const bt_value *params, __attribute__((unused)) void *init_method_data)
 {
        struct ctf_fs_component *ctf_fs;
index 10a17ba8e08a6552135c719f1ea26ba9e1a47929..e48c1469a613c4b5cc16e12c3d99c081f040f379 100644 (file)
@@ -199,6 +199,7 @@ struct ctf_fs_msg_iter_data {
 BT_HIDDEN
 bt_component_class_init_method_status ctf_fs_init(
                bt_self_component_source *source,
+               bt_self_component_source_configuration *config,
                const bt_value *params, void *init_method_data);
 
 BT_HIDDEN
index b804fbd505bdd5d77fe172fcee4d8fbdae47fb34..a79d02b10d3f7abb87c462c2dddf764cb6a04e94 100644 (file)
@@ -1841,7 +1841,9 @@ end:
 BT_HIDDEN
 bt_component_class_init_method_status lttng_live_component_init(
                bt_self_component_source *self_comp_src,
-               const bt_value *params, __attribute__((unused)) void *init_method_data)
+               bt_self_component_source_configuration *config,
+               const bt_value *params,
+               __attribute__((unused)) void *init_method_data)
 {
        struct lttng_live_component *lttng_live;
        bt_component_class_init_method_status ret =
index 967344dcc1909f100b60c764d78baccb52a67978..57de598b974473c95e7798b9bc434ff8857d5f23 100644 (file)
@@ -262,6 +262,7 @@ enum lttng_live_iterator_status {
 
 bt_component_class_init_method_status lttng_live_component_init(
                bt_self_component_source *self_comp,
+               bt_self_component_source_configuration *config,
                const bt_value *params, void *init_method_data);
 
 bt_component_class_query_method_status lttng_live_query(
index 58809eb2e2aca4ab24c7d26f90f348805cdd8be2..c481f8bf77b5fa930851249ff60c24006968f792 100644 (file)
@@ -1748,6 +1748,7 @@ int init_from_params(struct debug_info_component *debug_info_component,
 BT_HIDDEN
 bt_component_class_init_method_status debug_info_comp_init(
                bt_self_component_filter *self_comp_flt,
+               bt_self_component_filter_configuration *config,
                const bt_value *params, __attribute__((unused)) void *init_method_data)
 {
        int ret;
index 6319545b87dd67b9be62fdd01acf6ab0c886afdc..1c2d106bb27397109af8c59684f6f6324e4fadf2 100644 (file)
@@ -37,6 +37,7 @@
 BT_HIDDEN
 bt_component_class_init_method_status debug_info_comp_init(
                bt_self_component_filter *self_comp,
+               bt_self_component_filter_configuration *config,
                const bt_value *params, void *init_method_data);
 
 BT_HIDDEN
index 9c45e39e4bacbaaf95ed0fc87b84ee3294b29267..5093aca4fea4824ab687264bd9682490f53b484c 100644 (file)
@@ -388,7 +388,9 @@ void log_configuration(bt_self_component_sink *comp,
 }
 
 BT_HIDDEN
-bt_component_class_init_method_status details_init(bt_self_component_sink *comp,
+bt_component_class_init_method_status details_init(
+               bt_self_component_sink *comp,
+               bt_self_component_sink_configuration *config,
                const bt_value *params,
                __attribute__((unused)) void *init_method_data)
 {
index dd52098c61beea8eef87e9d64f16a67b48ad2fab..45b09868ba9215e16584fec6b16c64907aaaabb9 100644 (file)
@@ -163,6 +163,7 @@ struct details_comp {
 BT_HIDDEN
 bt_component_class_init_method_status details_init(
                bt_self_component_sink *component,
+               bt_self_component_sink_configuration *config,
                const bt_value *params, void *init_method_data);
 
 BT_HIDDEN
index 4a131ea3c31169ce64f4b26c64d49674053be0df..9f22ac868cceb250235267bbd05e41457950ea6f 100644 (file)
@@ -383,6 +383,7 @@ bt_component_class_init_method_status create_port(
 BT_HIDDEN
 bt_component_class_init_method_status dmesg_init(
                bt_self_component_source *self_comp_src,
+               bt_self_component_source_configuration *config,
                bt_value *params, void *init_method_data)
 {
        int ret = 0;
index b72f47947f96ea6e707456b5e3dc0d02b869d6ab..f74b3b26b1357077afa3b8e18cdf9a9d42d6cd6b 100644 (file)
@@ -30,6 +30,7 @@
 BT_HIDDEN
 bt_component_class_init_method_status dmesg_init(
                bt_self_component_source *self_comp,
+               bt_self_component_source_configuration *config,
                const bt_value *params, void *init_method_data);
 
 BT_HIDDEN
index 2bf9f7b741390156d7476796935997bbe8e57ac5..1e2000ee241148f2a50101928c7da7f0b20dea04 100644 (file)
@@ -614,7 +614,9 @@ void set_use_colors(struct pretty_component *pretty)
 
 BT_HIDDEN
 bt_component_class_init_method_status pretty_init(
-               bt_self_component_sink *comp, const bt_value *params,
+               bt_self_component_sink *comp,
+               bt_self_component_sink_configuration *config,
+               const bt_value *params,
                __attribute__((unused)) void *init_method_data)
 {
        bt_component_class_init_method_status ret =
index cffe7ca7d237ee4ea28c3458c2d59e995ab0b7a5..0299125989335708f7e871f210b39b1b72cccda0 100644 (file)
@@ -94,7 +94,9 @@ struct pretty_component {
 
 BT_HIDDEN
 bt_component_class_init_method_status pretty_init(
-               bt_self_component_sink *component, const bt_value *params,
+               bt_self_component_sink *component,
+               bt_self_component_sink_configuration *config,
+               const bt_value *params,
                void *init_method_data);
 
 BT_HIDDEN
index bf0e4a575f03d99499c84051889f4009a38dfba0..f2cdd1a926337ef7df88ce3b566c034c8a3fefdd 100644 (file)
@@ -138,6 +138,7 @@ void counter_finalize(bt_self_component_sink *comp)
 BT_HIDDEN
 bt_component_class_init_method_status counter_init(
                bt_self_component_sink *component,
+               bt_self_component_sink_configuration *config,
                const bt_value *params,
                __attribute__((unused)) void *init_method_data)
 {
index f47eb3b132af9d9d24f6bad8e7f319e70b336976..3e2fd4e63e42a8ea264689bdd7a2e767a358ff3a 100644 (file)
@@ -53,6 +53,7 @@ struct counter {
 BT_HIDDEN
 bt_component_class_init_method_status counter_init(
                bt_self_component_sink *component,
+               bt_self_component_sink_configuration *config,
                const bt_value *params, void *init_method_data);
 
 BT_HIDDEN
index d41551de78c075ae5f62ae66da0848868933593a..20dab79916a54f973ee50d3691422c2f3f4796df 100644 (file)
@@ -50,6 +50,7 @@ void dummy_finalize(bt_self_component_sink *comp)
 BT_HIDDEN
 bt_component_class_init_method_status dummy_init(
                bt_self_component_sink *component,
+               bt_self_component_sink_configuration *config,
                const bt_value *params,
                __attribute__((unused)) void *init_method_data)
 {
index c5ab55ae24df94df1327bfef2ef2fc919e2246c8..7801294f751c306869b3fcb6ea6d4e904f3c0cf0 100644 (file)
@@ -35,6 +35,7 @@ struct dummy {
 BT_HIDDEN
 bt_component_class_init_method_status dummy_init(
                bt_self_component_sink *component,
+               bt_self_component_sink_configuration *config,
                const bt_value *params, void *init_method_data);
 
 BT_HIDDEN
index 12485df8cd8cda896b62d42bf6bf508f05c654c4..7404e1e4ab023a78e9e58ce4b2abfc77c6f88a01 100644 (file)
@@ -249,6 +249,7 @@ void destroy_muxer_comp(struct muxer_comp *muxer_comp)
 BT_HIDDEN
 bt_component_class_init_method_status muxer_init(
                bt_self_component_filter *self_comp_flt,
+               bt_self_component_filter_configuration *config,
                const bt_value *params, void *init_data)
 {
        bt_component_class_init_method_status status =
index 72e8b762bc71c954e5de539d59639ecc73080121..8c3f7f4812a7d61b322ec8c138a5a623fcd3342a 100644 (file)
@@ -31,6 +31,7 @@
 BT_HIDDEN
 bt_component_class_init_method_status muxer_init(
                bt_self_component_filter *self_comp,
+               bt_self_component_filter_configuration *config,
                const bt_value *params, void *init_data);
 
 BT_HIDDEN
index 4d39fba27cdbd662e5d1df2e21c830e6a7fb66e3..92fad09b6b43c721f67c9d40fa57cbdee43ee42c 100644 (file)
@@ -563,6 +563,7 @@ end:
 
 bt_component_class_init_method_status trimmer_init(
                bt_self_component_filter *self_comp_flt,
+               bt_self_component_filter_configuration *config,
                const bt_value *params, void *init_data)
 {
        int ret;
index c29a89f4515ab338121cdeaf4ed469a821373116..34d45efa255c8ec21a13495bfee5e9329a7bec3b 100644 (file)
@@ -35,7 +35,9 @@ BT_HIDDEN
 void trimmer_finalize(bt_self_component_filter *self_comp);
 
 BT_HIDDEN
-bt_component_class_init_method_status trimmer_init(bt_self_component_filter *self_comp,
+bt_component_class_init_method_status trimmer_init(
+               bt_self_component_filter *self_comp,
+               bt_self_component_filter_configuration *config,
                const bt_value *params, void *init_data);
 
 BT_HIDDEN
index b9d25e54b0f970e1edb10172c6ffd8b0b73d6c53..26571bd40bd06b470ee186c4ec79c5cd3d4e116c 100644 (file)
@@ -266,7 +266,7 @@ class ClockSnapshotTestCase(unittest.TestCase):
                 return notif
 
         class MySrc(bt2._UserSourceComponent, message_iterator_class=MyIter):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_output_port('out')
 
         self._graph = bt2.Graph()
index 2a3856b98063e8e15c2b34a2b650d72a42c72ea6..c215c44d36c29e0b86de1249bd39c7f9197c2333 100644 (file)
@@ -18,6 +18,7 @@
 
 import unittest
 import bt2
+from bt2 import component as bt2_component
 
 
 class UserComponentTestCase(unittest.TestCase):
@@ -32,7 +33,7 @@ class UserComponentTestCase(unittest.TestCase):
 
     def test_name(self):
         class MySink(bt2._UserSinkComponent):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 self.assertEqual(comp_self.name, 'yaes')
 
             def _user_consume(self):
@@ -42,7 +43,7 @@ class UserComponentTestCase(unittest.TestCase):
 
     def test_logging_level(self):
         class MySink(bt2._UserSinkComponent):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 self.assertEqual(comp_self.logging_level, bt2.LoggingLevel.INFO)
 
             def _user_consume(self):
@@ -52,7 +53,7 @@ class UserComponentTestCase(unittest.TestCase):
 
     def test_graph_mip_version(self):
         class MySink(bt2._UserSinkComponent):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 self.assertEqual(comp_self._graph_mip_version, 0)
 
             def _user_consume(self):
@@ -62,7 +63,7 @@ class UserComponentTestCase(unittest.TestCase):
 
     def test_class(self):
         class MySink(bt2._UserSinkComponent):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 self.assertEqual(comp_self.cls, MySink)
 
             def _user_consume(self):
@@ -72,7 +73,7 @@ class UserComponentTestCase(unittest.TestCase):
 
     def test_addr(self):
         class MySink(bt2._UserSinkComponent):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 self.assertIsInstance(comp_self.addr, int)
                 self.assertNotEqual(comp_self.addr, 0)
 
@@ -99,6 +100,43 @@ class UserComponentTestCase(unittest.TestCase):
         del comp
         self.assertTrue(finalized)
 
+    def test_source_component_config(self):
+        class MySource(
+            bt2._UserSourceComponent, message_iterator_class=bt2._UserMessageIterator
+        ):
+            def __init__(comp_self, config, params, obj):
+                nonlocal cfg_type
+                cfg_type = type(config)
+
+        cfg_type = None
+        self._create_comp(MySource)
+        self.assertIs(cfg_type, bt2_component._UserSourceComponentConfiguration)
+
+    def test_filter_component_config(self):
+        class MyFilter(
+            bt2._UserFilterComponent, message_iterator_class=bt2._UserMessageIterator
+        ):
+            def __init__(comp_self, config, params, obj):
+                nonlocal cfg_type
+                cfg_type = type(config)
+
+        cfg_type = None
+        self._create_comp(MyFilter)
+        self.assertIs(cfg_type, bt2_component._UserFilterComponentConfiguration)
+
+    def test_sink_component_config(self):
+        class MySink(bt2._UserSinkComponent):
+            def __init__(comp_self, config, params, obj):
+                nonlocal cfg_type
+                cfg_type = type(config)
+
+            def _user_consume(self):
+                pass
+
+        cfg_type = None
+        self._create_comp(MySink)
+        self.assertIs(cfg_type, bt2_component._UserSinkComponentConfiguration)
+
 
 class GenericComponentTestCase(unittest.TestCase):
     @staticmethod
index 33b18951c69fdba28f18c50839b01f99928c68d5..539f7bcb2fa3cbaea387da988c9a355cf12b3e60 100644 (file)
@@ -29,11 +29,11 @@ class ConnectionTestCase(unittest.TestCase):
                 raise bt2.Stop
 
         class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_output_port('out')
 
         class MySink(bt2._UserSinkComponent):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_input_port('in')
 
             def _user_consume(self):
@@ -51,11 +51,11 @@ class ConnectionTestCase(unittest.TestCase):
                 raise bt2.Stop
 
         class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_output_port('out')
 
         class MySink(bt2._UserSinkComponent):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_input_port('in')
 
             def _user_consume(self):
@@ -75,11 +75,11 @@ class ConnectionTestCase(unittest.TestCase):
                 raise bt2.Stop
 
         class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_output_port('out')
 
         class MySink(bt2._UserSinkComponent):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_input_port('in')
 
             def _user_consume(self):
index 0bdd6ce3673a2c92c434299507bf6bd464307c77..6ec5fd89962c47f45b674727057cdcd1f1f8cb9f 100644 (file)
@@ -29,19 +29,19 @@ class FailingIter(bt2._UserMessageIterator):
 class SourceWithFailingIter(
     bt2._UserSourceComponent, message_iterator_class=FailingIter
 ):
-    def __init__(self, params, obj):
+    def __init__(self, config, params, obj):
         self._add_output_port('out')
 
 
 class SourceWithFailingInit(
     bt2._UserSourceComponent, message_iterator_class=FailingIter
 ):
-    def __init__(self, params, obj):
+    def __init__(self, config, params, obj):
         raise ValueError('Source is failing')
 
 
 class WorkingSink(bt2._UserSinkComponent):
-    def __init__(self, params, obj):
+    def __init__(self, config, params, obj):
         self._in = self._add_input_port('in')
 
     def _user_graph_is_configured(self):
@@ -52,7 +52,7 @@ class WorkingSink(bt2._UserSinkComponent):
 
 
 class SinkWithExceptionChaining(bt2._UserSinkComponent):
-    def __init__(self, params, obj):
+    def __init__(self, config, params, obj):
         self._in = self._add_input_port('in')
 
     def _user_graph_is_configured(self):
index 9c71c0204e182f0ca8c711d8d9810f7a5e5539ca..b6b17ade0c3a7c6c17a801bcbda6b89af73d8553 100644 (file)
@@ -81,7 +81,7 @@ class EventTestCase(unittest.TestCase):
                 return msg
 
         class MySrc(bt2._UserSourceComponent, message_iterator_class=MyIter):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_output_port('out')
                 tc = self._create_trace_class()
 
index f2cf52cb47afba28e273bd73de3a975297ce1eb0..6a6eb4cb81308c55300ef07c828fe18bd17520f5 100644 (file)
@@ -50,7 +50,7 @@ def _create_const_event_class(tc, stream_class):
             return self._msgs.pop(0)
 
     class MySrc(bt2._UserSourceComponent, message_iterator_class=MyIter):
-        def __init__(self, params, obj):
+        def __init__(self, config, params, obj):
             self._add_output_port('out', params)
 
     graph = bt2.Graph()
index ecf0194c3b7d589b036a82bf364f17e26a9e8be8..6271b7706f52803b60a7d7e1ba45542c04431796 100644 (file)
@@ -93,7 +93,7 @@ def _create_const_field(tc, field_class, field_value_setter_fn):
             return self._msgs.pop(0)
 
     class MySrc(bt2._UserSourceComponent, message_iterator_class=MyIter):
-        def __init__(self, params, obj):
+        def __init__(self, config, params, obj):
             self._add_output_port('out', params)
 
     graph = bt2.Graph()
index 1d883eea061aa78654c1cd84440cf63bf70afee9..3a383fddd7ff911c92035562754b3e98f7005013 100644 (file)
@@ -61,7 +61,7 @@ def _create_const_field_class(tc, field_class, value_setter_fn):
             return self._msgs.pop(0)
 
     class MySrc(bt2._UserSourceComponent, message_iterator_class=MyIter):
-        def __init__(self, params, obj):
+        def __init__(self, config, params, obj):
             self._add_output_port('out', params)
 
     graph = bt2.Graph()
index d304169e1b7ab6843ac849b2aeec6de43a16e1c6..347f8803dba0768e946e9b2de59e81f7fe78958f 100644 (file)
@@ -87,7 +87,7 @@ class GraphTestCase(unittest.TestCase):
         comp_params = None
 
         class MySink(bt2._UserSinkComponent):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 nonlocal comp_params
                 comp_params = params
 
@@ -103,7 +103,7 @@ class GraphTestCase(unittest.TestCase):
         comp_obj = None
 
         class MySink(bt2._UserSinkComponent):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 nonlocal comp_obj
                 comp_obj = obj
 
@@ -119,7 +119,7 @@ class GraphTestCase(unittest.TestCase):
         comp_obj = None
 
         class MySink(bt2._UserSinkComponent):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 nonlocal comp_obj
                 comp_obj = obj
 
@@ -175,11 +175,11 @@ class GraphTestCase(unittest.TestCase):
                 raise bt2.Stop
 
         class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_output_port('out')
 
         class MySink(bt2._UserSinkComponent):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_input_port('in')
 
             def _user_consume(self):
@@ -202,11 +202,11 @@ class GraphTestCase(unittest.TestCase):
                 raise bt2.Stop
 
         class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_output_port('out')
 
         class MySink(bt2._UserSinkComponent):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_input_port('in')
 
             def _user_consume(self):
@@ -224,11 +224,11 @@ class GraphTestCase(unittest.TestCase):
                 raise TypeError
 
         class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_output_port('out')
 
         class MySink(bt2._UserSinkComponent):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_input_port('in')
 
             def _user_consume(self):
@@ -269,11 +269,11 @@ class GraphTestCase(unittest.TestCase):
                 return self._create_stream_beginning_message(self._stream)
 
         class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_output_port('out')
 
         class MySink(bt2._UserSinkComponent):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_input_port('in')
 
             def _user_consume(self):
@@ -316,11 +316,11 @@ class GraphTestCase(unittest.TestCase):
                 return msg
 
         class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_output_port('out')
 
         class MySink(bt2._UserSinkComponent):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._input_port = self._add_input_port('in')
                 self._at = 0
 
@@ -356,11 +356,11 @@ class GraphTestCase(unittest.TestCase):
             pass
 
         class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_output_port('out')
 
         class MySink(bt2._UserSinkComponent):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._input_port = self._add_input_port('in')
 
             def _user_consume(comp_self):
@@ -383,11 +383,11 @@ class GraphTestCase(unittest.TestCase):
             pass
 
         class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_output_port('out')
 
         class MySink(bt2._UserSinkComponent):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._input_port = self._add_input_port('in')
 
             def _user_consume(comp_self):
@@ -417,11 +417,11 @@ class GraphTestCase(unittest.TestCase):
                 return msg
 
         class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_output_port('out')
 
         class MySink(bt2._UserSinkComponent):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._input_port = self._add_input_port('in')
                 self._at = 0
 
@@ -473,11 +473,11 @@ class GraphTestCase(unittest.TestCase):
                 return msg
 
         class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_output_port('out')
 
         class MySink(bt2._UserSinkComponent):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._input_port = self._add_input_port('in')
                 self._at = 0
 
@@ -514,12 +514,12 @@ class GraphTestCase(unittest.TestCase):
                 raise bt2.Stop
 
         class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_output_port('out')
                 self._add_output_port('zero')
 
         class MySink(bt2._UserSinkComponent):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_input_port('in')
 
             def _user_consume(self):
@@ -583,12 +583,12 @@ class GraphTestCase(unittest.TestCase):
                 raise bt2.Stop
 
         class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_output_port('out')
                 self._add_output_port('zero')
 
         class MySink(bt2._UserSinkComponent):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_input_port('in')
 
             def _user_consume(self):
@@ -604,7 +604,7 @@ class GraphTestCase(unittest.TestCase):
 
     def test_raise_in_component_init(self):
         class MySink(bt2._UserSinkComponent):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 raise ValueError('oops!')
 
             def _user_consume(self):
@@ -617,7 +617,7 @@ class GraphTestCase(unittest.TestCase):
 
     def test_raise_in_port_added_listener(self):
         class MySink(bt2._UserSinkComponent):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_input_port('in')
 
             def _user_consume(self):
@@ -638,11 +638,11 @@ class GraphTestCase(unittest.TestCase):
                 raise bt2.Stop
 
         class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_output_port('out')
 
         class MySink(bt2._UserSinkComponent):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_input_port('in')
 
             def _user_consume(self):
index 6000a0fa972404e3b0cd55c0f38a8ddfef680bf1..e58e52451d708648012ab2d514bbaf8a2d178eee 100644 (file)
@@ -119,7 +119,7 @@ class AllMessagesTestCase(unittest.TestCase):
                 return msg
 
         class MySrc(bt2._UserSourceComponent, message_iterator_class=MyIter):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_output_port('out', params)
 
                 with_cc = bool(params['with_cc'])
index 195eb7712d8c5a30945f4480228715b592831a70..39d808887988a6111ea97a78a6c4b957898fcc29 100644 (file)
@@ -27,7 +27,7 @@ class SimpleSink(bt2._UserSinkComponent):
     # Straightforward sink that creates one input port (`in`) and consumes from
     # it.
 
-    def __init__(self, params, obj):
+    def __init__(self, config, params, obj):
         self._add_input_port('in')
 
     def _user_consume(self):
@@ -68,7 +68,7 @@ class UserMessageIteratorTestCase(unittest.TestCase):
                 the_output_port_from_iter = self_port_output
 
         class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 nonlocal the_output_port_from_source
                 the_output_port_from_source = self._add_output_port('out', 'user data')
 
@@ -88,7 +88,7 @@ class UserMessageIteratorTestCase(unittest.TestCase):
                 src_iter_initialized = True
 
         class MySource(bt2._UserSourceComponent, message_iterator_class=MySourceIter):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_output_port('out')
 
         class MyFilterIter(bt2._UserMessageIterator):
@@ -103,7 +103,7 @@ class UserMessageIteratorTestCase(unittest.TestCase):
                 return next(self._up_iter)
 
         class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyFilterIter):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_input_port('in')
                 self._add_output_port('out')
 
@@ -124,7 +124,7 @@ class UserMessageIteratorTestCase(unittest.TestCase):
                 raise ValueError('Very bad error')
 
         class MySource(bt2._UserSourceComponent, message_iterator_class=MySourceIter):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_output_port('out')
 
         class MyFilterIter(bt2._UserMessageIterator):
@@ -136,7 +136,7 @@ class UserMessageIteratorTestCase(unittest.TestCase):
                 )
 
         class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyFilterIter):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_input_port('in')
                 self._add_output_port('out')
 
@@ -160,7 +160,7 @@ class UserMessageIteratorTestCase(unittest.TestCase):
                 finalized = True
 
         class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_output_port('out')
 
         finalized = False
@@ -176,7 +176,7 @@ class UserMessageIteratorTestCase(unittest.TestCase):
                 salut = self._component._salut
 
         class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_output_port('out')
                 self._salut = 23
 
@@ -196,7 +196,7 @@ class UserMessageIteratorTestCase(unittest.TestCase):
                 self.assertEqual(self_port_output.addr, port.addr)
 
         class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_output_port('out')
 
         called = False
@@ -211,7 +211,7 @@ class UserMessageIteratorTestCase(unittest.TestCase):
                 addr = self.addr
 
         class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_output_port('out')
 
         addr = None
@@ -244,7 +244,7 @@ class UserMessageIteratorTestCase(unittest.TestCase):
                 return self._msgs.pop(0)
 
         class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 tc = self._create_trace_class()
                 sc = tc.create_stream_class(supports_packets=True)
                 ec = sc.create_event_class()
@@ -276,7 +276,7 @@ class UserMessageIteratorTestCase(unittest.TestCase):
                 raise bt2.TryAgain
 
         class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_output_port('out')
 
         class MyFilterIter(bt2._UserMessageIterator):
@@ -296,7 +296,7 @@ class UserMessageIteratorTestCase(unittest.TestCase):
                 return self._upstream_iter.can_seek_beginning()
 
         class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyFilterIter):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 input_port = self._add_input_port('in')
                 self._add_output_port('out', input_port)
 
@@ -359,7 +359,7 @@ def _setup_seek_test(
         MySourceIter._user_can_seek_ns_from_origin = user_can_seek_ns_from_origin
 
     class MySource(bt2._UserSourceComponent, message_iterator_class=MySourceIter):
-        def __init__(self, params, obj):
+        def __init__(self, config, params, obj):
             tc = self._create_trace_class()
             sc = tc.create_stream_class(supports_packets=True)
             ec = sc.create_event_class()
@@ -388,7 +388,7 @@ def _setup_seek_test(
             self._upstream_iter.seek_ns_from_origin(ns_from_origin)
 
     class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyFilterIter):
-        def __init__(self, params, obj):
+        def __init__(self, config, params, obj):
             self._add_input_port('in')
             self._add_output_port('out')
 
@@ -398,7 +398,7 @@ def _setup_seek_test(
 class UserMessageIteratorSeekBeginningTestCase(unittest.TestCase):
     def test_can_seek_beginning(self):
         class MySink(bt2._UserSinkComponent):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_input_port('in')
 
             def _user_graph_is_configured(self):
@@ -432,7 +432,7 @@ class UserMessageIteratorSeekBeginningTestCase(unittest.TestCase):
         # Test an iterator without a _user_can_seek_beginning method, but with
         # a _user_seek_beginning method.
         class MySink(bt2._UserSinkComponent):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_input_port('in')
 
             def _user_graph_is_configured(self):
@@ -456,7 +456,7 @@ class UserMessageIteratorSeekBeginningTestCase(unittest.TestCase):
         # Test an iterator without a _user_can_seek_beginning method, without
         # a _user_seek_beginning method.
         class MySink(bt2._UserSinkComponent):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_input_port('in')
 
             def _user_graph_is_configured(self):
@@ -475,7 +475,7 @@ class UserMessageIteratorSeekBeginningTestCase(unittest.TestCase):
 
     def test_can_seek_beginning_user_error(self):
         class MySink(bt2._UserSinkComponent):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_input_port('in')
 
             def _user_graph_is_configured(self):
@@ -502,7 +502,7 @@ class UserMessageIteratorSeekBeginningTestCase(unittest.TestCase):
 
     def test_can_seek_beginning_wrong_return_value(self):
         class MySink(bt2._UserSinkComponent):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_input_port('in')
 
             def _user_graph_is_configured(self):
@@ -529,7 +529,7 @@ class UserMessageIteratorSeekBeginningTestCase(unittest.TestCase):
 
     def test_seek_beginning(self):
         class MySink(bt2._UserSinkComponent):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_input_port('in')
 
             def _user_graph_is_configured(self):
@@ -573,7 +573,7 @@ class UserMessageIteratorSeekBeginningTestCase(unittest.TestCase):
 
     def test_seek_beginning_user_error(self):
         class MySink(bt2._UserSinkComponent):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_input_port('in')
 
             def _user_graph_is_configured(self):
@@ -596,7 +596,7 @@ class UserMessageIteratorSeekBeginningTestCase(unittest.TestCase):
 class UserMessageIteratorSeekNsFromOriginTestCase(unittest.TestCase):
     def test_can_seek_ns_from_origin(self):
         class MySink(bt2._UserSinkComponent):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_input_port('in')
 
             def _user_graph_is_configured(self):
@@ -637,7 +637,7 @@ class UserMessageIteratorSeekNsFromOriginTestCase(unittest.TestCase):
         # Test an iterator without a _user_can_seek_ns_from_origin method, but
         # with a _user_seek_ns_from_origin method.
         class MySink(bt2._UserSinkComponent):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_input_port('in')
 
             def _user_graph_is_configured(self):
@@ -667,7 +667,7 @@ class UserMessageIteratorSeekNsFromOriginTestCase(unittest.TestCase):
         # Test an iterator without a _user_can_seek_ns_from_origin method, but
         # with a _user_seek_beginning method.
         class MySink(bt2._UserSinkComponent):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_input_port('in')
 
             def _user_graph_is_configured(self):
@@ -695,7 +695,7 @@ class UserMessageIteratorSeekNsFromOriginTestCase(unittest.TestCase):
         # Test an iterator without a _user_can_seek_ns_from_origin method
         # and no other related method.
         class MySink(bt2._UserSinkComponent):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_input_port('in')
 
             def _user_graph_is_configured(self):
@@ -718,7 +718,7 @@ class UserMessageIteratorSeekNsFromOriginTestCase(unittest.TestCase):
 
     def test_can_seek_ns_from_origin_user_error(self):
         class MySink(bt2._UserSinkComponent):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_input_port('in')
 
             def _user_graph_is_configured(self):
@@ -745,7 +745,7 @@ class UserMessageIteratorSeekNsFromOriginTestCase(unittest.TestCase):
 
     def test_can_seek_ns_from_origin_wrong_return_value(self):
         class MySink(bt2._UserSinkComponent):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_input_port('in')
 
             def _user_graph_is_configured(self):
@@ -772,7 +772,7 @@ class UserMessageIteratorSeekNsFromOriginTestCase(unittest.TestCase):
 
     def test_seek_ns_from_origin(self):
         class MySink(bt2._UserSinkComponent):
-            def __init__(self, params, obj):
+            def __init__(self, config, params, obj):
                 self._add_input_port('in')
 
             def _user_graph_is_configured(self):
index dab6c536b4e524716e43dcfe2a70964f4d3d0ec6..53fdf9c79168a81d99cdcd4c65f602c9e62a7c01 100644 (file)
@@ -37,7 +37,7 @@ class PortTestCase(unittest.TestCase):
                 raise bt2.Stop
 
         class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 port = comp_self._add_output_port('out')
                 self.assertEqual(port.name, 'out')
 
@@ -51,7 +51,7 @@ class PortTestCase(unittest.TestCase):
                 raise bt2.Stop
 
         class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 port = comp_self._add_output_port('out')
                 self.assertEqual(port.name, 'out')
 
@@ -64,7 +64,7 @@ class PortTestCase(unittest.TestCase):
                 raise bt2.Stop
 
         class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 port = comp_self._add_input_port('in')
                 self.assertEqual(port.name, 'in')
 
@@ -74,7 +74,7 @@ class PortTestCase(unittest.TestCase):
 
     def test_sink_add_input_port(self):
         class MySink(bt2._UserSinkComponent):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 port = comp_self._add_input_port('in')
                 self.assertEqual(port.name, 'in')
 
@@ -90,7 +90,7 @@ class PortTestCase(unittest.TestCase):
                 raise bt2.Stop
 
         class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 port1 = comp_self._add_output_port('clear')
                 port2 = comp_self._add_output_port('print')
                 port3 = comp_self._add_output_port('insert')
@@ -106,7 +106,7 @@ class PortTestCase(unittest.TestCase):
                 raise bt2.Stop
 
         class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 port1 = comp_self._add_output_port('clear')
                 port2 = comp_self._add_output_port('print')
                 port3 = comp_self._add_output_port('insert')
@@ -122,7 +122,7 @@ class PortTestCase(unittest.TestCase):
                 raise bt2.Stop
 
         class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 port1 = comp_self._add_input_port('clear')
                 port2 = comp_self._add_input_port('print')
                 port3 = comp_self._add_input_port('insert')
@@ -134,7 +134,7 @@ class PortTestCase(unittest.TestCase):
 
     def test_user_sink_input_ports_getitem(self):
         class MySink(bt2._UserSinkComponent):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 port1 = comp_self._add_input_port('clear')
                 port2 = comp_self._add_input_port('print')
                 port3 = comp_self._add_input_port('insert')
@@ -153,7 +153,7 @@ class PortTestCase(unittest.TestCase):
                 raise bt2.Stop
 
         class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 comp_self._add_output_port('clear')
                 comp_self._add_output_port('print')
                 comp_self._add_output_port('insert')
@@ -169,7 +169,7 @@ class PortTestCase(unittest.TestCase):
                 raise bt2.Stop
 
         class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 comp_self._add_output_port('clear')
                 comp_self._add_output_port('print')
                 comp_self._add_output_port('insert')
@@ -185,7 +185,7 @@ class PortTestCase(unittest.TestCase):
                 raise bt2.Stop
 
         class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 comp_self._add_input_port('clear')
                 comp_self._add_input_port('print')
                 comp_self._add_input_port('insert')
@@ -197,7 +197,7 @@ class PortTestCase(unittest.TestCase):
 
     def test_user_sink_input_ports_getitem_invalid_key(self):
         class MySink(bt2._UserSinkComponent):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 comp_self._add_input_port('clear')
                 comp_self._add_input_port('print')
                 comp_self._add_input_port('insert')
@@ -216,7 +216,7 @@ class PortTestCase(unittest.TestCase):
                 raise bt2.Stop
 
         class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 comp_self._add_output_port('clear')
                 comp_self._add_output_port('print')
                 comp_self._add_output_port('insert')
@@ -230,7 +230,7 @@ class PortTestCase(unittest.TestCase):
                 raise bt2.Stop
 
         class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 comp_self._add_output_port('clear')
                 comp_self._add_output_port('print')
                 comp_self._add_output_port('insert')
@@ -244,7 +244,7 @@ class PortTestCase(unittest.TestCase):
                 raise bt2.Stop
 
         class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 comp_self._add_input_port('clear')
                 comp_self._add_input_port('print')
                 comp_self._add_input_port('insert')
@@ -254,7 +254,7 @@ class PortTestCase(unittest.TestCase):
 
     def test_user_sink_input_ports_len(self):
         class MySink(bt2._UserSinkComponent):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 comp_self._add_input_port('clear')
                 comp_self._add_input_port('print')
                 comp_self._add_input_port('insert')
@@ -271,7 +271,7 @@ class PortTestCase(unittest.TestCase):
                 raise bt2.Stop
 
         class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 port1 = comp_self._add_output_port('clear')
                 port2 = comp_self._add_output_port('print')
                 port3 = comp_self._add_output_port('insert')
@@ -295,7 +295,7 @@ class PortTestCase(unittest.TestCase):
                 raise bt2.Stop
 
         class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 port1 = comp_self._add_output_port('clear')
                 port2 = comp_self._add_output_port('print')
                 port3 = comp_self._add_output_port('insert')
@@ -319,7 +319,7 @@ class PortTestCase(unittest.TestCase):
                 raise bt2.Stop
 
         class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 port1 = comp_self._add_input_port('clear')
                 port2 = comp_self._add_input_port('print')
                 port3 = comp_self._add_input_port('insert')
@@ -339,7 +339,7 @@ class PortTestCase(unittest.TestCase):
 
     def test_user_sink_input_ports_iter(self):
         class MySink(bt2._UserSinkComponent):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 port1 = comp_self._add_input_port('clear')
                 port2 = comp_self._add_input_port('print')
                 port3 = comp_self._add_input_port('insert')
@@ -370,7 +370,7 @@ class PortTestCase(unittest.TestCase):
         port3 = None
 
         class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 nonlocal port1, port2, port3
                 port1 = comp_self._add_output_port('clear')
                 port2 = comp_self._add_output_port('print')
@@ -394,7 +394,7 @@ class PortTestCase(unittest.TestCase):
         port3 = None
 
         class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 nonlocal port1, port2, port3
                 port1 = comp_self._add_output_port('clear')
                 port2 = comp_self._add_output_port('print')
@@ -418,7 +418,7 @@ class PortTestCase(unittest.TestCase):
         port3 = None
 
         class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 nonlocal port1, port2, port3
                 port1 = comp_self._add_input_port('clear')
                 port2 = comp_self._add_input_port('print')
@@ -438,7 +438,7 @@ class PortTestCase(unittest.TestCase):
         port3 = None
 
         class MySink(bt2._UserSinkComponent):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 nonlocal port1, port2, port3
                 port1 = comp_self._add_input_port('clear')
                 port2 = comp_self._add_input_port('print')
@@ -461,7 +461,7 @@ class PortTestCase(unittest.TestCase):
                 raise bt2.Stop
 
         class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 comp_self._add_output_port('clear')
                 comp_self._add_output_port('print')
                 comp_self._add_output_port('insert')
@@ -477,7 +477,7 @@ class PortTestCase(unittest.TestCase):
                 raise bt2.Stop
 
         class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 comp_self._add_output_port('clear')
                 comp_self._add_output_port('print')
                 comp_self._add_output_port('insert')
@@ -493,7 +493,7 @@ class PortTestCase(unittest.TestCase):
                 raise bt2.Stop
 
         class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 comp_self._add_input_port('clear')
                 comp_self._add_input_port('print')
                 comp_self._add_input_port('insert')
@@ -505,7 +505,7 @@ class PortTestCase(unittest.TestCase):
 
     def test_gen_sink_input_ports_getitem_invalid_key(self):
         class MySink(bt2._UserSinkComponent):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 comp_self._add_input_port('clear')
                 comp_self._add_input_port('print')
                 comp_self._add_input_port('insert')
@@ -527,7 +527,7 @@ class PortTestCase(unittest.TestCase):
                 raise bt2.Stop
 
         class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 comp_self._add_output_port('clear')
                 comp_self._add_output_port('print')
                 comp_self._add_output_port('insert')
@@ -541,7 +541,7 @@ class PortTestCase(unittest.TestCase):
                 raise bt2.Stop
 
         class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 comp_self._add_output_port('clear')
                 comp_self._add_output_port('print')
                 comp_self._add_output_port('insert')
@@ -555,7 +555,7 @@ class PortTestCase(unittest.TestCase):
                 raise bt2.Stop
 
         class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 comp_self._add_input_port('clear')
                 comp_self._add_input_port('print')
                 comp_self._add_input_port('insert')
@@ -565,7 +565,7 @@ class PortTestCase(unittest.TestCase):
 
     def test_gen_sink_input_ports_len(self):
         class MySink(bt2._UserSinkComponent):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 comp_self._add_input_port('clear')
                 comp_self._add_input_port('print')
                 comp_self._add_input_port('insert')
@@ -586,7 +586,7 @@ class PortTestCase(unittest.TestCase):
         port3 = None
 
         class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 nonlocal port1, port2, port3
                 port1 = comp_self._add_output_port('clear')
                 port2 = comp_self._add_output_port('print')
@@ -618,7 +618,7 @@ class PortTestCase(unittest.TestCase):
         port3 = None
 
         class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 nonlocal port1, port2, port3
                 port1 = comp_self._add_output_port('clear')
                 port2 = comp_self._add_output_port('print')
@@ -650,7 +650,7 @@ class PortTestCase(unittest.TestCase):
         port3 = None
 
         class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 nonlocal port1, port2, port3
                 port1 = comp_self._add_input_port('clear')
                 port2 = comp_self._add_input_port('print')
@@ -678,7 +678,7 @@ class PortTestCase(unittest.TestCase):
         port3 = None
 
         class MySink(bt2._UserSinkComponent):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 nonlocal port1, port2, port3
                 port1 = comp_self._add_input_port('clear')
                 port2 = comp_self._add_input_port('print')
@@ -705,7 +705,7 @@ class PortTestCase(unittest.TestCase):
 
     def test_name(self):
         class MySink(bt2._UserSinkComponent):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 comp_self._add_input_port('clear')
 
             def _user_consume(self):
@@ -716,7 +716,7 @@ class PortTestCase(unittest.TestCase):
 
     def test_connection_none(self):
         class MySink(bt2._UserSinkComponent):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 comp_self._add_input_port('clear')
 
             def _user_consume(self):
@@ -727,7 +727,7 @@ class PortTestCase(unittest.TestCase):
 
     def test_is_connected_false(self):
         class MySink(bt2._UserSinkComponent):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 comp_self._add_input_port('clear')
 
             def _user_consume(self):
@@ -738,7 +738,7 @@ class PortTestCase(unittest.TestCase):
 
     def test_self_name(self):
         class MySink(bt2._UserSinkComponent):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 port = comp_self._add_input_port('clear')
                 self.assertEqual(port.name, 'clear')
 
@@ -749,7 +749,7 @@ class PortTestCase(unittest.TestCase):
 
     def test_self_connection_none(self):
         class MySink(bt2._UserSinkComponent):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 port = comp_self._add_input_port('clear')
                 self.assertIsNone(port.connection)
 
@@ -760,7 +760,7 @@ class PortTestCase(unittest.TestCase):
 
     def test_self_is_connected_false(self):
         class MySink(bt2._UserSinkComponent):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 port = comp_self._add_input_port('clear')
                 self.assertFalse(port.is_connected)
 
@@ -775,7 +775,7 @@ class PortTestCase(unittest.TestCase):
                 raise bt2.Stop
 
         class MySource(bt2._UserFilterComponent, message_iterator_class=MyIter):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 nonlocal user_datas
 
                 p = comp_self._add_output_port('port1')
@@ -794,7 +794,7 @@ class PortTestCase(unittest.TestCase):
                 raise bt2.Stop
 
         class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 nonlocal user_datas
 
                 p = comp_self._add_output_port('port1')
@@ -820,7 +820,7 @@ class PortTestCase(unittest.TestCase):
                 raise bt2.Stop
 
         class MySink(bt2._UserFilterComponent, message_iterator_class=MyIter):
-            def __init__(comp_self, params, obj):
+            def __init__(comp_self, config, params, obj):
                 nonlocal user_datas
 
                 p = comp_self._add_input_port('port1')
index 8dfdfd6adc27d142b8881fe2ad1aaa6c33215001..f0ddbff4502cf5ae2a0e1c4ae472bda659e3e7eb 100644 (file)
@@ -26,7 +26,7 @@ import collections.abc
 # The value returned by the callable is returned by run_in_component_init.
 def run_in_component_init(func):
     class MySink(bt2._UserSinkComponent):
-        def __init__(self, params, obj):
+        def __init__(self, config, params, obj):
             nonlocal res_bound
             res_bound = func(self)
 
@@ -125,7 +125,7 @@ def _get_all_message_types(with_packet=True):
             return msg
 
     class MySrc(bt2._UserSourceComponent, message_iterator_class=MyIter):
-        def __init__(self, params, obj):
+        def __init__(self, config, params, obj):
             tc = self._create_trace_class()
             clock_class = self._create_clock_class(frequency=1000)
 
@@ -251,7 +251,7 @@ def get_const_event_message():
 # from this port, it puts the returned message in the initialization
 # list as the first item.
 class TestProxySink(bt2._UserSinkComponent):
-    def __init__(self, params, msg_list):
+    def __init__(self, config, params, msg_list):
         assert msg_list is not None
         self._msg_list = msg_list
         self._add_input_port('in')
index 15b7d6021efb4c4971cc25568a947335043a9981..dd4d5a4b73288a629e4276ecf36797976f685661 100644 (file)
@@ -52,7 +52,7 @@ class TestSourceExt(Base, bt2._UserSourceComponent, message_iterator_class=TestI
     files are not grouped.
     """
 
-    def __init__(self, params, obj):
+    def __init__(self, config, params, obj):
         super().__init__(params)
 
     @staticmethod
@@ -85,7 +85,7 @@ class TestSourceSomeDir(
     directory "some-dir" won't be found by TestSourceExt, because we won't
     recurse in "some-dir"."""
 
-    def __init__(self, params, obj):
+    def __init__(self, config, params, obj):
         super().__init__(params)
 
     @staticmethod
@@ -104,7 +104,7 @@ class TestSourceSomeDir(
 class TestSourceABCDE(Base, bt2._UserSourceComponent, message_iterator_class=TestIter):
     """A source that recognizes the arbitrary string input "ABCDE"."""
 
-    def __init__(self, params, obj):
+    def __init__(self, config, params, obj):
         super().__init__(params)
 
     @staticmethod
index 336f49c2c904e1fef8007247984794e55530941f..c39db50ffb95c9a40a65cd54190a60392dd62386 100644 (file)
@@ -57,7 +57,7 @@ class Base:
 
 @bt2.plugin_component_class
 class TestSourceA(Base, bt2._UserSourceComponent, message_iterator_class=TestIter):
-    def __init__(self, params, obj):
+    def __init__(self, config, params, obj):
         super().__init__(params, obj)
 
     @staticmethod
@@ -80,7 +80,7 @@ class TestSourceA(Base, bt2._UserSourceComponent, message_iterator_class=TestIte
 
 @bt2.plugin_component_class
 class TestSourceB(Base, bt2._UserSourceComponent, message_iterator_class=TestIter):
-    def __init__(self, params, obj):
+    def __init__(self, config, params, obj):
         super().__init__(params, obj)
 
     @staticmethod
index 4d750137d3f6371732a9b21897cd088106a9633d..6b60889645a624b150c8067dbc134d08b97deffb 100644 (file)
@@ -40,7 +40,7 @@ def to_string(p):
 
 @bt2.plugin_component_class
 class SinkThatPrintsParams(bt2._UserSinkComponent):
-    def __init__(self, params, obj):
+    def __init__(self, config, params, obj):
         self._add_input_port('in')
         print(to_string(params))
 
index 29aa065ace7b0d0d86e270eff0c97967457caa19..b81c26dbfbfba627607cfa43c52db080d58128bf 100644 (file)
@@ -19,7 +19,7 @@ class TheIteratorOfConfusion(bt2._UserMessageIterator):
 class TheSourceOfConfusion(
     bt2._UserSourceComponent, message_iterator_class=TheIteratorOfConfusion
 ):
-    def __init__(self, params, obj):
+    def __init__(self, config, params, obj):
         test_name = str(params['test-name'])
 
         TEST_CASES[test_name].source_setup(self, test_name)
index c7d5985dffd001143305621121f53ed73a91d2c9..3a37b32963fc2444a0a796bca73566f7224288b4 100644 (file)
@@ -49,7 +49,7 @@ class TheIteratorOfAllEvil(bt2._UserMessageIterator):
 class TheSourceOfAllEvil(
     bt2._UserSourceComponent, message_iterator_class=TheIteratorOfAllEvil
 ):
-    def __init__(self, params, obj):
+    def __init__(self, config, params, obj):
         tc = self._create_trace_class()
 
         # Use a clock class with an offset, so we can test with --begin or --end
index ae2da5aa72437074516ab215574ade6723de7734..3689a75baf45ba5872e5ecc89fc12c8c1322f13f 100644 (file)
@@ -295,6 +295,7 @@ bt_component_class_port_connected_method_status sink_input_port_connected(
 static
 bt_component_class_init_method_status src_init(
        bt_self_component_source *self_comp,
+       bt_self_component_source_configuration *config,
        const bt_value *params, void *init_method_data)
 {
        int ret;
@@ -308,6 +309,7 @@ bt_component_class_init_method_status src_init(
 static
 bt_component_class_init_method_status sink_init(
        bt_self_component_sink *self_comp,
+       bt_self_component_sink_configuration *config,
        const bt_value *params, void *init_method_data)
 {
        int ret;
index 31e2b6f7bf157baa87dcda7ede16ccbf9d999b56..2ea92a846d30a29be6a2c83902411d9a1fc3cb79 100644 (file)
@@ -60,6 +60,7 @@ void simple_fini_func(void *data)
 static
 bt_component_class_init_method_status src_init(
                bt_self_component_source *self_comp,
+               bt_self_component_source_configuration *config,
                const bt_value *params, void *init_method_data)
 {
        bt_self_component_add_port_status status;
index 33591800bc381a3085b49f5a38f568b8d773bff3..1d565ebdef1c26b1f592d03bfd00863224786db9 100644 (file)
@@ -411,6 +411,7 @@ static void test_example_scenario(bt_self_component_source *self_comp)
 static
 bt_component_class_init_method_status src_init(
        bt_self_component_source *self_comp,
+       bt_self_component_source_configuration *config,
        const bt_value *params, void *init_method_data)
 {
        test_example_scenario(self_comp);
This page took 0.060036 seconds and 4 git commands to generate.