Const correctness in generated code and in code generators. Added missing \reflection\generate_code.bat file. (#4679)

This commit is contained in:
Flaviu
2018-03-23 17:58:07 +02:00
committed by Wouter van Oortmerssen
parent c0a6e5120d
commit 79f62ee353
16 changed files with 306 additions and 270 deletions

Binary file not shown.

View File

@@ -44,31 +44,31 @@ struct TypeAliasesT;
} // namespace Example
inline flatbuffers::TypeTable *InParentNamespaceTypeTable();
inline const flatbuffers::TypeTable *InParentNamespaceTypeTable();
namespace Example2 {
inline flatbuffers::TypeTable *MonsterTypeTable();
inline const flatbuffers::TypeTable *MonsterTypeTable();
} // namespace Example2
namespace Example {
inline flatbuffers::TypeTable *TestTypeTable();
inline const flatbuffers::TypeTable *TestTypeTable();
inline flatbuffers::TypeTable *TestSimpleTableWithEnumTypeTable();
inline const flatbuffers::TypeTable *TestSimpleTableWithEnumTypeTable();
inline flatbuffers::TypeTable *Vec3TypeTable();
inline const flatbuffers::TypeTable *Vec3TypeTable();
inline flatbuffers::TypeTable *AbilityTypeTable();
inline const flatbuffers::TypeTable *AbilityTypeTable();
inline flatbuffers::TypeTable *StatTypeTable();
inline const flatbuffers::TypeTable *StatTypeTable();
inline flatbuffers::TypeTable *ReferrableTypeTable();
inline const flatbuffers::TypeTable *ReferrableTypeTable();
inline flatbuffers::TypeTable *MonsterTypeTable();
inline const flatbuffers::TypeTable *MonsterTypeTable();
inline flatbuffers::TypeTable *TypeAliasesTypeTable();
inline const flatbuffers::TypeTable *TypeAliasesTypeTable();
enum Color {
Color_Red = 1,
@@ -78,8 +78,8 @@ enum Color {
Color_ANY = 11
};
inline Color (&EnumValuesColor())[3] {
static Color values[] = {
inline const Color (&EnumValuesColor())[3] {
static const Color values[] = {
Color_Red,
Color_Green,
Color_Blue
@@ -87,8 +87,8 @@ inline Color (&EnumValuesColor())[3] {
return values;
}
inline const char **EnumNamesColor() {
static const char *names[] = {
inline const char * const *EnumNamesColor() {
static const char * const names[] = {
"Red",
"Green",
"",
@@ -116,8 +116,8 @@ enum Any {
Any_MAX = Any_MyGame_Example2_Monster
};
inline Any (&EnumValuesAny())[4] {
static Any values[] = {
inline const Any (&EnumValuesAny())[4] {
static const Any values[] = {
Any_NONE,
Any_Monster,
Any_TestSimpleTableWithEnum,
@@ -126,8 +126,8 @@ inline Any (&EnumValuesAny())[4] {
return values;
}
inline const char **EnumNamesAny() {
static const char *names[] = {
inline const char * const *EnumNamesAny() {
static const char * const names[] = {
"NONE",
"Monster",
"TestSimpleTableWithEnum",
@@ -363,7 +363,7 @@ struct InParentNamespaceT : public flatbuffers::NativeTable {
struct InParentNamespace FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
typedef InParentNamespaceT NativeTableType;
static flatbuffers::TypeTable *MiniReflectTypeTable() {
static const flatbuffers::TypeTable *MiniReflectTypeTable() {
return InParentNamespaceTypeTable();
}
bool Verify(flatbuffers::Verifier &verifier) const {
@@ -408,7 +408,7 @@ struct MonsterT : public flatbuffers::NativeTable {
struct Monster FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
typedef MonsterT NativeTableType;
static flatbuffers::TypeTable *MiniReflectTypeTable() {
static const flatbuffers::TypeTable *MiniReflectTypeTable() {
return MonsterTypeTable();
}
bool Verify(flatbuffers::Verifier &verifier) const {
@@ -457,7 +457,7 @@ struct TestSimpleTableWithEnumT : public flatbuffers::NativeTable {
struct TestSimpleTableWithEnum FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
typedef TestSimpleTableWithEnumT NativeTableType;
static flatbuffers::TypeTable *MiniReflectTypeTable() {
static const flatbuffers::TypeTable *MiniReflectTypeTable() {
return TestSimpleTableWithEnumTypeTable();
}
enum {
@@ -520,7 +520,7 @@ struct StatT : public flatbuffers::NativeTable {
struct Stat FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
typedef StatT NativeTableType;
static flatbuffers::TypeTable *MiniReflectTypeTable() {
static const flatbuffers::TypeTable *MiniReflectTypeTable() {
return StatTypeTable();
}
enum {
@@ -619,7 +619,7 @@ struct ReferrableT : public flatbuffers::NativeTable {
struct Referrable FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
typedef ReferrableT NativeTableType;
static flatbuffers::TypeTable *MiniReflectTypeTable() {
static const flatbuffers::TypeTable *MiniReflectTypeTable() {
return ReferrableTypeTable();
}
enum {
@@ -750,7 +750,7 @@ struct MonsterT : public flatbuffers::NativeTable {
/// an example documentation comment: monster object
struct Monster FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
typedef MonsterT NativeTableType;
static flatbuffers::TypeTable *MiniReflectTypeTable() {
static const flatbuffers::TypeTable *MiniReflectTypeTable() {
return MonsterTypeTable();
}
enum {
@@ -1518,7 +1518,7 @@ struct TypeAliasesT : public flatbuffers::NativeTable {
struct TypeAliases FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
typedef TypeAliasesT NativeTableType;
static flatbuffers::TypeTable *MiniReflectTypeTable() {
static const flatbuffers::TypeTable *MiniReflectTypeTable() {
return TypeAliasesTypeTable();
}
enum {
@@ -2207,46 +2207,46 @@ inline void AnyUnion::Reset() {
type = Any_NONE;
}
inline flatbuffers::TypeTable *ColorTypeTable() {
static flatbuffers::TypeCode type_codes[] = {
inline const flatbuffers::TypeTable *ColorTypeTable() {
static const flatbuffers::TypeCode type_codes[] = {
{ flatbuffers::ET_CHAR, 0, 0 },
{ flatbuffers::ET_CHAR, 0, 0 },
{ flatbuffers::ET_CHAR, 0, 0 }
};
static flatbuffers::TypeFunction type_refs[] = {
static const flatbuffers::TypeFunction type_refs[] = {
ColorTypeTable
};
static const int32_t values[] = { 1, 2, 8 };
static const char *names[] = {
static const char * const names[] = {
"Red",
"Green",
"Blue"
};
static flatbuffers::TypeTable tt = {
static const flatbuffers::TypeTable tt = {
flatbuffers::ST_ENUM, 3, type_codes, type_refs, values, names
};
return &tt;
}
inline flatbuffers::TypeTable *AnyTypeTable() {
static flatbuffers::TypeCode type_codes[] = {
inline const flatbuffers::TypeTable *AnyTypeTable() {
static const flatbuffers::TypeCode type_codes[] = {
{ flatbuffers::ET_SEQUENCE, 0, -1 },
{ flatbuffers::ET_SEQUENCE, 0, 0 },
{ flatbuffers::ET_SEQUENCE, 0, 1 },
{ flatbuffers::ET_SEQUENCE, 0, 2 }
};
static flatbuffers::TypeFunction type_refs[] = {
static const flatbuffers::TypeFunction type_refs[] = {
MonsterTypeTable,
TestSimpleTableWithEnumTypeTable,
MyGame::Example2::MonsterTypeTable
};
static const char *names[] = {
static const char * const names[] = {
"NONE",
"Monster",
"TestSimpleTableWithEnum",
"MyGame_Example2_Monster"
};
static flatbuffers::TypeTable tt = {
static const flatbuffers::TypeTable tt = {
flatbuffers::ST_UNION, 4, type_codes, type_refs, nullptr, names
};
return &tt;
@@ -2254,8 +2254,8 @@ inline flatbuffers::TypeTable *AnyTypeTable() {
} // namespace Example
inline flatbuffers::TypeTable *InParentNamespaceTypeTable() {
static flatbuffers::TypeTable tt = {
inline const flatbuffers::TypeTable *InParentNamespaceTypeTable() {
static const flatbuffers::TypeTable tt = {
flatbuffers::ST_TABLE, 0, nullptr, nullptr, nullptr, nullptr
};
return &tt;
@@ -2263,8 +2263,8 @@ inline flatbuffers::TypeTable *InParentNamespaceTypeTable() {
namespace Example2 {
inline flatbuffers::TypeTable *MonsterTypeTable() {
static flatbuffers::TypeTable tt = {
inline const flatbuffers::TypeTable *MonsterTypeTable() {
static const flatbuffers::TypeTable tt = {
flatbuffers::ST_TABLE, 0, nullptr, nullptr, nullptr, nullptr
};
return &tt;
@@ -2274,40 +2274,40 @@ inline flatbuffers::TypeTable *MonsterTypeTable() {
namespace Example {
inline flatbuffers::TypeTable *TestTypeTable() {
static flatbuffers::TypeCode type_codes[] = {
inline const flatbuffers::TypeTable *TestTypeTable() {
static const flatbuffers::TypeCode type_codes[] = {
{ flatbuffers::ET_SHORT, 0, -1 },
{ flatbuffers::ET_CHAR, 0, -1 }
};
static const int32_t values[] = { 0, 2, 4 };
static const char *names[] = {
static const char * const names[] = {
"a",
"b"
};
static flatbuffers::TypeTable tt = {
static const flatbuffers::TypeTable tt = {
flatbuffers::ST_STRUCT, 2, type_codes, nullptr, values, names
};
return &tt;
}
inline flatbuffers::TypeTable *TestSimpleTableWithEnumTypeTable() {
static flatbuffers::TypeCode type_codes[] = {
inline const flatbuffers::TypeTable *TestSimpleTableWithEnumTypeTable() {
static const flatbuffers::TypeCode type_codes[] = {
{ flatbuffers::ET_CHAR, 0, 0 }
};
static flatbuffers::TypeFunction type_refs[] = {
static const flatbuffers::TypeFunction type_refs[] = {
ColorTypeTable
};
static const char *names[] = {
static const char * const names[] = {
"color"
};
static flatbuffers::TypeTable tt = {
static const flatbuffers::TypeTable tt = {
flatbuffers::ST_TABLE, 1, type_codes, type_refs, nullptr, names
};
return &tt;
}
inline flatbuffers::TypeTable *Vec3TypeTable() {
static flatbuffers::TypeCode type_codes[] = {
inline const flatbuffers::TypeTable *Vec3TypeTable() {
static const flatbuffers::TypeCode type_codes[] = {
{ flatbuffers::ET_FLOAT, 0, -1 },
{ flatbuffers::ET_FLOAT, 0, -1 },
{ flatbuffers::ET_FLOAT, 0, -1 },
@@ -2315,12 +2315,12 @@ inline flatbuffers::TypeTable *Vec3TypeTable() {
{ flatbuffers::ET_CHAR, 0, 0 },
{ flatbuffers::ET_SEQUENCE, 0, 1 }
};
static flatbuffers::TypeFunction type_refs[] = {
static const flatbuffers::TypeFunction type_refs[] = {
ColorTypeTable,
TestTypeTable
};
static const int32_t values[] = { 0, 4, 8, 16, 24, 26, 32 };
static const char *names[] = {
static const char * const names[] = {
"x",
"y",
"z",
@@ -2328,60 +2328,60 @@ inline flatbuffers::TypeTable *Vec3TypeTable() {
"test2",
"test3"
};
static flatbuffers::TypeTable tt = {
static const flatbuffers::TypeTable tt = {
flatbuffers::ST_STRUCT, 6, type_codes, type_refs, values, names
};
return &tt;
}
inline flatbuffers::TypeTable *AbilityTypeTable() {
static flatbuffers::TypeCode type_codes[] = {
inline const flatbuffers::TypeTable *AbilityTypeTable() {
static const flatbuffers::TypeCode type_codes[] = {
{ flatbuffers::ET_UINT, 0, -1 },
{ flatbuffers::ET_UINT, 0, -1 }
};
static const int32_t values[] = { 0, 4, 8 };
static const char *names[] = {
static const char * const names[] = {
"id",
"distance"
};
static flatbuffers::TypeTable tt = {
static const flatbuffers::TypeTable tt = {
flatbuffers::ST_STRUCT, 2, type_codes, nullptr, values, names
};
return &tt;
}
inline flatbuffers::TypeTable *StatTypeTable() {
static flatbuffers::TypeCode type_codes[] = {
inline const flatbuffers::TypeTable *StatTypeTable() {
static const flatbuffers::TypeCode type_codes[] = {
{ flatbuffers::ET_STRING, 0, -1 },
{ flatbuffers::ET_LONG, 0, -1 },
{ flatbuffers::ET_USHORT, 0, -1 }
};
static const char *names[] = {
static const char * const names[] = {
"id",
"val",
"count"
};
static flatbuffers::TypeTable tt = {
static const flatbuffers::TypeTable tt = {
flatbuffers::ST_TABLE, 3, type_codes, nullptr, nullptr, names
};
return &tt;
}
inline flatbuffers::TypeTable *ReferrableTypeTable() {
static flatbuffers::TypeCode type_codes[] = {
inline const flatbuffers::TypeTable *ReferrableTypeTable() {
static const flatbuffers::TypeCode type_codes[] = {
{ flatbuffers::ET_ULONG, 0, -1 }
};
static const char *names[] = {
static const char * const names[] = {
"id"
};
static flatbuffers::TypeTable tt = {
static const flatbuffers::TypeTable tt = {
flatbuffers::ST_TABLE, 1, type_codes, nullptr, nullptr, names
};
return &tt;
}
inline flatbuffers::TypeTable *MonsterTypeTable() {
static flatbuffers::TypeCode type_codes[] = {
inline const flatbuffers::TypeTable *MonsterTypeTable() {
static const flatbuffers::TypeCode type_codes[] = {
{ flatbuffers::ET_SEQUENCE, 0, 0 },
{ flatbuffers::ET_SHORT, 0, -1 },
{ flatbuffers::ET_SHORT, 0, -1 },
@@ -2426,7 +2426,7 @@ inline flatbuffers::TypeTable *MonsterTypeTable() {
{ flatbuffers::ET_ULONG, 0, -1 },
{ flatbuffers::ET_ULONG, 1, -1 }
};
static flatbuffers::TypeFunction type_refs[] = {
static const flatbuffers::TypeFunction type_refs[] = {
Vec3TypeTable,
ColorTypeTable,
AnyTypeTable,
@@ -2437,7 +2437,7 @@ inline flatbuffers::TypeTable *MonsterTypeTable() {
MyGame::InParentNamespaceTypeTable,
ReferrableTypeTable
};
static const char *names[] = {
static const char * const names[] = {
"pos",
"mana",
"hp",
@@ -2482,14 +2482,14 @@ inline flatbuffers::TypeTable *MonsterTypeTable() {
"non_owning_reference",
"vector_of_non_owning_references"
};
static flatbuffers::TypeTable tt = {
static const flatbuffers::TypeTable tt = {
flatbuffers::ST_TABLE, 43, type_codes, type_refs, nullptr, names
};
return &tt;
}
inline flatbuffers::TypeTable *TypeAliasesTypeTable() {
static flatbuffers::TypeCode type_codes[] = {
inline const flatbuffers::TypeTable *TypeAliasesTypeTable() {
static const flatbuffers::TypeCode type_codes[] = {
{ flatbuffers::ET_CHAR, 0, -1 },
{ flatbuffers::ET_UCHAR, 0, -1 },
{ flatbuffers::ET_SHORT, 0, -1 },
@@ -2503,7 +2503,7 @@ inline flatbuffers::TypeTable *TypeAliasesTypeTable() {
{ flatbuffers::ET_CHAR, 1, -1 },
{ flatbuffers::ET_DOUBLE, 1, -1 }
};
static const char *names[] = {
static const char * const names[] = {
"i8",
"u8",
"i16",
@@ -2517,7 +2517,7 @@ inline flatbuffers::TypeTable *TypeAliasesTypeTable() {
"v8",
"vf64"
};
static flatbuffers::TypeTable tt = {
static const flatbuffers::TypeTable tt = {
flatbuffers::ST_TABLE, 12, type_codes, nullptr, nullptr, names
};
return &tt;

View File

@@ -13,9 +13,9 @@ struct TableInNestedNS;
struct StructInNestedNS;
inline flatbuffers::TypeTable *TableInNestedNSTypeTable();
inline const flatbuffers::TypeTable *TableInNestedNSTypeTable();
inline flatbuffers::TypeTable *StructInNestedNSTypeTable();
inline const flatbuffers::TypeTable *StructInNestedNSTypeTable();
enum EnumInNestedNS {
EnumInNestedNS_A = 0,
@@ -25,8 +25,8 @@ enum EnumInNestedNS {
EnumInNestedNS_MAX = EnumInNestedNS_C
};
inline EnumInNestedNS (&EnumValuesEnumInNestedNS())[3] {
static EnumInNestedNS values[] = {
inline const EnumInNestedNS (&EnumValuesEnumInNestedNS())[3] {
static const EnumInNestedNS values[] = {
EnumInNestedNS_A,
EnumInNestedNS_B,
EnumInNestedNS_C
@@ -34,8 +34,8 @@ inline EnumInNestedNS (&EnumValuesEnumInNestedNS())[3] {
return values;
}
inline const char **EnumNamesEnumInNestedNS() {
static const char *names[] = {
inline const char * const *EnumNamesEnumInNestedNS() {
static const char * const names[] = {
"A",
"B",
"C",
@@ -78,7 +78,7 @@ MANUALLY_ALIGNED_STRUCT(4) StructInNestedNS FLATBUFFERS_FINAL_CLASS {
STRUCT_END(StructInNestedNS, 8);
struct TableInNestedNS FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
static flatbuffers::TypeTable *MiniReflectTypeTable() {
static const flatbuffers::TypeTable *MiniReflectTypeTable() {
return TableInNestedNSTypeTable();
}
enum {
@@ -123,50 +123,50 @@ inline flatbuffers::Offset<TableInNestedNS> CreateTableInNestedNS(
return builder_.Finish();
}
inline flatbuffers::TypeTable *EnumInNestedNSTypeTable() {
static flatbuffers::TypeCode type_codes[] = {
inline const flatbuffers::TypeTable *EnumInNestedNSTypeTable() {
static const flatbuffers::TypeCode type_codes[] = {
{ flatbuffers::ET_CHAR, 0, 0 },
{ flatbuffers::ET_CHAR, 0, 0 },
{ flatbuffers::ET_CHAR, 0, 0 }
};
static flatbuffers::TypeFunction type_refs[] = {
static const flatbuffers::TypeFunction type_refs[] = {
EnumInNestedNSTypeTable
};
static const char *names[] = {
static const char * const names[] = {
"A",
"B",
"C"
};
static flatbuffers::TypeTable tt = {
static const flatbuffers::TypeTable tt = {
flatbuffers::ST_ENUM, 3, type_codes, type_refs, nullptr, names
};
return &tt;
}
inline flatbuffers::TypeTable *TableInNestedNSTypeTable() {
static flatbuffers::TypeCode type_codes[] = {
inline const flatbuffers::TypeTable *TableInNestedNSTypeTable() {
static const flatbuffers::TypeCode type_codes[] = {
{ flatbuffers::ET_INT, 0, -1 }
};
static const char *names[] = {
static const char * const names[] = {
"foo"
};
static flatbuffers::TypeTable tt = {
static const flatbuffers::TypeTable tt = {
flatbuffers::ST_TABLE, 1, type_codes, nullptr, nullptr, names
};
return &tt;
}
inline flatbuffers::TypeTable *StructInNestedNSTypeTable() {
static flatbuffers::TypeCode type_codes[] = {
inline const flatbuffers::TypeTable *StructInNestedNSTypeTable() {
static const flatbuffers::TypeCode type_codes[] = {
{ flatbuffers::ET_INT, 0, -1 },
{ flatbuffers::ET_INT, 0, -1 }
};
static const int32_t values[] = { 0, 4, 8 };
static const char *names[] = {
static const char * const names[] = {
"a",
"b"
};
static flatbuffers::TypeTable tt = {
static const flatbuffers::TypeTable tt = {
flatbuffers::ST_STRUCT, 2, type_codes, nullptr, values, names
};
return &tt;

View File

@@ -24,22 +24,22 @@ namespace NamespaceA {
struct SecondTableInA;
inline flatbuffers::TypeTable *TableInFirstNSTypeTable();
inline const flatbuffers::TypeTable *TableInFirstNSTypeTable();
} // namespace NamespaceA
namespace NamespaceC {
inline flatbuffers::TypeTable *TableInCTypeTable();
inline const flatbuffers::TypeTable *TableInCTypeTable();
} // namespace NamespaceC
namespace NamespaceA {
inline flatbuffers::TypeTable *SecondTableInATypeTable();
inline const flatbuffers::TypeTable *SecondTableInATypeTable();
struct TableInFirstNS FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
static flatbuffers::TypeTable *MiniReflectTypeTable() {
static const flatbuffers::TypeTable *MiniReflectTypeTable() {
return TableInFirstNSTypeTable();
}
enum {
@@ -116,7 +116,7 @@ inline flatbuffers::Offset<TableInFirstNS> CreateTableInFirstNS(
namespace NamespaceC {
struct TableInC FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
static flatbuffers::TypeTable *MiniReflectTypeTable() {
static const flatbuffers::TypeTable *MiniReflectTypeTable() {
return TableInCTypeTable();
}
enum {
@@ -181,7 +181,7 @@ inline flatbuffers::Offset<TableInC> CreateTableInC(
namespace NamespaceA {
struct SecondTableInA FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
static flatbuffers::TypeTable *MiniReflectTypeTable() {
static const flatbuffers::TypeTable *MiniReflectTypeTable() {
return SecondTableInATypeTable();
}
enum {
@@ -235,23 +235,23 @@ namespace NamespaceC {
namespace NamespaceA {
inline flatbuffers::TypeTable *TableInFirstNSTypeTable() {
static flatbuffers::TypeCode type_codes[] = {
inline const flatbuffers::TypeTable *TableInFirstNSTypeTable() {
static const flatbuffers::TypeCode type_codes[] = {
{ flatbuffers::ET_SEQUENCE, 0, 0 },
{ flatbuffers::ET_CHAR, 0, 1 },
{ flatbuffers::ET_SEQUENCE, 0, 2 }
};
static flatbuffers::TypeFunction type_refs[] = {
static const flatbuffers::TypeFunction type_refs[] = {
NamespaceA::NamespaceB::TableInNestedNSTypeTable,
NamespaceA::NamespaceB::EnumInNestedNSTypeTable,
NamespaceA::NamespaceB::StructInNestedNSTypeTable
};
static const char *names[] = {
static const char * const names[] = {
"foo_table",
"foo_enum",
"foo_struct"
};
static flatbuffers::TypeTable tt = {
static const flatbuffers::TypeTable tt = {
flatbuffers::ST_TABLE, 3, type_codes, type_refs, nullptr, names
};
return &tt;
@@ -261,20 +261,20 @@ inline flatbuffers::TypeTable *TableInFirstNSTypeTable() {
namespace NamespaceC {
inline flatbuffers::TypeTable *TableInCTypeTable() {
static flatbuffers::TypeCode type_codes[] = {
inline const flatbuffers::TypeTable *TableInCTypeTable() {
static const flatbuffers::TypeCode type_codes[] = {
{ flatbuffers::ET_SEQUENCE, 0, 0 },
{ flatbuffers::ET_SEQUENCE, 0, 1 }
};
static flatbuffers::TypeFunction type_refs[] = {
static const flatbuffers::TypeFunction type_refs[] = {
NamespaceA::TableInFirstNSTypeTable,
NamespaceA::SecondTableInATypeTable
};
static const char *names[] = {
static const char * const names[] = {
"refer_to_a1",
"refer_to_a2"
};
static flatbuffers::TypeTable tt = {
static const flatbuffers::TypeTable tt = {
flatbuffers::ST_TABLE, 2, type_codes, type_refs, nullptr, names
};
return &tt;
@@ -284,17 +284,17 @@ inline flatbuffers::TypeTable *TableInCTypeTable() {
namespace NamespaceA {
inline flatbuffers::TypeTable *SecondTableInATypeTable() {
static flatbuffers::TypeCode type_codes[] = {
inline const flatbuffers::TypeTable *SecondTableInATypeTable() {
static const flatbuffers::TypeCode type_codes[] = {
{ flatbuffers::ET_SEQUENCE, 0, 0 }
};
static flatbuffers::TypeFunction type_refs[] = {
static const flatbuffers::TypeFunction type_refs[] = {
NamespaceC::TableInCTypeTable
};
static const char *names[] = {
static const char * const names[] = {
"refer_to_c"
};
static flatbuffers::TypeTable tt = {
static const flatbuffers::TypeTable tt = {
flatbuffers::ST_TABLE, 1, type_codes, type_refs, nullptr, names
};
return &tt;

View File

@@ -1,6 +1,6 @@
// automatically generated by the FlatBuffers compiler, do not modify
import * as NS4989953370203581498 from "./namespace_test1_generated";
import * as NS39599748 from "./namespace_test1_generated";
/**
* @constructor
*/
@@ -39,24 +39,24 @@ static getRootAsTableInFirstNS(bb:flatbuffers.ByteBuffer, obj?:TableInFirstNS):T
* @param {NamespaceA.NamespaceB.TableInNestedNS=} obj
* @returns {NamespaceA.NamespaceB.TableInNestedNS|null}
*/
fooTable(obj?:NS4989953370203581498.NamespaceA.NamespaceB.TableInNestedNS):NS4989953370203581498.NamespaceA.NamespaceB.TableInNestedNS|null {
fooTable(obj?:NS39599748.NamespaceA.NamespaceB.TableInNestedNS):NS39599748.NamespaceA.NamespaceB.TableInNestedNS|null {
var offset = this.bb!.__offset(this.bb_pos, 4);
return offset ? (obj || new NS4989953370203581498.NamespaceA.NamespaceB.TableInNestedNS).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
return offset ? (obj || new NS39599748.NamespaceA.NamespaceB.TableInNestedNS).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
};
/**
* @returns {NamespaceA.NamespaceB.EnumInNestedNS}
*/
fooEnum():NS4989953370203581498.NamespaceA.NamespaceB.EnumInNestedNS {
fooEnum():NS39599748.NamespaceA.NamespaceB.EnumInNestedNS {
var offset = this.bb!.__offset(this.bb_pos, 6);
return offset ? /** @type {NamespaceA.NamespaceB.EnumInNestedNS} */ (this.bb!.readInt8(this.bb_pos + offset)) : NS4989953370203581498.NamespaceA.NamespaceB.EnumInNestedNS.A;
return offset ? /** @type {NamespaceA.NamespaceB.EnumInNestedNS} */ (this.bb!.readInt8(this.bb_pos + offset)) : NS39599748.NamespaceA.NamespaceB.EnumInNestedNS.A;
};
/**
* @param {NamespaceA.NamespaceB.EnumInNestedNS} value
* @returns {boolean}
*/
mutate_foo_enum(value:NS4989953370203581498.NamespaceA.NamespaceB.EnumInNestedNS):boolean {
mutate_foo_enum(value:NS39599748.NamespaceA.NamespaceB.EnumInNestedNS):boolean {
var offset = this.bb!.__offset(this.bb_pos, 6);
if (offset === 0) {
@@ -71,9 +71,9 @@ mutate_foo_enum(value:NS4989953370203581498.NamespaceA.NamespaceB.EnumInNestedNS
* @param {NamespaceA.NamespaceB.StructInNestedNS=} obj
* @returns {NamespaceA.NamespaceB.StructInNestedNS|null}
*/
fooStruct(obj?:NS4989953370203581498.NamespaceA.NamespaceB.StructInNestedNS):NS4989953370203581498.NamespaceA.NamespaceB.StructInNestedNS|null {
fooStruct(obj?:NS39599748.NamespaceA.NamespaceB.StructInNestedNS):NS39599748.NamespaceA.NamespaceB.StructInNestedNS|null {
var offset = this.bb!.__offset(this.bb_pos, 8);
return offset ? (obj || new NS4989953370203581498.NamespaceA.NamespaceB.StructInNestedNS).__init(this.bb_pos + offset, this.bb!) : null;
return offset ? (obj || new NS39599748.NamespaceA.NamespaceB.StructInNestedNS).__init(this.bb_pos + offset, this.bb!) : null;
};
/**
@@ -95,8 +95,8 @@ static addFooTable(builder:flatbuffers.Builder, fooTableOffset:flatbuffers.Offse
* @param {flatbuffers.Builder} builder
* @param {NamespaceA.NamespaceB.EnumInNestedNS} fooEnum
*/
static addFooEnum(builder:flatbuffers.Builder, fooEnum:NS4989953370203581498.NamespaceA.NamespaceB.EnumInNestedNS) {
builder.addFieldInt8(1, fooEnum, NS4989953370203581498.NamespaceA.NamespaceB.EnumInNestedNS.A);
static addFooEnum(builder:flatbuffers.Builder, fooEnum:NS39599748.NamespaceA.NamespaceB.EnumInNestedNS) {
builder.addFieldInt8(1, fooEnum, NS39599748.NamespaceA.NamespaceB.EnumInNestedNS.A);
};
/**

View File

@@ -16,13 +16,13 @@ struct BookReader;
struct Movie;
struct MovieT;
inline flatbuffers::TypeTable *AttackerTypeTable();
inline const flatbuffers::TypeTable *AttackerTypeTable();
inline flatbuffers::TypeTable *RapunzelTypeTable();
inline const flatbuffers::TypeTable *RapunzelTypeTable();
inline flatbuffers::TypeTable *BookReaderTypeTable();
inline const flatbuffers::TypeTable *BookReaderTypeTable();
inline flatbuffers::TypeTable *MovieTypeTable();
inline const flatbuffers::TypeTable *MovieTypeTable();
enum Character {
Character_NONE = 0,
@@ -36,8 +36,8 @@ enum Character {
Character_MAX = Character_Unused
};
inline Character (&EnumValuesCharacter())[7] {
static Character values[] = {
inline const Character (&EnumValuesCharacter())[7] {
static const Character values[] = {
Character_NONE,
Character_MuLan,
Character_Rapunzel,
@@ -49,8 +49,8 @@ inline Character (&EnumValuesCharacter())[7] {
return values;
}
inline const char **EnumNamesCharacter() {
static const char *names[] = {
inline const char * const *EnumNamesCharacter() {
static const char * const names[] = {
"NONE",
"MuLan",
"Rapunzel",
@@ -191,7 +191,7 @@ struct AttackerT : public flatbuffers::NativeTable {
struct Attacker FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
typedef AttackerT NativeTableType;
static flatbuffers::TypeTable *MiniReflectTypeTable() {
static const flatbuffers::TypeTable *MiniReflectTypeTable() {
return AttackerTypeTable();
}
enum {
@@ -251,7 +251,7 @@ struct MovieT : public flatbuffers::NativeTable {
struct Movie FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
typedef MovieT NativeTableType;
static flatbuffers::TypeTable *MiniReflectTypeTable() {
static const flatbuffers::TypeTable *MiniReflectTypeTable() {
return MovieTypeTable();
}
enum {
@@ -609,8 +609,8 @@ inline void CharacterUnion::Reset() {
type = Character_NONE;
}
inline flatbuffers::TypeTable *CharacterTypeTable() {
static flatbuffers::TypeCode type_codes[] = {
inline const flatbuffers::TypeTable *CharacterTypeTable() {
static const flatbuffers::TypeCode type_codes[] = {
{ flatbuffers::ET_SEQUENCE, 0, -1 },
{ flatbuffers::ET_SEQUENCE, 0, 0 },
{ flatbuffers::ET_SEQUENCE, 0, 1 },
@@ -619,12 +619,12 @@ inline flatbuffers::TypeTable *CharacterTypeTable() {
{ flatbuffers::ET_STRING, 0, -1 },
{ flatbuffers::ET_STRING, 0, -1 }
};
static flatbuffers::TypeFunction type_refs[] = {
static const flatbuffers::TypeFunction type_refs[] = {
AttackerTypeTable,
RapunzelTypeTable,
BookReaderTypeTable
};
static const char *names[] = {
static const char * const names[] = {
"NONE",
"MuLan",
"Rapunzel",
@@ -633,70 +633,70 @@ inline flatbuffers::TypeTable *CharacterTypeTable() {
"Other",
"Unused"
};
static flatbuffers::TypeTable tt = {
static const flatbuffers::TypeTable tt = {
flatbuffers::ST_UNION, 7, type_codes, type_refs, nullptr, names
};
return &tt;
}
inline flatbuffers::TypeTable *AttackerTypeTable() {
static flatbuffers::TypeCode type_codes[] = {
inline const flatbuffers::TypeTable *AttackerTypeTable() {
static const flatbuffers::TypeCode type_codes[] = {
{ flatbuffers::ET_INT, 0, -1 }
};
static const char *names[] = {
static const char * const names[] = {
"sword_attack_damage"
};
static flatbuffers::TypeTable tt = {
static const flatbuffers::TypeTable tt = {
flatbuffers::ST_TABLE, 1, type_codes, nullptr, nullptr, names
};
return &tt;
}
inline flatbuffers::TypeTable *RapunzelTypeTable() {
static flatbuffers::TypeCode type_codes[] = {
inline const flatbuffers::TypeTable *RapunzelTypeTable() {
static const flatbuffers::TypeCode type_codes[] = {
{ flatbuffers::ET_INT, 0, -1 }
};
static const int32_t values[] = { 0, 4 };
static const char *names[] = {
static const char * const names[] = {
"hair_length"
};
static flatbuffers::TypeTable tt = {
static const flatbuffers::TypeTable tt = {
flatbuffers::ST_STRUCT, 1, type_codes, nullptr, values, names
};
return &tt;
}
inline flatbuffers::TypeTable *BookReaderTypeTable() {
static flatbuffers::TypeCode type_codes[] = {
inline const flatbuffers::TypeTable *BookReaderTypeTable() {
static const flatbuffers::TypeCode type_codes[] = {
{ flatbuffers::ET_INT, 0, -1 }
};
static const int32_t values[] = { 0, 4 };
static const char *names[] = {
static const char * const names[] = {
"books_read"
};
static flatbuffers::TypeTable tt = {
static const flatbuffers::TypeTable tt = {
flatbuffers::ST_STRUCT, 1, type_codes, nullptr, values, names
};
return &tt;
}
inline flatbuffers::TypeTable *MovieTypeTable() {
static flatbuffers::TypeCode type_codes[] = {
inline const flatbuffers::TypeTable *MovieTypeTable() {
static const flatbuffers::TypeCode type_codes[] = {
{ flatbuffers::ET_UTYPE, 0, 0 },
{ flatbuffers::ET_SEQUENCE, 0, 0 },
{ flatbuffers::ET_UTYPE, 1, 0 },
{ flatbuffers::ET_SEQUENCE, 1, 0 }
};
static flatbuffers::TypeFunction type_refs[] = {
static const flatbuffers::TypeFunction type_refs[] = {
CharacterTypeTable
};
static const char *names[] = {
static const char * const names[] = {
"main_character_type",
"main_character",
"characters_type",
"characters"
};
static flatbuffers::TypeTable tt = {
static const flatbuffers::TypeTable tt = {
flatbuffers::ST_TABLE, 4, type_codes, type_refs, nullptr, names
};
return &tt;