bt2: add "get supported MIP versions" method support
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 12 Aug 2019 21:19:46 +0000 (17:19 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 13 Aug 2019 00:28:02 +0000 (20:28 -0400)
commitfd57054b8b8df8e81accec2443042308a268067f
tree82f62716264394692355ba5e9032d7768e2f4831
parent7a2a232886db556f09e7ea7123e44adaa2690cb3
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.025006 seconds and 4 git commands to generate.