- case BT_FIELD_CLASS_TYPE_VARIANT:
+ case BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR:
+ case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR:
+ case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR:
struct bt_field_path_item item = {
.type = BT_FIELD_PATH_ITEM_TYPE_INDEX,
.index = i,
struct bt_field_path_item item = {
.type = BT_FIELD_PATH_ITEM_TYPE_INDEX,
.index = i,
static inline
bool target_is_before_source(struct bt_field_path *src_field_path,
struct bt_field_path *tgt_field_path)
static inline
bool target_is_before_source(struct bt_field_path *src_field_path,
struct bt_field_path *tgt_field_path)
static inline
struct bt_field_class *borrow_root_field_class(
struct bt_resolve_field_path_context *ctx, enum bt_scope scope)
static inline
struct bt_field_class *borrow_root_field_class(
struct bt_resolve_field_path_context *ctx, enum bt_scope scope)
static inline
struct bt_field_class *borrow_child_field_class(
struct bt_field_class *parent_fc,
static inline
struct bt_field_class *borrow_child_field_class(
struct bt_field_class *parent_fc,
- case BT_FIELD_CLASS_TYPE_VARIANT:
+ case BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR:
+ case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR:
+ case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR:
static inline
bool target_field_path_in_different_scope_has_struct_fc_only(
struct bt_field_path *src_field_path,
static inline
bool target_field_path_in_different_scope_has_struct_fc_only(
struct bt_field_path *src_field_path,
- fc->type == BT_FIELD_CLASS_TYPE_VARIANT) {
+ fc->type == BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR ||
+ fc->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR ||
+ fc->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR) {
static inline
bool lca_is_structure_field_class(struct bt_field_path *src_field_path,
struct bt_field_path *tgt_field_path,
static inline
bool lca_is_structure_field_class(struct bt_field_path *src_field_path,
struct bt_field_path *tgt_field_path,
static inline
bool lca_to_target_has_struct_fc_only(struct bt_field_path *src_field_path,
struct bt_field_path *tgt_field_path,
static inline
bool lca_to_target_has_struct_fc_only(struct bt_field_path *src_field_path,
struct bt_field_path *tgt_field_path,
if (tgt_fc->type == BT_FIELD_CLASS_TYPE_STATIC_ARRAY ||
tgt_fc->type == BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY ||
if (tgt_fc->type == BT_FIELD_CLASS_TYPE_STATIC_ARRAY ||
tgt_fc->type == BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY ||
- tgt_fc->type == BT_FIELD_CLASS_TYPE_VARIANT) {
+ tgt_fc->type == BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR ||
+ tgt_fc->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR ||
+ tgt_fc->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR) {
static inline
bool field_path_is_valid(struct bt_field_class *src_fc,
struct bt_field_class *tgt_fc,
static inline
bool field_path_is_valid(struct bt_field_class *src_fc,
struct bt_field_class *tgt_fc,
/* Target must be before source */
if (!target_is_before_source(src_field_path, tgt_field_path)) {
/* Target must be before source */
if (!target_is_before_source(src_field_path, tgt_field_path)) {
*/
if (!target_field_path_in_different_scope_has_struct_fc_only(
src_field_path, tgt_field_path, ctx)) {
*/
if (!target_field_path_in_different_scope_has_struct_fc_only(
src_field_path, tgt_field_path, ctx)) {
"different scope than requesting field class, "
"but within an array or a variant field class: "
"%![req-fc-]+F, %![tgt-fc-]+F",
"different scope than requesting field class, "
"but within an array or a variant field class: "
"%![req-fc-]+F, %![tgt-fc-]+F",
/* Same scope: LCA must be a structure field class */
if (!lca_is_structure_field_class(src_field_path, tgt_field_path, ctx)) {
/* Same scope: LCA must be a structure field class */
if (!lca_is_structure_field_class(src_field_path, tgt_field_path, ctx)) {
"requesting field classes is not a structure field class: "
"%![req-fc-]+F, %![tgt-fc-]+F",
src_fc, tgt_fc);
"requesting field classes is not a structure field class: "
"%![req-fc-]+F, %![tgt-fc-]+F",
src_fc, tgt_fc);
/* Same scope: path from LCA to target has no array/variant FTs */
if (!lca_to_target_has_struct_fc_only(src_field_path, tgt_field_path,
ctx)) {
/* Same scope: path from LCA to target has no array/variant FTs */
if (!lca_to_target_has_struct_fc_only(src_field_path, tgt_field_path,
ctx)) {
"and requesting field classes to target field class "
"contains an array or a variant field class: "
"%![req-fc-]+F, %![tgt-fc-]+F", src_fc, tgt_fc);
"and requesting field classes to target field class "
"contains an array or a variant field class: "
"%![req-fc-]+F, %![tgt-fc-]+F", src_fc, tgt_fc);
struct bt_field_class *tgt_fc,
struct bt_resolve_field_path_context *ctx)
{
struct bt_field_class *tgt_fc,
struct bt_resolve_field_path_context *ctx)
{
- BT_ASSERT_PRE(field_path_is_valid(src_fc, tgt_fc, ctx),
+ BT_ASSERT_PRE_DEV(field_path_is_valid(src_fc, tgt_fc, ctx),
"Invalid target field class: %![req-fc-]+F, %![tgt-fc-]+F",
src_fc, tgt_fc);
return find_field_class_in_ctx(tgt_fc, ctx);
"Invalid target field class: %![req-fc-]+F, %![tgt-fc-]+F",
src_fc, tgt_fc);
return find_field_class_in_ctx(tgt_fc, ctx);
if (var_fc->selector_fc) {
BT_ASSERT(!var_fc->selector_field_path);
var_fc->selector_field_path =
resolve_field_path(fc,
if (var_fc->selector_fc) {
BT_ASSERT(!var_fc->selector_field_path);
var_fc->selector_field_path =
resolve_field_path(fc,
- case BT_FIELD_CLASS_TYPE_VARIANT:
+ case BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR:
+ case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR:
+ case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR: