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)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 3 May 2019 22:19:40 +0000 (18:19 -0400)
commitb6baf3bbbc533c4176a8e8fcb349604803fe16ee
tree6883a081f33adda3d13115ef9584021de777d9ef
parent90cfc0122a02a3407b73165ae30d5f00c48b97a6
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.024627 seconds and 4 git commands to generate.