lib: add field location-related functions
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 23 May 2024 20:22:52 +0000 (16:22 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 4 Sep 2024 19:05:14 +0000 (15:05 -0400)
commitae8acddb2b7ccc05cf0c1e69d213356dae7abc51
tree65897925552704feef704fb0fcab3a2c02b93389
parent59e62923c4edf11cea73c64499d836340f829961
lib: add field location-related functions

For each API function accepting a bt_field_class to refer to a length or
selector field, to create a variant, dynamic array or option field
class, add one or more equivalent ones accepting a bt_field_location.
For symmetry between the various field classes, go with separate
functions for "with" and "without" length/selector field locations,
rather than having one function that can take a NULL field location.

Add functions to borrow a field location from a variant, option or
dynamic array field class.

All the new functions have preconditions to require MIP version >= 1.
All the old functions dealing with field paths have preconditions to
require MIP version == 0.

Philippe updated the documentation.

Variants
--------

The existing bt_field_class_variant_create function deduces the type of
variant (without selector, with unsigned int selector, with signed int
selector) by looking at the selector field class' type.  This is not
possible by looking at a selector field location, since the field
class(es) the field location points to is/are not known at this time.
So, introduce three new functions to create a variant field class
(without, with unsigned, with signed).

Dynamic arrays
--------------

For symmetry with the other field classes, go with two separate
functions for with a length field location and without a length field
location, rather than a single function that can accept a NULL field
location.

Options
-------

For consistency in the naming with the other field classes, add the
bt_field_class_option_without_selector_field_location_create function.
It is functionally equivalent to the existing
bt_field_class_option_without_selector_create function.  Add three other
functions to match the three existing ones (with bool, with unsigned,
with signed).

Change-Id: Ib2df27fedc9aab3fefee3bd6d4dfb41fc359654b
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/7302
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/7208
doc/api/libbabeltrace2/Doxyfile.in
include/babeltrace2/trace-ir/field-class.h
include/babeltrace2/trace-ir/field-location.h
src/lib/assert-cond.h
src/lib/lib-logging.c
src/lib/trace-ir/field-class.c
src/lib/trace-ir/field-class.h
src/lib/trace-ir/resolve-field-path.c
This page took 0.025224 seconds and 4 git commands to generate.