+struct bt_field_class *bt_field_class_option_without_selector_create(
+ struct bt_trace_class *trace_class,
+ struct bt_field_class *content_fc)
+{
+ return create_option_field_class(trace_class,
+ BT_FIELD_CLASS_TYPE_OPTION_WITHOUT_SELECTOR_FIELD,
+ content_fc, NULL);
+}
+
+struct bt_field_class *bt_field_class_option_with_selector_field_bool_create(
+ struct bt_trace_class *trace_class,
+ struct bt_field_class *content_fc,
+ struct bt_field_class *selector_fc)
+{
+ struct bt_field_class_option_with_selector_field_bool *fc =
+ (void *) create_option_field_class(trace_class,
+ BT_FIELD_CLASS_TYPE_OPTION_WITH_BOOL_SELECTOR_FIELD,
+ content_fc, selector_fc);
+
+ if (!fc) {
+ goto end;
+ }
+
+end:
+ return (void *) fc;
+}
+
+struct bt_field_class *
+bt_field_class_option_with_selector_field_integer_unsigned_create(
+ struct bt_trace_class *trace_class,
+ struct bt_field_class *content_fc,
+ struct bt_field_class *selector_fc,
+ const struct bt_integer_range_set_unsigned *u_range_set)
+{
+ struct bt_field_class_option_with_selector_field_integer *fc;
+ const struct bt_integer_range_set *range_set =
+ (const void *) u_range_set;
+
+ BT_ASSERT_PRE_NON_NULL(range_set, "Integer range set");
+ BT_ASSERT_PRE(range_set->ranges->len > 0,
+ "Integer range set is empty: %!+R", range_set);
+ fc = (void *) create_option_field_class(trace_class,
+ BT_FIELD_CLASS_TYPE_OPTION_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD,
+ content_fc, selector_fc);
+
+ if (!fc) {
+ goto end;
+ }
+
+ fc->range_set = range_set;
+ bt_object_get_ref_no_null_check(fc->range_set);
+ bt_integer_range_set_freeze(range_set);
+
+end:
+ return (void *) fc;
+}
+
+struct bt_field_class *
+bt_field_class_option_with_selector_field_integer_signed_create(
+ struct bt_trace_class *trace_class,
+ struct bt_field_class *content_fc,
+ struct bt_field_class *selector_fc,
+ const struct bt_integer_range_set_signed *i_range_set)
+{
+ struct bt_field_class_option_with_selector_field_integer *fc;
+ const struct bt_integer_range_set *range_set =
+ (const void *) i_range_set;
+
+ BT_ASSERT_PRE_NON_NULL(range_set, "Integer range set");
+ BT_ASSERT_PRE(range_set->ranges->len > 0,
+ "Integer range set is empty: %!+R", range_set);
+ fc = (void *) create_option_field_class(trace_class,
+ BT_FIELD_CLASS_TYPE_OPTION_WITH_SIGNED_INTEGER_SELECTOR_FIELD,
+ content_fc, selector_fc);
+
+ if (!fc) {
+ goto end;
+ }
+
+ fc->range_set = range_set;
+ bt_object_get_ref_no_null_check(fc->range_set);
+ bt_integer_range_set_freeze(range_set);
+
+end:
+ return (void *) fc;
+}
+