+
+ switch (fc->type) {
+ case BT_FIELD_CLASS_TYPE_BOOL:
+ field = create_bool_field(fc);
+ break;
+ case BT_FIELD_CLASS_TYPE_BIT_ARRAY:
+ field = create_bit_array_field(fc);
+ break;
+ case BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER:
+ case BT_FIELD_CLASS_TYPE_SIGNED_INTEGER:
+ case BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION:
+ case BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION:
+ field = create_integer_field(fc);
+ break;
+ case BT_FIELD_CLASS_TYPE_SINGLE_PRECISION_REAL:
+ case BT_FIELD_CLASS_TYPE_DOUBLE_PRECISION_REAL:
+ field = create_real_field(fc);
+ break;
+ case BT_FIELD_CLASS_TYPE_STRING:
+ field = create_string_field(fc);
+ break;
+ case BT_FIELD_CLASS_TYPE_STRUCTURE:
+ field = create_structure_field(fc);
+ break;
+ case BT_FIELD_CLASS_TYPE_STATIC_ARRAY:
+ field = create_static_array_field(fc);
+ break;
+ case BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITHOUT_LENGTH_FIELD:
+ case BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITH_LENGTH_FIELD:
+ field = create_dynamic_array_field(fc);
+ break;
+ case BT_FIELD_CLASS_TYPE_OPTION_WITHOUT_SELECTOR_FIELD:
+ case BT_FIELD_CLASS_TYPE_OPTION_WITH_BOOL_SELECTOR_FIELD:
+ case BT_FIELD_CLASS_TYPE_OPTION_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD:
+ case BT_FIELD_CLASS_TYPE_OPTION_WITH_SIGNED_INTEGER_SELECTOR_FIELD:
+ field = create_option_field(fc);
+ break;
+ case BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR_FIELD:
+ case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD:
+ case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR_FIELD:
+ field = create_variant_field(fc);
+ break;
+ default:
+ bt_common_abort();
+ }
+