Add FLATBUFFERS_COMPATIBILITY string (#5381)

* Add FLATBUFFERS_COMPATIBILITY string

- Add a new __reset method NET/JAVA which hides internal state

* Resolve PR notes

* Use operator new() to __init of Struct and Table

* Restrict visibility of C# Table/Struct to internal level
This commit is contained in:
Vladimir Glavnyy 2019-06-18 00:16:21 +07:00 committed by Wouter van Oortmerssen
parent a80db8538c
commit 0d2cebccfe
49 changed files with 191 additions and 101 deletions

View File

@ -144,6 +144,10 @@
#define FLATBUFFERS_VERSION_REVISION 0
#define FLATBUFFERS_STRING_EXPAND(X) #X
#define FLATBUFFERS_STRING(X) FLATBUFFERS_STRING_EXPAND(X)
namespace flatbuffers {
// Returns version as string "MAJOR.MINOR.REVISION".
const char* FLATBUFFERS_VERSION();
}
#if (!defined(_MSC_VER) || _MSC_VER > 1600) && \
(!defined(__GNUC__) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 407)) || \

View File

@ -29,6 +29,21 @@ public class Struct {
/** The underlying ByteBuffer to hold the data of the Struct. */
protected ByteBuffer bb;
/**
* Re-init the internal state with an external buffer {@code ByteBuffer} and an offset within.
*
* This method exists primarily to allow recycling Table instances without risking memory leaks
* due to {@code ByteBuffer} references.
*/
protected void __reset(int _i, ByteBuffer _bb) {
bb = _bb;
if (bb != null) {
bb_pos = _i;
} else {
bb_pos = 0;
}
}
/**
* Resets internal state with a null {@code ByteBuffer} and a zero position.
*
@ -39,8 +54,7 @@ public class Struct {
* @param struct the instance to reset to initial state
*/
public void __reset() {
bb = null;
bb_pos = 0;
__reset(0, null);
}
}

View File

@ -38,9 +38,9 @@ public class Table {
/** The underlying ByteBuffer to hold the data of the Table. */
protected ByteBuffer bb;
/** Used to hold the vtable position. */
protected int vtable_start;
private int vtable_start;
/** Used to hold the vtable size. */
protected int vtable_size;
private int vtable_size;
Utf8 utf8 = Utf8.getDefault();
/**
@ -263,6 +263,25 @@ public class Table {
return len_1 - len_2;
}
/**
* Re-init the internal state with an external buffer {@code ByteBuffer} and an offset within.
*
* This method exists primarily to allow recycling Table instances without risking memory leaks
* due to {@code ByteBuffer} references.
*/
protected void __reset(int _i, ByteBuffer _bb) {
bb = _bb;
if (bb != null) {
bb_pos = _i;
vtable_start = bb_pos - bb.getInt(bb_pos);
vtable_size = bb.getShort(vtable_start);
} else {
bb_pos = 0;
vtable_start = 0;
vtable_size = 0;
}
}
/**
* Resets the internal state with a null {@code ByteBuffer} and a zero position.
*
@ -271,10 +290,7 @@ public class Table {
* again to a {@code ByteBuffer}.
*/
public void __reset() {
bb = null;
bb_pos = 0;
vtable_start = 0;
vtable_size = 0;
__reset(0, null);
}
}

View File

@ -19,9 +19,16 @@ namespace FlatBuffers
/// <summary>
/// All structs in the generated code derive from this class, and add their own accessors.
/// </summary>
public struct Struct
internal struct Struct
{
public int bb_pos;
public ByteBuffer bb;
public int bb_pos { get; private set; }
public ByteBuffer bb { get; private set; }
// Re-init the internal state with an external buffer {@code ByteBuffer} and an offset within.
public Struct(int _i, ByteBuffer _bb)
{
bb = _bb;
bb_pos = _i;
}
}
}

View File

