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)
committerFrancis Deslauriers <francis.deslauriers@efficios.com>
Thu, 2 May 2019 20:50:15 +0000 (20:50 +0000)
commit8f3ccfbc98c03ee07895d9d2e50e6390bbbb0431
tree500b934804592e04c153ad0dbe0394891ae155b0
parent976c241df475c9d99161a1100517c3c308074d7f
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.025038 seconds and 4 git commands to generate.