lib: add support for bit array flags
Implement support for flags on bit array field classes, in order to
be able to add support for the fixed-length bit map field class (as
specified by CTF2-SPEC-2.0 [1]) in the CTF component classes.
A flag is a mapping between bit positions in a fixed-length bit map
field and a textual label. A flag is considered active for a given
field if any of the bits in the flag's bit positions is set in the
field. Flags may have overlapping bit positions, meaning that a single
bit can activate multiple flags.
Add the following public functions operating on bit array field classes:
🥑 bt_field_class_bit_array_add_flag
🥑 bt_field_class_bit_array_get_flag_count
🥑 bt_field_class_bit_array_borrow_flag_by_index_const
🥑 bt_field_class_bit_array_borrow_flag_by_label_const
🥑 bt_field_class_bit_array_get_active_flag_labels_for_value_as_integer
Add the bt_field_class_bit_array_flag type. Then, add the following
public functions operating on it:
🥑 bt_field_class_bit_array_flag_get_label
🥑 bt_field_class_bit_array_flag_borrow_index_ranges_const
Add the following public function operating on a bit array field:
🥑 bt_field_bit_array_get_active_flag_labels
The
`bt_field_class_bit_array_get_active_flag_labels_for_value_as_integer`
function returns an array of label through an output parameter of type
`bt_field_class_bit_array_flag_label_array`. The storage for it is
owned by the field class, so the result is only valid until the next
call to the function (or until the field class gets destroyed). This
behavior is copied from the enum field class.
Philippe updated the documentation.
[1]: https://diamon.org/ctf/CTF2-SPEC-2.0.html
Change-Id: Ib88f3aecf692ea8b6453c0308fa7735fd40e55a9
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12727
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
This page took 0.024775 seconds and 4 git commands to generate.