bt2: add "get supported MIP versions" method support
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 12 Aug 2019 21:19:46 +0000 (17:19 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 4 Sep 2019 15:58:21 +0000 (11:58 -0400)
commited68d910edac8cc1ae62b8ef237d1c32fd8e06d0
treed271cf9ca700402c608e43f8c7a1ab58cf349127
parent44d784282e368dbbf68345f13220a77ffacbaff4
bt2: add "get supported MIP versions" method support

This patch makes the `bt2` package wrap the library's "get supported MIP
versions" component class method.

In a Python component class, it is expected that the optional
_user_get_supported_mip_versions() method returns either a
`bt2.UnsignedIntegerRangeSet` object or what such an object needs to be
constructed. In other words, the method can return, for example:

    return [0, 1, (3, 5)]

Like in the library, the default _user_get_supported_mip_versions()
returns 0 (only protocol 0 supported):

    def _user_get_supported_mip_versions(cls, params, obj, log_level):
        return [0]

_bt_get_supported_mip_versions_from_native() returns a new reference on
this unsigned integer range set. Then, the native
component_class_get_supported_mip_versions() copies the ranges from the
returned range set to the range set to fill. I believe this makes
_user_get_supported_mip_versions() easier to use than receiving a range
set object and filling it like it's done in C.

The feature is not tested in this patch because the "get supported MIP
versions" method is not used within the library.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I9e0c6f0fcac23d2224401c1fb1c258f061642767
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1875
Tested-by: jenkins <jenkins@lttng.org>
src/bindings/python/bt2/bt2/component.py
src/bindings/python/bt2/bt2/native_bt_component_class.i.h
This page took 0.025319 seconds and 4 git commands to generate.