lib: have dedicated, unique unsigned and signed enum FC mapping objects
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 24 Apr 2019 05:00:45 +0000 (01:00 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 2 May 2019 04:12:56 +0000 (00:12 -0400)
commit1df03755db8a16bb63635216823d2d636e93cbe5
tree500b934804592e04c153ad0dbe0394891ae155b0
parentddfd116518c290a6581bda46fd9d64f10e473f33
lib: have dedicated, unique unsigned and signed enum FC mapping objects

This patch makes the enumeration field class mapping API aligned with
the structure field class member and variant field class option APIs. In
other words, a signed or an unsigned enumeration field class mapping is
now a dedicated type. An enumeration field class mapping object is
unique and always belongs to its parent field class.

bt_field_class_unsigned_enumeration_borrow_mapping_by_index_const() and
bt_field_class_signed_enumeration_borrow_mapping_by_index_const() now
return borrowed enumeration field class mapping objects.

You can use
bt_field_class_unsigned_enumeration_mapping_as_mapping_const() to change
a signed or unsigned enumeration field class mapping into a generic
enumeration field class mapping. The API for a generic enumeration field
class mapping is:

    const char *bt_field_class_enumeration_mapping_get_label(
        const bt_field_class_enumeration_mapping *mapping);

    uint64_t bt_field_class_enumeration_mapping_get_range_count(
        const bt_field_class_enumeration_mapping *mapping);

You cannot create an enumeration field class mapping object: you still
map a name to a specific range with
bt_field_class_unsigned_enumeration_map_range() and
bt_field_class_signed_enumeration_map_range().

This patch also makes the `flt.lttng-utils.debug-info` and `sink.ctf.fs`
component classes use the updated API.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Iba5da648ca69ec0ca0c5df09a9f383dd4b1e3972
Reviewed-on: https://review.gerrithub.io/c/eepp/babeltrace/+/451996
include/babeltrace/trace-ir/field-class-const.h
include/babeltrace/trace-ir/field-class-internal.h
include/babeltrace/types.h
lib/trace-ir/field-class.c
plugins/ctf/fs-sink/translate-ctf-ir-to-tsdl.c
plugins/lttng-utils/debug-info/trace-ir-metadata-field-class-copy.c
This page took 0.025741 seconds and 5 git commands to generate.