Break internal Java/C# APIs

This is done on purpose, to avoid API version mismatches that
can cause bad decoding results, see:
https://github.com/google/flatbuffers/issues/5368

Change-Id: I2c857438377e080caad0e2d8bcc758c9b19bd6ec
This commit is contained in:
Wouter van Oortmerssen 2019-05-31 13:00:55 -07:00
parent c978b9ef1f
commit b652fcc3a7
33 changed files with 125 additions and 125 deletions

View File

@ -632,7 +632,7 @@ public class FlatBufferBuilder {
*
* @param numfields The number of fields found in this object.
*/
public void startObject(int numfields) {
public void startTable(int numfields) {
notNested();
if (vtable == null || vtable.length < numfields) vtable = new int[numfields];
vtable_in_use = numfields;
@ -757,11 +757,11 @@ public class FlatBufferBuilder {
* Finish off writing the object that is under construction.
*
* @return The offset to the object inside {@link #dataBuffer()}.
* @see #startObject(int)
* @see #startTable(int)
*/
public int endObject() {
public int endTable() {
if (vtable == null || !nested)
throw new AssertionError("FlatBuffers: endObject called without startObject");
throw new AssertionError("FlatBuffers: endTable called without startTable");
addInt(0);
int vtableloc = offset();
// Write out the current vtable.

View File

@ -411,7 +411,7 @@ namespace FlatBuffers
"FlatBuffers: object serialization must not be nested.");
}
public void StartObject(int numfields)
public void StartTable(int numfields)
{
if (numfields < 0)
throw new ArgumentOutOfRangeException("Flatbuffers: invalid numfields");
@ -621,11 +621,11 @@ namespace FlatBuffers
}
}
public int EndObject()
public int EndTable()
{
if (_vtableSize < 0)
throw new InvalidOperationException(
"Flatbuffers: calling endObject without a startObject");
"Flatbuffers: calling EndTable without a StartTable");
AddInt((int)0);
var vtableloc = Offset;

View File

@ -1308,7 +1308,7 @@ class GeneralGenerator : public BaseGenerator {
}
}
code += ") {\n builder.";
code += FunctionStart('S') + "tartObject(";
code += FunctionStart('S') + "tartTable(";
code += NumToString(struct_def.fields.vec.size()) + ");\n";
for (size_t size = struct_def.sortbysize ? sizeof(largest_scalar_t) : 1;
size; size /= 2) {
@ -1338,7 +1338,7 @@ class GeneralGenerator : public BaseGenerator {
code += " public static void " + FunctionStart('S') + "tart";
code += struct_def.name;
code += "(FlatBufferBuilder builder) { builder.";
code += FunctionStart('S') + "tartObject(";
code += FunctionStart('S') + "tartTable(";
code += NumToString(struct_def.fields.vec.size()) + "); }\n";
for (auto it = struct_def.fields.vec.begin();
it != struct_def.fields.vec.end(); ++it) {
@ -1422,7 +1422,7 @@ class GeneralGenerator : public BaseGenerator {
code += " public static " + GenOffsetType(struct_def) + " ";
code += FunctionStart('E') + "nd" + struct_def.name;
code += "(FlatBufferBuilder builder) {\n int o = builder.";
code += FunctionStart('E') + "ndObject();\n";
code += FunctionStart('E') + "ndTable();\n";
for (auto it = struct_def.fields.vec.begin();
it != struct_def.fields.vec.end(); ++it) {
auto &field = **it;

View File

@ -24,7 +24,7 @@ namespace FlatBuffers.Test
private FlatBufferBuilder CreateBuffer(bool forceDefaults = true)
{
var fbb = new FlatBufferBuilder(16) {ForceDefaults = forceDefaults};
fbb.StartObject(1);
fbb.StartTable(1);
return fbb;
}

View File

@ -174,9 +174,9 @@ namespace FlatBuffers.Test
public void TestEmptyVTable()
{
var builder = new FlatBufferBuilder(1);
builder.StartObject(0);
builder.StartTable(0);
Assert.ArrayEqual(new byte[] { 0 }, builder.DataBuffer.ToFullArray());
builder.EndObject();
builder.EndTable();
Assert.ArrayEqual(new byte[]
{
4, 0, 4, 0,
@ -189,10 +189,10 @@ namespace FlatBuffers.Test
public void TestVTableWithOneBool()
{
var builder = new FlatBufferBuilder(1);
builder.StartObject(1);
builder.StartTable(1);
Assert.ArrayEqual(new byte[] { 0 }, builder.DataBuffer.ToFullArray());
builder.AddBool(0, true, false);
builder.EndObject();
builder.EndTable();
Assert.ArrayEqual(new byte[]
{
0, 0, // padding to 16 bytes
@ -210,10 +210,10 @@ namespace FlatBuffers.Test
public void TestVTableWithOneBool_DefaultValue()
{
var builder = new FlatBufferBuilder(1);
builder.StartObject(1);
builder.StartTable(1);
Assert.ArrayEqual(new byte[] { 0 }, builder.DataBuffer.ToFullArray());
builder.AddBool(0, false, false);
builder.EndObject();
builder.EndTable();
Assert.ArrayEqual(new byte[]
{
// No padding.
@ -229,10 +229,10 @@ namespace FlatBuffers.Test
public void TestVTableWithOneInt16()
{
var builder = new FlatBufferBuilder(1);
builder.StartObject(1);
builder.StartTable(1);
Assert.ArrayEqual(new byte[] { 0 }, builder.DataBuffer.ToFullArray());
builder.AddShort(0, 0x789A, 0);
builder.EndObject();
builder.EndTable();
Assert.ArrayEqual(new byte[]
{
0, 0, // padding to 16 bytes
@ -250,11 +250,11 @@ namespace FlatBuffers.Test
public void TestVTableWithTwoInt16()
{
var builder = new FlatBufferBuilder(1);
builder.StartObject(2);
builder.StartTable(2);
Assert.ArrayEqual(new byte[] { 0 }, builder.DataBuffer.ToFullArray());
builder.AddShort(0, 0x3456, 0);
builder.AddShort(1, 0x789A, 0);
builder.EndObject();
builder.EndTable();
Assert.ArrayEqual(new byte[]
{
8, 0, // vtable bytes
@ -272,11 +272,11 @@ namespace FlatBuffers.Test
public void TestVTableWithInt16AndBool()
{
var builder = new FlatBufferBuilder(1);
builder.StartObject(2);
builder.StartTable(2);
Assert.ArrayEqual(new byte[] { 0 }, builder.DataBuffer.ToFullArray());
builder.AddShort(0, 0x3456, 0);
builder.AddBool(1, true, false);
builder.EndObject();
builder.EndTable();
Assert.ArrayEqual(new byte[]
{
8, 0, // vtable bytes
@ -297,10 +297,10 @@ namespace FlatBuffers.Test
builder.StartVector(sizeof(byte), 0, 1);
var vecEnd = builder.EndVector();
builder.StartObject(1);
builder.StartTable(1);
builder.AddOffset(0, vecEnd.Value, 0);
builder.EndObject();
builder.EndTable();
Assert.ArrayEqual(new byte[]
{
0, 0, 0, 0,
@ -324,10 +324,10 @@ namespace FlatBuffers.Test
builder.StartVector(sizeof(byte), 0, 1);
var vecEnd = builder.EndVector();
builder.StartObject(2);
builder.StartTable(2);
builder.AddShort(0, 55, 0);
builder.AddOffset(1, vecEnd.Value, 0);
builder.EndObject();
builder.EndTable();
Assert.ArrayEqual(new byte[]
{
0, 0, 0, 0,
@ -354,10 +354,10 @@ namespace FlatBuffers.Test
builder.AddShort(0x5678);
var vecEnd = builder.EndVector();
builder.StartObject(2);
builder.StartTable(2);
builder.AddOffset(1, vecEnd.Value, 0);
builder.AddShort(0, 55, 0);
builder.EndObject();
builder.EndTable();
Assert.ArrayEqual(new byte[]
{
0, 0, 0, 0, // Padding to 32 bytes
@ -379,7 +379,7 @@ namespace FlatBuffers.Test
public void TestVTableWithAStruct_of_int8_int16_int32()
{
var builder = new FlatBufferBuilder(1);
builder.StartObject(1);
builder.StartTable(1);
builder.Prep(4+4+4, 0);
builder.AddSbyte(55);
builder.Pad(3);
@ -388,7 +388,7 @@ namespace FlatBuffers.Test
builder.AddInt(0x12345678);
var structStart = builder.Offset;
builder.AddStruct(0, structStart, 0);
builder.EndObject();
builder.EndTable();
Assert.ArrayEqual(new byte[]
{
0, 0, 0, 0,
@ -416,9 +416,9 @@ namespace FlatBuffers.Test
builder.AddByte(66);
var vecEnd = builder.EndVector();
builder.StartObject(1);
builder.StartTable(1);
builder.AddOffset(0, vecEnd.Value, 0);
builder.EndObject();
builder.EndTable();
Assert.ArrayEqual(new byte[]
{
@ -443,10 +443,10 @@ namespace FlatBuffers.Test
public void TestVTableWithSomeElements()
{
var builder = new FlatBufferBuilder(1);
builder.StartObject(2);
builder.StartTable(2);
builder.AddByte(0, 33, 0);
builder.AddShort(1, 66, 0);
var off = builder.EndObject();
var off = builder.EndTable();
builder.Finish(off);
byte[] padded = new byte[]
@ -476,17 +476,17 @@ namespace FlatBuffers.Test
public void TestTwoFinishTable()
{
var builder = new FlatBufferBuilder(1);
builder.StartObject(2);
builder.StartTable(2);
builder.AddByte(0, 33, 0);
builder.AddByte(1, 44, 0);
var off0 = builder.EndObject();
var off0 = builder.EndTable();
builder.Finish(off0);
builder.StartObject(3);
builder.StartTable(3);
builder.AddByte(0, 55, 0);
builder.AddByte(1, 66, 0);
builder.AddByte(2, 77, 0);
var off1 = builder.EndObject();
var off1 = builder.EndTable();
builder.Finish(off1);
Assert.ArrayEqual(new byte[]
@ -527,12 +527,12 @@ namespace FlatBuffers.Test
public void TestBunchOfBools()
{
var builder = new FlatBufferBuilder(1);
builder.StartObject(8);
builder.StartTable(8);
for (var i = 0; i < 8; i++)
{
builder.AddBool(i, true, false);
}
var off = builder.EndObject();
var off = builder.EndTable();
builder.Finish(off);
byte[] padded = new byte[]
@ -575,12 +575,12 @@ namespace FlatBuffers.Test
public void TestBunchOfBoolsSizePrefixed()
{
var builder = new FlatBufferBuilder(1);
builder.StartObject(8);
builder.StartTable(8);
for (var i = 0; i < 8; i++)
{
builder.AddBool(i, true, false);
}
var off = builder.EndObject();
var off = builder.EndTable();
builder.FinishSizePrefixed(off);
byte[] padded = new byte[]
@ -623,9 +623,9 @@ namespace FlatBuffers.Test
public void TestWithFloat()
{
var builder = new FlatBufferBuilder(1);
builder.StartObject(1);
builder.StartTable(1);
builder.AddFloat(0, 1, 0);
builder.EndObject();
builder.EndTable();
Assert.ArrayEqual(new byte[]
@ -653,7 +653,7 @@ namespace FlatBuffers.Test
for (var i = 0; i < objectCount; ++i)
{
builder.StartObject(fieldCount);
builder.StartTable(fieldCount);
for (var j = 0; j < fieldCount; ++j)
{
@ -722,7 +722,7 @@ namespace FlatBuffers.Test
}
var offset = builder.EndObject();
var offset = builder.EndTable();
// Store the object offset
objects[i] = offset;

View File

@ -188,7 +188,7 @@ public struct Monster : IFlatbufferObject
public Color[] GetVectorOfEnumsArray() { return __p.__vector_as_array<Color>(98); }
public bool MutateVectorOfEnums(int j, Color vector_of_enums) { int o = __p.__offset(98); if (o != 0) { __p.bb.Put(__p.__vector(o) + j * 1, (byte)vector_of_enums); return true; } else { return false; } }
public static void StartMonster(FlatBufferBuilder builder) { builder.StartObject(48); }
public static void StartMonster(FlatBufferBuilder builder) { builder.StartTable(48); }
public static void AddPos(FlatBufferBuilder builder, Offset<Vec3> posOffset) { builder.AddStruct(0, posOffset.Value, 0); }
public static void AddMana(FlatBufferBuilder builder, short mana) { builder.AddShort(1, mana, 150); }
public static void AddHp(FlatBufferBuilder builder, short hp) { builder.AddShort(2, hp, 100); }
@ -285,7 +285,7 @@ public struct Monster : IFlatbufferObject
public static VectorOffset CreateVectorOfEnumsVectorBlock(FlatBufferBuilder builder, Color[] data) { builder.StartVector(1, data.Length, 1); builder.Add(data); return builder.EndVector(); }
public static void StartVectorOfEnumsVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(1, numElems, 1); }
public static Offset<Monster> EndMonster(FlatBufferBuilder builder) {
int o = builder.EndObject();
int o = builder.EndTable();
builder.Required(o, 10); // name
return new Offset<Monster>(o);
}

View File

@ -159,7 +159,7 @@ public final class Monster extends Table {
public ByteBuffer vectorOfEnumsInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 98, 1); }
public boolean mutateVectorOfEnums(int j, int vector_of_enums) { int o = __offset(98); if (o != 0) { bb.put(__vector(o) + j * 1, (byte)vector_of_enums); return true; } else { return false; } }
public static void startMonster(FlatBufferBuilder builder) { builder.startObject(48); }
public static void startMonster(FlatBufferBuilder builder) { builder.startTable(48); }
public static void addPos(FlatBufferBuilder builder, int posOffset) { builder.addStruct(0, posOffset, 0); }
public static void addMana(FlatBufferBuilder builder, short mana) { builder.addShort(1, mana, 150); }
public static void addHp(FlatBufferBuilder builder, short hp) { builder.addShort(2, hp, 100); }
@ -241,7 +241,7 @@ public final class Monster extends Table {
public static int createVectorOfEnumsVector(FlatBufferBuilder builder, byte[] data) { builder.startVector(1, data.length, 1); for (int i = data.length - 1; i >= 0; i--) builder.addByte(data[i]); return builder.endVector(); }
public static void startVectorOfEnumsVector(FlatBufferBuilder builder, int numElems) { builder.startVector(1, numElems, 1); }
public static int endMonster(FlatBufferBuilder builder) {
int o = builder.endObject();
int o = builder.endTable();
builder.required(o, 10); // name
return o;
}

View File

@ -22,15 +22,15 @@ public struct Referrable : IFlatbufferObject
public static Offset<Referrable> CreateReferrable(FlatBufferBuilder builder,
ulong id = 0) {
builder.StartObject(1);
builder.StartTable(1);
Referrable.AddId(builder, id);
return Referrable.EndReferrable(builder);
}
public static void StartReferrable(FlatBufferBuilder builder) { builder.StartObject(1); }
public static void StartReferrable(FlatBufferBuilder builder) { builder.StartTable(1); }
public static void AddId(FlatBufferBuilder builder, ulong id) { builder.AddUlong(0, id, 0); }
public static Offset<Referrable> EndReferrable(FlatBufferBuilder builder) {
int o = builder.EndObject();
int o = builder.EndTable();
return new Offset<Referrable>(o);
}

View File

@ -19,15 +19,15 @@ public final class Referrable extends Table {
public static int createReferrable(FlatBufferBuilder builder,
long id) {
builder.startObject(1);
builder.startTable(1);
Referrable.addId(builder, id);
return Referrable.endReferrable(builder);
}
public static void startReferrable(FlatBufferBuilder builder) { builder.startObject(1); }
public static void startReferrable(FlatBufferBuilder builder) { builder.startTable(1); }
public static void addId(FlatBufferBuilder builder, long id) { builder.addLong(0, id, 0L); }
public static int endReferrable(FlatBufferBuilder builder) {
int o = builder.endObject();
int o = builder.endTable();
return o;
}

View File

@ -33,19 +33,19 @@ public struct Stat : IFlatbufferObject
StringOffset idOffset = default(StringOffset),
long val = 0,
ushort count = 0) {
builder.StartObject(3);
builder.StartTable(3);
Stat.AddVal(builder, val);
Stat.AddId(builder, idOffset);
Stat.AddCount(builder, count);
return Stat.EndStat(builder);
}
public static void StartStat(FlatBufferBuilder builder) { builder.StartObject(3); }
public static void StartStat(FlatBufferBuilder builder) { builder.StartTable(3); }
public static void AddId(FlatBufferBuilder builder, StringOffset idOffset) { builder.AddOffset(0, idOffset.Value, 0); }
public static void AddVal(FlatBufferBuilder builder, long val) { builder.AddLong(1, val, 0); }
public static void AddCount(FlatBufferBuilder builder, ushort count) { builder.AddUshort(2, count, 0); }
public static Offset<Stat> EndStat(FlatBufferBuilder builder) {
int o = builder.EndObject();
int o = builder.EndTable();
return new Offset<Stat>(o);
}
};

View File

@ -26,19 +26,19 @@ public final class Stat extends Table {
int idOffset,
long val,
int count) {
builder.startObject(3);
builder.startTable(3);
Stat.addVal(builder, val);
Stat.addId(builder, idOffset);
Stat.addCount(builder, count);
return Stat.endStat(builder);
}
public static void startStat(FlatBufferBuilder builder) { builder.startObject(3); }
public static void startStat(FlatBufferBuilder builder) { builder.startTable(3); }
public static void addId(FlatBufferBuilder builder, int idOffset) { builder.addOffset(0, idOffset, 0); }
public static void addVal(FlatBufferBuilder builder, long val) { builder.addLong(1, val, 0L); }
public static void addCount(FlatBufferBuilder builder, int count) { builder.addShort(2, (short)count, (short)0); }
public static int endStat(FlatBufferBuilder builder) {
int o = builder.endObject();
int o = builder.endTable();
return o;
}
}

View File

@ -22,15 +22,15 @@ internal partial struct TestSimpleTableWithEnum : IFlatbufferObject
public static Offset<TestSimpleTableWithEnum> CreateTestSimpleTableWithEnum(FlatBufferBuilder builder,
Color color = Color.Green) {
builder.StartObject(1);
builder.StartTable(1);
TestSimpleTableWithEnum.AddColor(builder, color);
return TestSimpleTableWithEnum.EndTestSimpleTableWithEnum(builder);
}
public static void StartTestSimpleTableWithEnum(FlatBufferBuilder builder) { builder.StartObject(1); }
public static void StartTestSimpleTableWithEnum(FlatBufferBuilder builder) { builder.StartTable(1); }
public static void AddColor(FlatBufferBuilder builder, Color color) { builder.AddByte(0, (byte)color, 2); }
public static Offset<TestSimpleTableWithEnum> EndTestSimpleTableWithEnum(FlatBufferBuilder builder) {
int o = builder.EndObject();
int o = builder.EndTable();
return new Offset<TestSimpleTableWithEnum>(o);
}
};

View File

@ -19,15 +19,15 @@ final class TestSimpleTableWithEnum extends Table {
public static int createTestSimpleTableWithEnum(FlatBufferBuilder builder,
int color) {
builder.startObject(1);
builder.startTable(1);
TestSimpleTableWithEnum.addColor(builder, color);
return TestSimpleTableWithEnum.endTestSimpleTableWithEnum(builder);
}
public static void startTestSimpleTableWithEnum(FlatBufferBuilder builder) { builder.startObject(1); }
public static void startTestSimpleTableWithEnum(FlatBufferBuilder builder) { builder.startTable(1); }
public static void addColor(FlatBufferBuilder builder, int color) { builder.addByte(0, (byte)color, (byte)2); }
public static int endTestSimpleTableWithEnum(FlatBufferBuilder builder) {
int o = builder.endObject();
int o = builder.endTable();
return o;
}
}

View File

@ -69,7 +69,7 @@ public struct TypeAliases : IFlatbufferObject
double f64 = 0.0,
VectorOffset v8Offset = default(VectorOffset),
VectorOffset vf64Offset = default(VectorOffset)) {
builder.StartObject(12);
builder.StartTable(12);
TypeAliases.AddF64(builder, f64);
TypeAliases.AddU64(builder, u64);
TypeAliases.AddI64(builder, i64);
@ -85,7 +85,7 @@ public struct TypeAliases : IFlatbufferObject
return TypeAliases.EndTypeAliases(builder);
}
public static void StartTypeAliases(FlatBufferBuilder builder) { builder.StartObject(12); }
public static void StartTypeAliases(FlatBufferBuilder builder) { builder.StartTable(12); }
public static void AddI8(FlatBufferBuilder builder, sbyte i8) { builder.AddSbyte(0, i8, 0); }
public static void AddU8(FlatBufferBuilder builder, byte u8) { builder.AddByte(1, u8, 0); }
public static void AddI16(FlatBufferBuilder builder, short i16) { builder.AddShort(2, i16, 0); }
@ -105,7 +105,7 @@ public struct TypeAliases : IFlatbufferObject
public static VectorOffset CreateVf64VectorBlock(FlatBufferBuilder builder, double[] data) { builder.StartVector(8, data.Length, 8); builder.Add(data); return builder.EndVector(); }
public static void StartVf64Vector(FlatBufferBuilder builder, int numElems) { builder.StartVector(8, numElems, 8); }
public static Offset<TypeAliases> EndTypeAliases(FlatBufferBuilder builder) {
int o = builder.EndObject();
int o = builder.EndTable();
return new Offset<TypeAliases>(o);
}
};

View File

@ -58,7 +58,7 @@ public final class TypeAliases extends Table {
double f64,
int v8Offset,
int vf64Offset) {
builder.startObject(12);
builder.startTable(12);
TypeAliases.addF64(builder, f64);
TypeAliases.addU64(builder, u64);
TypeAliases.addI64(builder, i64);
@ -74,7 +74,7 @@ public final class TypeAliases extends Table {
return TypeAliases.endTypeAliases(builder);
}
public static void startTypeAliases(FlatBufferBuilder builder) { builder.startObject(12); }
public static void startTypeAliases(FlatBufferBuilder builder) { builder.startTable(12); }
public static void addI8(FlatBufferBuilder builder, byte i8) { builder.addByte(0, i8, 0); }
public static void addU8(FlatBufferBuilder builder, int u8) { builder.addByte(1, (byte)u8, (byte)0); }
public static void addI16(FlatBufferBuilder builder, short i16) { builder.addShort(2, i16, 0); }
@ -92,7 +92,7 @@ public final class TypeAliases extends Table {
public static int createVf64Vector(FlatBufferBuilder builder, double[] data) { builder.startVector(8, data.length, 8); for (int i = data.length - 1; i >= 0; i--) builder.addDouble(data[i]); return builder.endVector(); }
public static void startVf64Vector(FlatBufferBuilder builder, int numElems) { builder.startVector(8, numElems, 8); }
public static int endTypeAliases(FlatBufferBuilder builder) {
int o = builder.endObject();
int o = builder.endTable();
return o;
}
}

View File

@ -18,9 +18,9 @@ public struct Monster : IFlatbufferObject
public Monster __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public static void StartMonster(FlatBufferBuilder builder) { builder.StartObject(0); }
public static void StartMonster(FlatBufferBuilder builder) { builder.StartTable(0); }
public static Offset<Monster> EndMonster(FlatBufferBuilder builder) {
int o = builder.EndObject();
int o = builder.EndTable();
return new Offset<Monster>(o);
}
};

View File

@ -15,9 +15,9 @@ public final class Monster extends Table {
public Monster __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public static void startMonster(FlatBufferBuilder builder) { builder.startObject(0); }
public static void startMonster(FlatBufferBuilder builder) { builder.startTable(0); }
public static int endMonster(FlatBufferBuilder builder) {
int o = builder.endObject();
int o = builder.endTable();
return o;
}
}

View File

@ -18,9 +18,9 @@ public struct InParentNamespace : IFlatbufferObject
public InParentNamespace __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public static void StartInParentNamespace(FlatBufferBuilder builder) { builder.StartObject(0); }
public static void StartInParentNamespace(FlatBufferBuilder builder) { builder.StartTable(0); }
public static Offset<InParentNamespace> EndInParentNamespace(FlatBufferBuilder builder) {
int o = builder.EndObject();
int o = builder.EndTable();
return new Offset<InParentNamespace>(o);
}
};

View File

@ -15,9 +15,9 @@ public final class InParentNamespace extends Table {
public InParentNamespace __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public static void startInParentNamespace(FlatBufferBuilder builder) { builder.startObject(0); }
public static void startInParentNamespace(FlatBufferBuilder builder) { builder.startTable(0); }
public static int endInParentNamespace(FlatBufferBuilder builder) {
int o = builder.endObject();
int o = builder.endTable();
return o;
}
}

View File

@ -58,7 +58,7 @@ public struct MonsterExtra : IFlatbufferObject
double testd_ninf = Double.NegativeInfinity,
VectorOffset testf_vecOffset = default(VectorOffset),
VectorOffset testd_vecOffset = default(VectorOffset)) {
builder.StartObject(8);
builder.StartTable(8);
MonsterExtra.AddTestdNinf(builder, testd_ninf);
MonsterExtra.AddTestdPinf(builder, testd_pinf);
MonsterExtra.AddTestdNan(builder, testd_nan);
@ -70,7 +70,7 @@ public struct MonsterExtra : IFlatbufferObject
return MonsterExtra.EndMonsterExtra(builder);
}
public static void StartMonsterExtra(FlatBufferBuilder builder) { builder.StartObject(8); }
public static void StartMonsterExtra(FlatBufferBuilder builder) { builder.StartTable(8); }
public static void AddTestfNan(FlatBufferBuilder builder, float testfNan) { builder.AddFloat(0, testfNan, Single.NaN); }
public static void AddTestfPinf(FlatBufferBuilder builder, float testfPinf) { builder.AddFloat(1, testfPinf, Single.PositiveInfinity); }
public static void AddTestfNinf(FlatBufferBuilder builder, float testfNinf) { builder.AddFloat(2, testfNinf, Single.NegativeInfinity); }
@ -86,7 +86,7 @@ public struct MonsterExtra : IFlatbufferObject
public static VectorOffset CreateTestdVecVectorBlock(FlatBufferBuilder builder, double[] data) { builder.StartVector(8, data.Length, 8); builder.Add(data); return builder.EndVector(); }
public static void StartTestdVecVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(8, numElems, 8); }
public static Offset<MonsterExtra> EndMonsterExtra(FlatBufferBuilder builder) {
int o = builder.EndObject();
int o = builder.EndTable();
return new Offset<MonsterExtra>(o);
}
public static void FinishMonsterExtraBuffer(FlatBufferBuilder builder, Offset<MonsterExtra> offset) { builder.Finish(offset.Value, "MONE"); }

View File

@ -47,7 +47,7 @@ public final class MonsterExtra extends Table {
double testd_ninf,
int testf_vecOffset,
int testd_vecOffset) {
builder.startObject(8);
builder.startTable(8);
MonsterExtra.addTestdNinf(builder, testd_ninf);
MonsterExtra.addTestdPinf(builder, testd_pinf);
MonsterExtra.addTestdNan(builder, testd_nan);
@ -59,7 +59,7 @@ public final class MonsterExtra extends Table {
return MonsterExtra.endMonsterExtra(builder);
}
public static void startMonsterExtra(FlatBufferBuilder builder) { builder.startObject(8); }
public static void startMonsterExtra(FlatBufferBuilder builder) { builder.startTable(8); }
public static void addTestfNan(FlatBufferBuilder builder, float testfNan) { builder.addFloat(0, testfNan, Float.NaN); }
public static void addTestfPinf(FlatBufferBuilder builder, float testfPinf) { builder.addFloat(1, testfPinf, Float.POSITIVE_INFINITY); }
public static void addTestfNinf(FlatBufferBuilder builder, float testfNinf) { builder.addFloat(2, testfNinf, Float.NEGATIVE_INFINITY); }
@ -73,7 +73,7 @@ public final class MonsterExtra extends Table {
public static int createTestdVecVector(FlatBufferBuilder builder, double[] data) { builder.startVector(8, data.length, 8); for (int i = data.length - 1; i >= 0; i--) builder.addDouble(data[i]); return builder.endVector(); }
public static void startTestdVecVector(FlatBufferBuilder builder, int numElems) { builder.startVector(8, numElems, 8); }
public static int endMonsterExtra(FlatBufferBuilder builder) {
int o = builder.endObject();
int o = builder.endTable();
return o;
}
public static void finishMonsterExtraBuffer(FlatBufferBuilder builder, int offset) { builder.finish(offset, "MONE"); }

View File

@ -22,15 +22,15 @@ public struct TableInNestedNS : IFlatbufferObject
public static Offset<TableInNestedNS> CreateTableInNestedNS(FlatBufferBuilder builder,
int foo = 0) {
builder.StartObject(1);
builder.StartTable(1);
TableInNestedNS.AddFoo(builder, foo);
return TableInNestedNS.EndTableInNestedNS(builder);
}
public static void StartTableInNestedNS(FlatBufferBuilder builder) { builder.StartObject(1); }
public static void StartTableInNestedNS(FlatBufferBuilder builder) { builder.StartTable(1); }
public static void AddFoo(FlatBufferBuilder builder, int foo) { builder.AddInt(0, foo, 0); }
public static Offset<TableInNestedNS> EndTableInNestedNS(FlatBufferBuilder builder) {
int o = builder.EndObject();
int o = builder.EndTable();
return new Offset<TableInNestedNS>(o);
}
};

View File

@ -19,15 +19,15 @@ public final class TableInNestedNS extends Table {
public static int createTableInNestedNS(FlatBufferBuilder builder,
int foo) {
builder.startObject(1);
builder.startTable(1);
TableInNestedNS.addFoo(builder, foo);
return TableInNestedNS.endTableInNestedNS(builder);
}
public static void startTableInNestedNS(FlatBufferBuilder builder) { builder.startObject(1); }
public static void startTableInNestedNS(FlatBufferBuilder builder) { builder.startTable(1); }
public static void addFoo(FlatBufferBuilder builder, int foo) { builder.addInt(0, foo, 0); }
public static int endTableInNestedNS(FlatBufferBuilder builder) {
int o = builder.endObject();
int o = builder.endTable();
return o;
}
}

View File

@ -21,15 +21,15 @@ public struct SecondTableInA : IFlatbufferObject
public static Offset<SecondTableInA> CreateSecondTableInA(FlatBufferBuilder builder,
Offset<NamespaceC.TableInC> refer_to_cOffset = default(Offset<NamespaceC.TableInC>)) {
builder.StartObject(1);
builder.StartTable(1);
SecondTableInA.AddReferToC(builder, refer_to_cOffset);
return SecondTableInA.EndSecondTableInA(builder);
}
public static void StartSecondTableInA(FlatBufferBuilder builder) { builder.StartObject(1); }
public static void StartSecondTableInA(FlatBufferBuilder builder) { builder.StartTable(1); }
public static void AddReferToC(FlatBufferBuilder builder, Offset<NamespaceC.TableInC> referToCOffset) { builder.AddOffset(0, referToCOffset.Value, 0); }
public static Offset<SecondTableInA> EndSecondTableInA(FlatBufferBuilder builder) {
int o = builder.EndObject();
int o = builder.EndTable();
return new Offset<SecondTableInA>(o);
}
};

View File

@ -19,15 +19,15 @@ public final class SecondTableInA extends Table {
public static int createSecondTableInA(FlatBufferBuilder builder,
int refer_to_cOffset) {
builder.startObject(1);
builder.startTable(1);
SecondTableInA.addReferToC(builder, refer_to_cOffset);
return SecondTableInA.endSecondTableInA(builder);
}
public static void startSecondTableInA(FlatBufferBuilder builder) { builder.startObject(1); }
public static void startSecondTableInA(FlatBufferBuilder builder) { builder.startTable(1); }
public static void addReferToC(FlatBufferBuilder builder, int referToCOffset) { builder.addOffset(0, referToCOffset, 0); }
public static int endSecondTableInA(FlatBufferBuilder builder) {
int o = builder.endObject();
int o = builder.endTable();
return o;
}
}

View File

@ -22,12 +22,12 @@ public struct TableInFirstNS : IFlatbufferObject
public bool MutateFooEnum(NamespaceA.NamespaceB.EnumInNestedNS foo_enum) { int o = __p.__offset(6); if (o != 0) { __p.bb.PutSbyte(o + __p.bb_pos, (sbyte)foo_enum); return true; } else { return false; } }
public NamespaceA.NamespaceB.StructInNestedNS? FooStruct { get { int o = __p.__offset(8); return o != 0 ? (NamespaceA.NamespaceB.StructInNestedNS?)(new NamespaceA.NamespaceB.StructInNestedNS()).__assign(o + __p.bb_pos, __p.bb) : null; } }
public static void StartTableInFirstNS(FlatBufferBuilder builder) { builder.StartObject(3); }
public static void StartTableInFirstNS(FlatBufferBuilder builder) { builder.StartTable(3); }
public static void AddFooTable(FlatBufferBuilder builder, Offset<NamespaceA.NamespaceB.TableInNestedNS> fooTableOffset) { builder.AddOffset(0, fooTableOffset.Value, 0); }
public static void AddFooEnum(FlatBufferBuilder builder, NamespaceA.NamespaceB.EnumInNestedNS fooEnum) { builder.AddSbyte(1, (sbyte)fooEnum, 0); }
public static void AddFooStruct(FlatBufferBuilder builder, Offset<NamespaceA.NamespaceB.StructInNestedNS> fooStructOffset) { builder.AddStruct(2, fooStructOffset.Value, 0); }
public static Offset<TableInFirstNS> EndTableInFirstNS(FlatBufferBuilder builder) {
int o = builder.EndObject();
int o = builder.EndTable();
return new Offset<TableInFirstNS>(o);
}
};

View File

@ -21,12 +21,12 @@ public final class TableInFirstNS extends Table {
public NamespaceA.NamespaceB.StructInNestedNS fooStruct() { return fooStruct(new NamespaceA.NamespaceB.StructInNestedNS()); }
public NamespaceA.NamespaceB.StructInNestedNS fooStruct(NamespaceA.NamespaceB.StructInNestedNS obj) { int o = __offset(8); return o != 0 ? obj.__assign(o + bb_pos, bb) : null; }
public static void startTableInFirstNS(FlatBufferBuilder builder) { builder.startObject(3); }
public static void startTableInFirstNS(FlatBufferBuilder builder) { builder.startTable(3); }
public static void addFooTable(FlatBufferBuilder builder, int fooTableOffset) { builder.addOffset(0, fooTableOffset, 0); }
public static void addFooEnum(FlatBufferBuilder builder, byte fooEnum) { builder.addByte(1, fooEnum, 0); }
public static void addFooStruct(FlatBufferBuilder builder, int fooStructOffset) { builder.addStruct(2, fooStructOffset, 0); }
public static int endTableInFirstNS(FlatBufferBuilder builder) {
int o = builder.endObject();
int o = builder.endTable();
return o;
}
}

View File

@ -23,17 +23,17 @@ public struct TableInC : IFlatbufferObject
public static Offset<TableInC> CreateTableInC(FlatBufferBuilder builder,
Offset<NamespaceA.TableInFirstNS> refer_to_a1Offset = default(Offset<NamespaceA.TableInFirstNS>),
Offset<NamespaceA.SecondTableInA> refer_to_a2Offset = default(Offset<NamespaceA.SecondTableInA>)) {
builder.StartObject(2);
builder.StartTable(2);
TableInC.AddReferToA2(builder, refer_to_a2Offset);
TableInC.AddReferToA1(builder, refer_to_a1Offset);
return TableInC.EndTableInC(builder);
}
public static void StartTableInC(FlatBufferBuilder builder) { builder.StartObject(2); }
public static void StartTableInC(FlatBufferBuilder builder) { builder.StartTable(2); }
public static void AddReferToA1(FlatBufferBuilder builder, Offset<NamespaceA.TableInFirstNS> referToA1Offset) { builder.AddOffset(0, referToA1Offset.Value, 0); }
public static void AddReferToA2(FlatBufferBuilder builder, Offset<NamespaceA.SecondTableInA> referToA2Offset) { builder.AddOffset(1, referToA2Offset.Value, 0); }
public static Offset<TableInC> EndTableInC(FlatBufferBuilder builder) {
int o = builder.EndObject();
int o = builder.EndTable();
return new Offset<TableInC>(o);
}
};

View File

@ -22,17 +22,17 @@ public final class TableInC extends Table {
public static int createTableInC(FlatBufferBuilder builder,
int refer_to_a1Offset,
int refer_to_a2Offset) {
builder.startObject(2);
builder.startTable(2);
TableInC.addReferToA2(builder, refer_to_a2Offset);
TableInC.addReferToA1(builder, refer_to_a1Offset);
return TableInC.endTableInC(builder);
}
public static void startTableInC(FlatBufferBuilder builder) { builder.startObject(2); }
public static void startTableInC(FlatBufferBuilder builder) { builder.startTable(2); }
public static void addReferToA1(FlatBufferBuilder builder, int referToA1Offset) { builder.addOffset(0, referToA1Offset, 0); }
public static void addReferToA2(FlatBufferBuilder builder, int referToA2Offset) { builder.addOffset(1, referToA2Offset, 0); }
public static int endTableInC(FlatBufferBuilder builder) {
int o = builder.endObject();
int o = builder.endTable();
return o;
}
}

View File

@ -19,15 +19,15 @@ public struct Attacker : IFlatbufferObject
public static Offset<Attacker> CreateAttacker(FlatBufferBuilder builder,
int sword_attack_damage = 0) {
builder.StartObject(1);
builder.StartTable(1);
Attacker.AddSwordAttackDamage(builder, sword_attack_damage);
return Attacker.EndAttacker(builder);
}
public static void StartAttacker(FlatBufferBuilder builder) { builder.StartObject(1); }
public static void StartAttacker(FlatBufferBuilder builder) { builder.StartTable(1); }
public static void AddSwordAttackDamage(FlatBufferBuilder builder, int swordAttackDamage) { builder.AddInt(0, swordAttackDamage, 0); }
public static Offset<Attacker> EndAttacker(FlatBufferBuilder builder) {
int o = builder.EndObject();
int o = builder.EndTable();
return new Offset<Attacker>(o);
}
};

View File

@ -17,15 +17,15 @@ public final class Attacker extends Table {
public static int createAttacker(FlatBufferBuilder builder,
int sword_attack_damage) {
builder.startObject(1);
builder.startTable(1);
Attacker.addSwordAttackDamage(builder, sword_attack_damage);
return Attacker.endAttacker(builder);
}
public static void startAttacker(FlatBufferBuilder builder) { builder.startObject(1); }
public static void startAttacker(FlatBufferBuilder builder) { builder.startTable(1); }
public static void addSwordAttackDamage(FlatBufferBuilder builder, int swordAttackDamage) { builder.addInt(0, swordAttackDamage, 0); }
public static int endAttacker(FlatBufferBuilder builder) {
int o = builder.endObject();
int o = builder.endTable();
return o;
}
}

View File

@ -35,7 +35,7 @@ public struct Movie : IFlatbufferObject
int main_characterOffset = 0,
VectorOffset characters_typeOffset = default(VectorOffset),
VectorOffset charactersOffset = default(VectorOffset)) {
builder.StartObject(4);
builder.StartTable(4);
Movie.AddCharacters(builder, charactersOffset);
Movie.AddCharactersType(builder, characters_typeOffset);
Movie.AddMainCharacter(builder, main_characterOffset);
@ -43,7 +43,7 @@ public struct Movie : IFlatbufferObject
return Movie.EndMovie(builder);
}
public static void StartMovie(FlatBufferBuilder builder) { builder.StartObject(4); }
public static void StartMovie(FlatBufferBuilder builder) { builder.StartTable(4); }
public static void AddMainCharacterType(FlatBufferBuilder builder, Character mainCharacterType) { builder.AddByte(0, (byte)mainCharacterType, 0); }
public static void AddMainCharacter(FlatBufferBuilder builder, int mainCharacterOffset) { builder.AddOffset(1, mainCharacterOffset, 0); }
public static void AddCharactersType(FlatBufferBuilder builder, VectorOffset charactersTypeOffset) { builder.AddOffset(2, charactersTypeOffset.Value, 0); }
@ -55,7 +55,7 @@ public struct Movie : IFlatbufferObject
public static VectorOffset CreateCharactersVectorBlock(FlatBufferBuilder builder, int[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
public static void StartCharactersVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
public static Offset<Movie> EndMovie(FlatBufferBuilder builder) {
int o = builder.EndObject();
int o = builder.EndTable();
return new Offset<Movie>(o);
}
public static void FinishMovieBuffer(FlatBufferBuilder builder, Offset<Movie> offset) { builder.Finish(offset.Value, "MOVI"); }

View File

@ -29,7 +29,7 @@ public final class Movie extends Table {
int main_characterOffset,
int characters_typeOffset,
int charactersOffset) {
builder.startObject(4);
builder.startTable(4);
Movie.addCharacters(builder, charactersOffset);
Movie.addCharactersType(builder, characters_typeOffset);
Movie.addMainCharacter(builder, main_characterOffset);
@ -37,7 +37,7 @@ public final class Movie extends Table {
return Movie.endMovie(builder);
}
public static void startMovie(FlatBufferBuilder builder) { builder.startObject(4); }
public static void startMovie(FlatBufferBuilder builder) { builder.startTable(4); }
public static void addMainCharacterType(FlatBufferBuilder builder, byte mainCharacterType) { builder.addByte(0, mainCharacterType, 0); }
public static void addMainCharacter(FlatBufferBuilder builder, int mainCharacterOffset) { builder.addOffset(1, mainCharacterOffset, 0); }
public static void addCharactersType(FlatBufferBuilder builder, int charactersTypeOffset) { builder.addOffset(2, charactersTypeOffset, 0); }
@ -47,7 +47,7 @@ public final class Movie extends Table {
public static int createCharactersVector(FlatBufferBuilder builder, int[] data) { builder.startVector(4, data.length, 4); for (int i = data.length - 1; i >= 0; i--) builder.addOffset(data[i]); return builder.endVector(); }
public static void startCharactersVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
public static int endMovie(FlatBufferBuilder builder) {
int o = builder.endObject();
int o = builder.endTable();
return o;
}
public static void finishMovieBuffer(FlatBufferBuilder builder, int offset) { builder.finish(offset, "MOVI"); }