@ -22,13 +22,20 @@ namespace FlatBuffers
/// <summary>
/// All tables in the generated code derive from this struct, and add their own accessors.
/// </summary>
public struct Table
internal struct Table
{
public int bb_pos;
public ByteBuffer bb;
public int bb_pos { get; private set; }
public ByteBuffer bb { get; private set; }
public ByteBuffer ByteBuffer { get { return bb; } }
// Re-init the internal state with an external buffer {@code ByteBuffer} and an offset within.
public Table(int _i, ByteBuffer _bb)
{
bb = _bb;
bb_pos = _i;
}
// Look up a field in the vtable, return an offset into the object, or 0 if the field is not
// present.
public int __offset(int vtableOffset)

View File

@ -18,10 +18,10 @@
#include <list>
#define FLATC_VERSION "1.11.0"
namespace flatbuffers {
const char *FLATC_VERSION() { return FLATBUFFERS_VERSION(); }
void FlatCompiler::ParseFile(
flatbuffers::Parser &parser, const std::string &filename,
const std::string &contents,
@ -294,7 +294,7 @@ int FlatCompiler::Compile(int argc, const char **argv) {
} else if (arg == "-M") {
print_make_rules = true;
} else if (arg == "--version") {
printf("flatc version %s\n", FLATC_VERSION);
printf("flatc version %s\n", FLATC_VERSION());
exit(0);
} else if (arg == "--grpc") {
grpc_enabled = true;

View File

@ -833,7 +833,18 @@ class GeneralGenerator : public BaseGenerator {
code += struct_def.fixed ? "Struct" : "Table";
code += lang_.open_curly;
}
if (!struct_def.fixed) {
// Generate verson check method.
// Force compile time error if not using the same version runtime.
code += " public static void ValidateVersion() {";
if (lang_.language == IDLOptions::kCSharp)
code += " FlatBufferConstants.";
else
code += " Constants.";
code += "FLATBUFFERS_1_11_1(); ";
code += "}\n";
// Generate a special accessor for the table that when used as the root
// of a FlatBuffer
std::string method_name =
@ -849,11 +860,6 @@ class GeneralGenerator : public BaseGenerator {
// create method that allows object reuse
code +=
method_signature + "(ByteBuffer _bb, " + struct_def.name + " obj) { ";
// Force compile time error if not using the same version runtime.
if (lang_.language == IDLOptions::kCSharp)
code += "FlatBufferConstants.FLATBUFFERS_1_11_1(); ";
else
code += "Constants.FLATBUFFERS_1_11_1(); ";
code += lang_.set_bb_byteorder;
code += "return (obj.__assign(_bb." + FunctionStart('G') + "etInt(_bb.";
code += lang_.get_bb_position;
@ -875,14 +881,13 @@ class GeneralGenerator : public BaseGenerator {
// Generate the __init method that sets the field in a pre-existing
// accessor object. This is to allow object reuse.
code += " public void __init(int _i, ByteBuffer _bb) ";
code += "{ " + lang_.accessor_prefix + "bb_pos = _i; ";
code += lang_.accessor_prefix + "bb = _bb; ";
if (!struct_def.fixed && lang_.language == IDLOptions::kJava) {
code += lang_.accessor_prefix + "vtable_start = " + lang_.accessor_prefix + "bb_pos - ";
code += lang_.accessor_prefix + "bb." + FunctionStart('G') + "etInt(";
code += lang_.accessor_prefix + "bb_pos); " + lang_.accessor_prefix + "vtable_size = ";
code += lang_.accessor_prefix + "bb." + FunctionStart('G') + "etShort(";
code += lang_.accessor_prefix + "vtable_start); ";
code += "{ ";
if (lang_.language == IDLOptions::kCSharp) {
code += "__p = new ";
code += struct_def.fixed ? "Struct" : "Table";
code += "(_i, _bb); ";
} else {
code += "__reset(_i, _bb); ";
}
code += "}\n";
code +=

View File

@ -26,6 +26,16 @@
namespace flatbuffers {
// Reflects the version at the compiling time of binary(lib/dll/so).
const char *FLATBUFFERS_VERSION() {
// clang-format off
return
FLATBUFFERS_STRING(FLATBUFFERS_VERSION_MAJOR) "."
FLATBUFFERS_STRING(FLATBUFFERS_VERSION_MINOR) "."
FLATBUFFERS_STRING(FLATBUFFERS_VERSION_REVISION);
// clang-format on
}
const double kPi = 3.14159265358979323846;
const char *const kTypeNames[] = {
@ -1747,7 +1757,7 @@ struct EnumValBuilder {
auto ascending = false;
if (enum_def.IsUInt64()) {
uint64_t u64;
fit = StringToNumber(value.c_str(), &u64);
fit = StringToNumber(value.c_str(), &u64);
ascending = u64 > temp->GetAsUInt64();
temp->value = static_cast<int64_t>(u64); // well-defined since C++20.
} else {

View File

@ -25,8 +25,7 @@ namespace FlatBuffers.Test
public TestTable(ByteBuffer bb, int pos)
{
t.bb = bb;
t.bb_pos = pos;
t = new Table(pos, bb);
}
public bool GetSlot(int slot, bool def)

View File

@ -12,7 +12,7 @@ public struct Ability : IFlatbufferObject
{
private Struct __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
public void __init(int _i, ByteBuffer _bb) { __p = new Struct(_i, _bb); }
public Ability __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public uint Id { get { return __p.bb.GetUint(__p.bb_pos + 0); } }

View File

@ -9,7 +9,7 @@ import com.google.flatbuffers.*;
@SuppressWarnings("unused")
public final class Ability extends Struct {
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }
public Ability __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public long id() { return (long)bb.getInt(bb_pos + 0) & 0xFFFFFFFFL; }

View File

@ -13,10 +13,11 @@ public struct Monster : IFlatbufferObject
{
private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_1_11_1(); }
public static Monster GetRootAsMonster(ByteBuffer _bb) { return GetRootAsMonster(_bb, new Monster()); }
public static Monster GetRootAsMonster(ByteBuffer _bb, Monster obj) { FlatBufferConstants.FLATBUFFERS_1_11_1(); return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public static Monster GetRootAsMonster(ByteBuffer _bb, Monster obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public static bool MonsterBufferHasIdentifier(ByteBuffer _bb) { return Table.__has_identifier(_bb, "MONS"); }
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
public Monster __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public MyGame.Example.Vec3? Pos { get { int o = __p.__offset(4); return o != 0 ? (MyGame.Example.Vec3?)(new MyGame.Example.Vec3()).__assign(o + __p.bb_pos, __p.bb) : null; } }

View File

@ -12,10 +12,11 @@ import com.google.flatbuffers.*;
* an example documentation comment: monster object
*/
public final class Monster extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_1_11_1(); }
public static Monster getRootAsMonster(ByteBuffer _bb) { return getRootAsMonster(_bb, new Monster()); }
public static Monster getRootAsMonster(ByteBuffer _bb, Monster obj) { Constants.FLATBUFFERS_1_11_1(); _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public static Monster getRootAsMonster(ByteBuffer _bb, Monster obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public static boolean MonsterBufferHasIdentifier(ByteBuffer _bb) { return __has_identifier(_bb, "MONS"); }
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; vtable_start = bb_pos - bb.getInt(bb_pos); vtable_size = bb.getShort(vtable_start); }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }
public Monster __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public MyGame.Example.Vec3 pos() { return pos(new MyGame.Example.Vec3()); }

View File

@ -12,9 +12,10 @@ public struct Referrable : IFlatbufferObject
{
private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_1_11_1(); }
public static Referrable GetRootAsReferrable(ByteBuffer _bb) { return GetRootAsReferrable(_bb, new Referrable()); }
public static Referrable GetRootAsReferrable(ByteBuffer _bb, Referrable obj) { FlatBufferConstants.FLATBUFFERS_1_11_1(); return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
public static Referrable GetRootAsReferrable(ByteBuffer _bb, Referrable obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
public Referrable __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public ulong Id { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetUlong(o + __p.bb_pos) : (ulong)0; } }

View File

@ -9,9 +9,10 @@ import com.google.flatbuffers.*;
@SuppressWarnings("unused")
public final class Referrable extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_1_11_1(); }
public static Referrable getRootAsReferrable(ByteBuffer _bb) { return getRootAsReferrable(_bb, new Referrable()); }
public static Referrable getRootAsReferrable(ByteBuffer _bb, Referrable obj) { Constants.FLATBUFFERS_1_11_1(); _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; vtable_start = bb_pos - bb.getInt(bb_pos); vtable_size = bb.getShort(vtable_start); }
public static Referrable getRootAsReferrable(ByteBuffer _bb, Referrable obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }
public Referrable __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public long id() { int o = __offset(4); return o != 0 ? bb.getLong(o + bb_pos) : 0L; }

View File

@ -12,9 +12,10 @@ public struct Stat : IFlatbufferObject
{
private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_1_11_1(); }
public static Stat GetRootAsStat(ByteBuffer _bb) { return GetRootAsStat(_bb, new Stat()); }
public static Stat GetRootAsStat(ByteBuffer _bb, Stat obj) { FlatBufferConstants.FLATBUFFERS_1_11_1(); return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
public static Stat GetRootAsStat(ByteBuffer _bb, Stat obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
public Stat __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public string Id { get { int o = __p.__offset(4); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }

View File

@ -9,9 +9,10 @@ import com.google.flatbuffers.*;
@SuppressWarnings("unused")
public final class Stat extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_1_11_1(); }
public static Stat getRootAsStat(ByteBuffer _bb) { return getRootAsStat(_bb, new Stat()); }
public static Stat getRootAsStat(ByteBuffer _bb, Stat obj) { Constants.FLATBUFFERS_1_11_1(); _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; vtable_start = bb_pos - bb.getInt(bb_pos); vtable_size = bb.getShort(vtable_start); }
public static Stat getRootAsStat(ByteBuffer _bb, Stat obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }
public Stat __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public String id() { int o = __offset(4); return o != 0 ? __string(o + bb_pos) : null; }

View File

@ -12,7 +12,7 @@ public struct Test : IFlatbufferObject
{
private Struct __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
public void __init(int _i, ByteBuffer _bb) { __p = new Struct(_i, _bb); }
public Test __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public short A { get { return __p.bb.GetShort(__p.bb_pos + 0); } }

View File

@ -9,7 +9,7 @@ import com.google.flatbuffers.*;
@SuppressWarnings("unused")
public final class Test extends Struct {
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }
public Test __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public short a() { return bb.getShort(bb_pos + 0); }

View File

@ -12,9 +12,10 @@ internal partial struct TestSimpleTableWithEnum : IFlatbufferObject
{
private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_1_11_1(); }
public static TestSimpleTableWithEnum GetRootAsTestSimpleTableWithEnum(ByteBuffer _bb) { return GetRootAsTestSimpleTableWithEnum(_bb, new TestSimpleTableWithEnum()); }
public static TestSimpleTableWithEnum GetRootAsTestSimpleTableWithEnum(ByteBuffer _bb, TestSimpleTableWithEnum obj) { FlatBufferConstants.FLATBUFFERS_1_11_1(); return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
public static TestSimpleTableWithEnum GetRootAsTestSimpleTableWithEnum(ByteBuffer _bb, TestSimpleTableWithEnum obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
public TestSimpleTableWithEnum __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public MyGame.Example.Color Color { get { int o = __p.__offset(4); return o != 0 ? (MyGame.Example.Color)__p.bb.Get(o + __p.bb_pos) : MyGame.Example.Color.Green; } }

View File

@ -9,9 +9,10 @@ import com.google.flatbuffers.*;
@SuppressWarnings("unused")
final class TestSimpleTableWithEnum extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_1_11_1(); }
public static TestSimpleTableWithEnum getRootAsTestSimpleTableWithEnum(ByteBuffer _bb) { return getRootAsTestSimpleTableWithEnum(_bb, new TestSimpleTableWithEnum()); }
public static TestSimpleTableWithEnum getRootAsTestSimpleTableWithEnum(ByteBuffer _bb, TestSimpleTableWithEnum obj) { Constants.FLATBUFFERS_1_11_1(); _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; vtable_start = bb_pos - bb.getInt(bb_pos); vtable_size = bb.getShort(vtable_start); }
public static TestSimpleTableWithEnum getRootAsTestSimpleTableWithEnum(ByteBuffer _bb, TestSimpleTableWithEnum obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }
public TestSimpleTableWithEnum __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public int color() { int o = __offset(4); return o != 0 ? bb.get(o + bb_pos) & 0xFF : 2; }

View File

@ -12,9 +12,10 @@ public struct TypeAliases : IFlatbufferObject
{
private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_1_11_1(); }
public static TypeAliases GetRootAsTypeAliases(ByteBuffer _bb) { return GetRootAsTypeAliases(_bb, new TypeAliases()); }
public static TypeAliases GetRootAsTypeAliases(ByteBuffer _bb, TypeAliases obj) { FlatBufferConstants.FLATBUFFERS_1_11_1(); return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
public static TypeAliases GetRootAsTypeAliases(ByteBuffer _bb, TypeAliases obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
public TypeAliases __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public sbyte I8 { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetSbyte(o + __p.bb_pos) : (sbyte)0; } }

View File

@ -9,9 +9,10 @@ import com.google.flatbuffers.*;
@SuppressWarnings("unused")
public final class TypeAliases extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_1_11_1(); }
public static TypeAliases getRootAsTypeAliases(ByteBuffer _bb) { return getRootAsTypeAliases(_bb, new TypeAliases()); }
public static TypeAliases getRootAsTypeAliases(ByteBuffer _bb, TypeAliases obj) { Constants.FLATBUFFERS_1_11_1(); _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; vtable_start = bb_pos - bb.getInt(bb_pos); vtable_size = bb.getShort(vtable_start); }
public static TypeAliases getRootAsTypeAliases(ByteBuffer _bb, TypeAliases obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }
public TypeAliases __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public byte i8() { int o = __offset(4); return o != 0 ? bb.get(o + bb_pos) : 0; }

View File

@ -12,7 +12,7 @@ public struct Vec3 : IFlatbufferObject
{
private Struct __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
public void __init(int _i, ByteBuffer _bb) { __p = new Struct(_i, _bb); }
public Vec3 __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public float X { get { return __p.bb.GetFloat(__p.bb_pos + 0); } }

View File

@ -9,7 +9,7 @@ import com.google.flatbuffers.*;
@SuppressWarnings("unused")
public final class Vec3 extends Struct {
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }
public Vec3 __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public float x() { return bb.getFloat(bb_pos + 0); }

View File

@ -12,9 +12,10 @@ public struct Monster : IFlatbufferObject
{
private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_1_11_1(); }
public static Monster GetRootAsMonster(ByteBuffer _bb) { return GetRootAsMonster(_bb, new Monster()); }
public static Monster GetRootAsMonster(ByteBuffer _bb, Monster obj) { FlatBufferConstants.FLATBUFFERS_1_11_1(); return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
public static Monster GetRootAsMonster(ByteBuffer _bb, Monster obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
public Monster __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }

View File

@ -9,9 +9,10 @@ import com.google.flatbuffers.*;
@SuppressWarnings("unused")
public final class Monster extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_1_11_1(); }
public static Monster getRootAsMonster(ByteBuffer _bb) { return getRootAsMonster(_bb, new Monster()); }
public static Monster getRootAsMonster(ByteBuffer _bb, Monster obj) { Constants.FLATBUFFERS_1_11_1(); _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; vtable_start = bb_pos - bb.getInt(bb_pos); vtable_size = bb.getShort(vtable_start); }
public static Monster getRootAsMonster(ByteBuffer _bb, Monster obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }
public Monster __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }

View File

@ -12,9 +12,10 @@ public struct InParentNamespace : IFlatbufferObject
{
private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_1_11_1(); }
public static InParentNamespace GetRootAsInParentNamespace(ByteBuffer _bb) { return GetRootAsInParentNamespace(_bb, new InParentNamespace()); }
public static InParentNamespace GetRootAsInParentNamespace(ByteBuffer _bb, InParentNamespace obj) { FlatBufferConstants.FLATBUFFERS_1_11_1(); return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
public static InParentNamespace GetRootAsInParentNamespace(ByteBuffer _bb, InParentNamespace obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
public InParentNamespace __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }

View File

@ -9,9 +9,10 @@ import com.google.flatbuffers.*;
@SuppressWarnings("unused")
public final class InParentNamespace extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_1_11_1(); }
public static InParentNamespace getRootAsInParentNamespace(ByteBuffer _bb) { return getRootAsInParentNamespace(_bb, new InParentNamespace()); }
public static InParentNamespace getRootAsInParentNamespace(ByteBuffer _bb, InParentNamespace obj) { Constants.FLATBUFFERS_1_11_1(); _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; vtable_start = bb_pos - bb.getInt(bb_pos); vtable_size = bb.getShort(vtable_start); }
public static InParentNamespace getRootAsInParentNamespace(ByteBuffer _bb, InParentNamespace obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }
public InParentNamespace __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }

View File

@ -12,10 +12,11 @@ public struct MonsterExtra : IFlatbufferObject
{
private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_1_11_1(); }
public static MonsterExtra GetRootAsMonsterExtra(ByteBuffer _bb) { return GetRootAsMonsterExtra(_bb, new MonsterExtra()); }
public static MonsterExtra GetRootAsMonsterExtra(ByteBuffer _bb, MonsterExtra obj) { FlatBufferConstants.FLATBUFFERS_1_11_1(); return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public static MonsterExtra GetRootAsMonsterExtra(ByteBuffer _bb, MonsterExtra obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public static bool MonsterExtraBufferHasIdentifier(ByteBuffer _bb) { return Table.__has_identifier(_bb, "MONE"); }
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
public MonsterExtra __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public float TestfNan { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetFloat(o + __p.bb_pos) : (float)Single.NaN; } }

View File

@ -9,10 +9,11 @@ import com.google.flatbuffers.*;
@SuppressWarnings("unused")
public final class MonsterExtra extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_1_11_1(); }
public static MonsterExtra getRootAsMonsterExtra(ByteBuffer _bb) { return getRootAsMonsterExtra(_bb, new MonsterExtra()); }
public static MonsterExtra getRootAsMonsterExtra(ByteBuffer _bb, MonsterExtra obj) { Constants.FLATBUFFERS_1_11_1(); _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public static MonsterExtra getRootAsMonsterExtra(ByteBuffer _bb, MonsterExtra obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public static boolean MonsterExtraBufferHasIdentifier(ByteBuffer _bb) { return __has_identifier(_bb, "MONE"); }
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; vtable_start = bb_pos - bb.getInt(bb_pos); vtable_size = bb.getShort(vtable_start); }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }
public MonsterExtra __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public float testfNan() { int o = __offset(4); return o != 0 ? bb.getFloat(o + bb_pos) : Float.NaN; }

View File

@ -12,7 +12,7 @@ public struct StructInNestedNS : IFlatbufferObject
{
private Struct __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
public void __init(int _i, ByteBuffer _bb) { __p = new Struct(_i, _bb); }
public StructInNestedNS __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public int A { get { return __p.bb.GetInt(__p.bb_pos + 0); } }

View File

@ -9,7 +9,7 @@ import com.google.flatbuffers.*;
@SuppressWarnings("unused")
public final class StructInNestedNS extends Struct {
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }
public StructInNestedNS __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public int a() { return bb.getInt(bb_pos + 0); }

View File

@ -12,9 +12,10 @@ public struct TableInNestedNS : IFlatbufferObject
{
private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_1_11_1(); }
public static TableInNestedNS GetRootAsTableInNestedNS(ByteBuffer _bb) { return GetRootAsTableInNestedNS(_bb, new TableInNestedNS()); }
public static TableInNestedNS GetRootAsTableInNestedNS(ByteBuffer _bb, TableInNestedNS obj) { FlatBufferConstants.FLATBUFFERS_1_11_1(); return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
public static TableInNestedNS GetRootAsTableInNestedNS(ByteBuffer _bb, TableInNestedNS obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
public TableInNestedNS __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public int Foo { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } }

View File

@ -9,9 +9,10 @@ import com.google.flatbuffers.*;
@SuppressWarnings("unused")
public final class TableInNestedNS extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_1_11_1(); }
public static TableInNestedNS getRootAsTableInNestedNS(ByteBuffer _bb) { return getRootAsTableInNestedNS(_bb, new TableInNestedNS()); }
public static TableInNestedNS getRootAsTableInNestedNS(ByteBuffer _bb, TableInNestedNS obj) { Constants.FLATBUFFERS_1_11_1(); _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; vtable_start = bb_pos - bb.getInt(bb_pos); vtable_size = bb.getShort(vtable_start); }
public static TableInNestedNS getRootAsTableInNestedNS(ByteBuffer _bb, TableInNestedNS obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }
public TableInNestedNS __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public int foo() { int o = __offset(4); return o != 0 ? bb.getInt(o + bb_pos) : 0; }

View File

@ -12,9 +12,10 @@ public struct SecondTableInA : IFlatbufferObject
{
private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_1_11_1(); }
public static SecondTableInA GetRootAsSecondTableInA(ByteBuffer _bb) { return GetRootAsSecondTableInA(_bb, new SecondTableInA()); }
public static SecondTableInA GetRootAsSecondTableInA(ByteBuffer _bb, SecondTableInA obj) { FlatBufferConstants.FLATBUFFERS_1_11_1(); return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
public static SecondTableInA GetRootAsSecondTableInA(ByteBuffer _bb, SecondTableInA obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
public SecondTableInA __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public NamespaceC.TableInC? ReferToC { get { int o = __p.__offset(4); return o != 0 ? (NamespaceC.TableInC?)(new NamespaceC.TableInC()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }

View File

@ -9,9 +9,10 @@ import com.google.flatbuffers.*;
@SuppressWarnings("unused")
public final class SecondTableInA extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_1_11_1(); }
public static SecondTableInA getRootAsSecondTableInA(ByteBuffer _bb) { return getRootAsSecondTableInA(_bb, new SecondTableInA()); }
public static SecondTableInA getRootAsSecondTableInA(ByteBuffer _bb, SecondTableInA obj) { Constants.FLATBUFFERS_1_11_1(); _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; vtable_start = bb_pos - bb.getInt(bb_pos); vtable_size = bb.getShort(vtable_start); }
public static SecondTableInA getRootAsSecondTableInA(ByteBuffer _bb, SecondTableInA obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }
public SecondTableInA __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public NamespaceC.TableInC referToC() { return referToC(new NamespaceC.TableInC()); }

View File

@ -12,9 +12,10 @@ public struct TableInFirstNS : IFlatbufferObject
{
private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_1_11_1(); }
public static TableInFirstNS GetRootAsTableInFirstNS(ByteBuffer _bb) { return GetRootAsTableInFirstNS(_bb, new TableInFirstNS()); }
public static TableInFirstNS GetRootAsTableInFirstNS(ByteBuffer _bb, TableInFirstNS obj) { FlatBufferConstants.FLATBUFFERS_1_11_1(); return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
public static TableInFirstNS GetRootAsTableInFirstNS(ByteBuffer _bb, TableInFirstNS obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
public TableInFirstNS __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public NamespaceA.NamespaceB.TableInNestedNS? FooTable { get { int o = __p.__offset(4); return o != 0 ? (NamespaceA.NamespaceB.TableInNestedNS?)(new NamespaceA.NamespaceB.TableInNestedNS()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }

View File

@ -9,9 +9,10 @@ import com.google.flatbuffers.*;
@SuppressWarnings("unused")
public final class TableInFirstNS extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_1_11_1(); }
public static TableInFirstNS getRootAsTableInFirstNS(ByteBuffer _bb) { return getRootAsTableInFirstNS(_bb, new TableInFirstNS()); }
public static TableInFirstNS getRootAsTableInFirstNS(ByteBuffer _bb, TableInFirstNS obj) { Constants.FLATBUFFERS_1_11_1(); _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; vtable_start = bb_pos - bb.getInt(bb_pos); vtable_size = bb.getShort(vtable_start); }
public static TableInFirstNS getRootAsTableInFirstNS(ByteBuffer _bb, TableInFirstNS obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }
public TableInFirstNS __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public NamespaceA.NamespaceB.TableInNestedNS fooTable() { return fooTable(new NamespaceA.NamespaceB.TableInNestedNS()); }

View File

@ -12,9 +12,10 @@ public struct TableInC : IFlatbufferObject
{
private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_1_11_1(); }
public static TableInC GetRootAsTableInC(ByteBuffer _bb) { return GetRootAsTableInC(_bb, new TableInC()); }
public static TableInC GetRootAsTableInC(ByteBuffer _bb, TableInC obj) { FlatBufferConstants.FLATBUFFERS_1_11_1(); return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
public static TableInC GetRootAsTableInC(ByteBuffer _bb, TableInC obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
public TableInC __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public NamespaceA.TableInFirstNS? ReferToA1 { get { int o = __p.__offset(4); return o != 0 ? (NamespaceA.TableInFirstNS?)(new NamespaceA.TableInFirstNS()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }

View File

@ -9,9 +9,10 @@ import com.google.flatbuffers.*;
@SuppressWarnings("unused")
public final class TableInC extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_1_11_1(); }
public static TableInC getRootAsTableInC(ByteBuffer _bb) { return getRootAsTableInC(_bb, new TableInC()); }
public static TableInC getRootAsTableInC(ByteBuffer _bb, TableInC obj) { Constants.FLATBUFFERS_1_11_1(); _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; vtable_start = bb_pos - bb.getInt(bb_pos); vtable_size = bb.getShort(vtable_start); }
public static TableInC getRootAsTableInC(ByteBuffer _bb, TableInC obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }
public TableInC __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public NamespaceA.TableInFirstNS referToA1() { return referToA1(new NamespaceA.TableInFirstNS()); }

View File

@ -9,9 +9,10 @@ public struct Attacker : IFlatbufferObject
{
private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_1_11_1(); }
public static Attacker GetRootAsAttacker(ByteBuffer _bb) { return GetRootAsAttacker(_bb, new Attacker()); }
public static Attacker GetRootAsAttacker(ByteBuffer _bb, Attacker obj) { FlatBufferConstants.FLATBUFFERS_1_11_1(); return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
public static Attacker GetRootAsAttacker(ByteBuffer _bb, Attacker obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
public Attacker __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public int SwordAttackDamage { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } }

View File

@ -7,9 +7,10 @@ import com.google.flatbuffers.*;
@SuppressWarnings("unused")
public final class Attacker extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_1_11_1(); }
public static Attacker getRootAsAttacker(ByteBuffer _bb) { return getRootAsAttacker(_bb, new Attacker()); }
public static Attacker getRootAsAttacker(ByteBuffer _bb, Attacker obj) { Constants.FLATBUFFERS_1_11_1(); _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; vtable_start = bb_pos - bb.getInt(bb_pos); vtable_size = bb.getShort(vtable_start); }
public static Attacker getRootAsAttacker(ByteBuffer _bb, Attacker obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }
public Attacker __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public int swordAttackDamage() { int o = __offset(4); return o != 0 ? bb.getInt(o + bb_pos) : 0; }

View File

@ -9,7 +9,7 @@ public struct BookReader : IFlatbufferObject
{
private Struct __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
public void __init(int _i, ByteBuffer _bb) { __p = new Struct(_i, _bb); }
public BookReader __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public int BooksRead { get { return __p.bb.GetInt(__p.bb_pos + 0); } }

View File

@ -7,7 +7,7 @@ import com.google.flatbuffers.*;
@SuppressWarnings("unused")
public final class BookReader extends Struct {
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }
public BookReader __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public int booksRead() { return bb.getInt(bb_pos + 0); }

View File

@ -9,10 +9,11 @@ public struct Movie : IFlatbufferObject
{
private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_1_11_1(); }
public static Movie GetRootAsMovie(ByteBuffer _bb) { return GetRootAsMovie(_bb, new Movie()); }
public static Movie GetRootAsMovie(ByteBuffer _bb, Movie obj) { FlatBufferConstants.FLATBUFFERS_1_11_1(); return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public static Movie GetRootAsMovie(ByteBuffer _bb, Movie obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public static bool MovieBufferHasIdentifier(ByteBuffer _bb) { return Table.__has_identifier(_bb, "MOVI"); }
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
public Movie __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public Character MainCharacterType { get { int o = __p.__offset(4); return o != 0 ? (Character)__p.bb.Get(o + __p.bb_pos) : Character.NONE; } }

View File

@ -7,10 +7,11 @@ import com.google.flatbuffers.*;
@SuppressWarnings("unused")
public final class Movie extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_1_11_1(); }
public static Movie getRootAsMovie(ByteBuffer _bb) { return getRootAsMovie(_bb, new Movie()); }
public static Movie getRootAsMovie(ByteBuffer _bb, Movie obj) { Constants.FLATBUFFERS_1_11_1(); _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public static Movie getRootAsMovie(ByteBuffer _bb, Movie obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public static boolean MovieBufferHasIdentifier(ByteBuffer _bb) { return __has_identifier(_bb, "MOVI"); }
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; vtable_start = bb_pos - bb.getInt(bb_pos); vtable_size = bb.getShort(vtable_start); }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }
public Movie __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public byte mainCharacterType() { int o = __offset(4); return o != 0 ? bb.get(o + bb_pos) : 0; }

View File

@ -9,7 +9,7 @@ public struct Rapunzel : IFlatbufferObject
{
private Struct __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
public void __init(int _i, ByteBuffer _bb) { __p = new Struct(_i, _bb); }
public Rapunzel __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public int HairLength { get { return __p.bb.GetInt(__p.bb_pos + 0); } }

View File

@ -7,7 +7,7 @@ import com.google.flatbuffers.*;
@SuppressWarnings("unused")
public final class Rapunzel extends Struct {
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }
public Rapunzel __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public int hairLength() { return bb.getInt(bb_pos + 0); }