bt2: prepend `_user` to overridable protected methods
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 24 Jul 2019 21:27:22 +0000 (17:27 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 25 Jul 2019 18:04:47 +0000 (14:04 -0400)
commit6a91742b3a25285222551341c8a134b4b2b5aba9
tree4309e477710426da15beb0ee390f7d0ddf2f7957
parent0ddaae90f2789927df222570c9df951aa15c6248
bt2: prepend `_user` to overridable protected methods

It is possible that, in the future, we add new, optional overridable
protected methods that the user can implement within a component class
or message iterator class to have new features.

There is the risk, however, that the user class already has a method
named as such. This would be considered a backward compatibility break
because the same user class with two different versions of Babeltrace 2
would not work the same way (and with the newest version, it probably
would not work at all).

To prevent this, this patch adds the `_user` namespace to all the
overridable protected methods. It will be documented that you cannot,
when you inherit one of the `bt2._User*` classes, have a method named
`_user_*()`, as this prefix is reserved for the future within the `bt2`
package.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I0c5ac29a21a83d6f644d0bb696f71d687ecfebae
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1777
Tested-by: jenkins <jenkins@lttng.org>
15 files changed:
src/bindings/python/bt2/bt2/component.py
src/bindings/python/bt2/bt2/message_iterator.py
src/bindings/python/bt2/bt2/native_bt_component_class.i
tests/bindings/python/bt2/test_component.py
tests/bindings/python/bt2/test_component_class.py
tests/bindings/python/bt2/test_connection.py
tests/bindings/python/bt2/test_error.py
tests/bindings/python/bt2/test_graph.py
tests/bindings/python/bt2/test_message_iterator.py
tests/bindings/python/bt2/test_port.py
tests/bindings/python/bt2/test_query_executor.py
tests/bindings/python/bt2/utils.py
tests/data/cli/auto-source-discovery/bt_plugin_test.py
tests/data/plugins/flt.utils.trimmer/bt_plugin_trimmer_test.py
tests/python-plugin-provider/bt_plugin_test_python_plugin_provider.py
This page took 0.027437 seconds and 4 git commands to generate.