mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-27 13:52:19 +00:00
Minireflect fixed array (#6129)
* CMakeLists: also really generate optional_scalars as needed by test elsewhere * [C++] Handle fixed-length array in minireflection Fixes #6128
This commit is contained in:
@@ -341,21 +341,22 @@ inline const flatbuffers::TypeTable *TestEnumTypeTable() {
|
||||
"C"
|
||||
};
|
||||
static const flatbuffers::TypeTable tt = {
|
||||
flatbuffers::ST_ENUM, 3, type_codes, type_refs, nullptr, names
|
||||
flatbuffers::ST_ENUM, 3, type_codes, type_refs, nullptr, nullptr, names
|
||||
};
|
||||
return &tt;
|
||||
}
|
||||
|
||||
inline const flatbuffers::TypeTable *NestedStructTypeTable() {
|
||||
static const flatbuffers::TypeCode type_codes[] = {
|
||||
{ flatbuffers::ET_SEQUENCE, 0, -1 },
|
||||
{ flatbuffers::ET_INT, 1, -1 },
|
||||
{ flatbuffers::ET_CHAR, 0, 0 },
|
||||
{ flatbuffers::ET_SEQUENCE, 0, 0 },
|
||||
{ flatbuffers::ET_SEQUENCE, 0, -1 }
|
||||
{ flatbuffers::ET_CHAR, 1, 0 },
|
||||
{ flatbuffers::ET_LONG, 1, -1 }
|
||||
};
|
||||
static const flatbuffers::TypeFunction type_refs[] = {
|
||||
MyGame::Example::TestEnumTypeTable
|
||||
};
|
||||
static const int16_t array_sizes[] = { 2, 2, 2, };
|
||||
static const int64_t values[] = { 0, 8, 9, 16, 32 };
|
||||
static const char * const names[] = {
|
||||
"a",
|
||||
@@ -364,7 +365,7 @@ inline const flatbuffers::TypeTable *NestedStructTypeTable() {
|
||||
"d"
|
||||
};
|
||||
static const flatbuffers::TypeTable tt = {
|
||||
flatbuffers::ST_STRUCT, 4, type_codes, type_refs, values, names
|
||||
flatbuffers::ST_STRUCT, 4, type_codes, type_refs, array_sizes, values, names
|
||||
};
|
||||
return &tt;
|
||||
}
|
||||
@@ -372,15 +373,16 @@ inline const flatbuffers::TypeTable *NestedStructTypeTable() {
|
||||
inline const flatbuffers::TypeTable *ArrayStructTypeTable() {
|
||||
static const flatbuffers::TypeCode type_codes[] = {
|
||||
{ flatbuffers::ET_FLOAT, 0, -1 },
|
||||
{ flatbuffers::ET_SEQUENCE, 0, -1 },
|
||||
{ flatbuffers::ET_INT, 1, -1 },
|
||||
{ flatbuffers::ET_CHAR, 0, -1 },
|
||||
{ flatbuffers::ET_SEQUENCE, 0, 0 },
|
||||
{ flatbuffers::ET_SEQUENCE, 1, 0 },
|
||||
{ flatbuffers::ET_INT, 0, -1 },
|
||||
{ flatbuffers::ET_SEQUENCE, 0, -1 }
|
||||
{ flatbuffers::ET_LONG, 1, -1 }
|
||||
};
|
||||
static const flatbuffers::TypeFunction type_refs[] = {
|
||||
MyGame::Example::NestedStructTypeTable
|
||||
};
|
||||
static const int16_t array_sizes[] = { 15, 2, 2, };
|
||||
static const int64_t values[] = { 0, 4, 64, 72, 136, 144, 160 };
|
||||
static const char * const names[] = {
|
||||
"a",
|
||||
@@ -391,7 +393,7 @@ inline const flatbuffers::TypeTable *ArrayStructTypeTable() {
|
||||
"f"
|
||||
};
|
||||
static const flatbuffers::TypeTable tt = {
|
||||
flatbuffers::ST_STRUCT, 6, type_codes, type_refs, values, names
|
||||
flatbuffers::ST_STRUCT, 6, type_codes, type_refs, array_sizes, values, names
|
||||
};
|
||||
return &tt;
|
||||
}
|
||||
@@ -407,7 +409,7 @@ inline const flatbuffers::TypeTable *ArrayTableTypeTable() {
|
||||
"a"
|
||||
};
|
||||
static const flatbuffers::TypeTable tt = {
|
||||
flatbuffers::ST_TABLE, 1, type_codes, type_refs, nullptr, names
|
||||
flatbuffers::ST_TABLE, 1, type_codes, type_refs, nullptr, nullptr, names
|
||||
};
|
||||
return &tt;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user