-
Hello everyone, I have a FlatBuffers schema that includes an array of unions (referred to as "item"). Each item contains an identifier and a data section. The data section can either be a primitive type, such as uint32, or an array of float.
The flatbuffer structure is composed successfully for the primitive type uint32. However, when attempting to compose the float vector, we encounter the error: The code to create a float array:
The |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Try to enable assertions in builder.c and see if you can get more information out of it. See source code comments at top. |
Beta Was this translation helpful? Give feedback.
-
investigation_item_array_float_create From memory: If you do not have an open table, the error is probably due to the current stack frame type not being a table type, and the error return code NULL triggers the error you see later on. If it works with integers it might just be that you mixed up the two versions with and without data suffix during testing. |
Beta Was this translation helpful? Give feedback.
-
Sounds good. The general format is
I might not remember exactly, but that is the idea. That is, all types also have a vector type regardless of whether a vector is used in the schema. The variant with a field name knows whether it is a vector or not, and has different verbs, but is just a thin wrapper around the version without a field name. If they appear to have similar names that comes down to how the table is named. Using In your case the proper name is probaly something like
All the basic types have defined vector operations. Listing all available names may also be helpful. The following doc section might help, although it has been a while since it was last tested, you will need clang C compiler: https://github.com/dvidelabs/flatcc?tab=readme-ov-file#extracting-documentation |
Beta Was this translation helpful? Give feedback.
Thank you for the hint.
We did some additional investigation and replaced
with
this seems to work.