mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-14 16:36:55 +00:00
bulk code format fix (#8707)
This commit is contained in:
@@ -4,13 +4,17 @@ package NamespaceA.NamespaceB;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public final class EnumInNestedNS {
|
||||
private EnumInNestedNS() { }
|
||||
private EnumInNestedNS() {}
|
||||
|
||||
public static final byte A = 0;
|
||||
public static final byte B = 1;
|
||||
public static final byte C = 2;
|
||||
|
||||
public static final String[] names = { "A", "B", "C", };
|
||||
public static final String[] names = {
|
||||
"A", "B", "C",
|
||||
};
|
||||
|
||||
public static String name(int e) { return names[e]; }
|
||||
public static String name(int e) {
|
||||
return names[e];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,11 +5,12 @@ package NamespaceA.NamespaceB
|
||||
@Suppress("unused")
|
||||
@ExperimentalUnsignedTypes
|
||||
class EnumInNestedNS private constructor() {
|
||||
companion object {
|
||||
const val A: Byte = 0
|
||||
const val B: Byte = 1
|
||||
const val C: Byte = 2
|
||||
val names : Array<String> = arrayOf("A", "B", "C")
|
||||
fun name(e: Int) : String = names[e]
|
||||
}
|
||||
companion object {
|
||||
const val A: Byte = 0
|
||||
const val B: Byte = 1
|
||||
const val C: Byte = 2
|
||||
val names: Array<String> = arrayOf("A", "B", "C")
|
||||
|
||||
fun name(e: Int): String = names[e]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
# namespace: NamespaceB
|
||||
|
||||
|
||||
class EnumInNestedNS(object):
|
||||
A = 0
|
||||
B = 1
|
||||
C = 2
|
||||
A = 0
|
||||
B = 1
|
||||
C = 2
|
||||
|
||||
@@ -12,7 +12,9 @@ type StructInNestedNST struct {
|
||||
}
|
||||
|
||||
func (t *StructInNestedNST) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
|
||||
if t == nil { return 0 }
|
||||
if t == nil {
|
||||
return 0
|
||||
}
|
||||
return CreateStructInNestedNS(builder, t.A, t.B)
|
||||
}
|
||||
func (rcv *StructInNestedNS) UnPackTo(t *StructInNestedNST) {
|
||||
@@ -21,7 +23,9 @@ func (rcv *StructInNestedNS) UnPackTo(t *StructInNestedNST) {
|
||||
}
|
||||
|
||||
func (rcv *StructInNestedNS) UnPack() *StructInNestedNST {
|
||||
if rcv == nil { return nil }
|
||||
if rcv == nil {
|
||||
return nil
|
||||
}
|
||||
t := &StructInNestedNST{}
|
||||
rcv.UnPackTo(t)
|
||||
return t
|
||||
|
||||
@@ -2,20 +2,36 @@
|
||||
|
||||
package NamespaceA.NamespaceB;
|
||||
|
||||
import java.nio.*;
|
||||
import java.lang.*;
|
||||
import java.util.*;
|
||||
import com.google.flatbuffers.*;
|
||||
import java.nio.*;
|
||||
import java.util.*;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public final class StructInNestedNS extends Struct {
|
||||
public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }
|
||||
public StructInNestedNS __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
public void __init(int _i, ByteBuffer _bb) {
|
||||
__reset(_i, _bb);
|
||||
}
|
||||
|
||||
public int a() { return bb.getInt(bb_pos + 0); }
|
||||
public void mutateA(int a) { bb.putInt(bb_pos + 0, a); }
|
||||
public int b() { return bb.getInt(bb_pos + 4); }
|
||||
public void mutateB(int b) { bb.putInt(bb_pos + 4, b); }
|
||||
public StructInNestedNS __assign(int _i, ByteBuffer _bb) {
|
||||
__init(_i, _bb);
|
||||
return this;
|
||||
}
|
||||
|
||||
public int a() {
|
||||
return bb.getInt(bb_pos + 0);
|
||||
}
|
||||
|
||||
public void mutateA(int a) {
|
||||
bb.putInt(bb_pos + 0, a);
|
||||
}
|
||||
|
||||
public int b() {
|
||||
return bb.getInt(bb_pos + 4);
|
||||
}
|
||||
|
||||
public void mutateB(int b) {
|
||||
bb.putInt(bb_pos + 4, b);
|
||||
}
|
||||
|
||||
public static int createStructInNestedNS(FlatBufferBuilder builder, int a, int b) {
|
||||
builder.prep(4, 8);
|
||||
@@ -25,28 +41,35 @@ public final class StructInNestedNS extends Struct {
|
||||
}
|
||||
|
||||
public static final class Vector extends BaseVector {
|
||||
public Vector __assign(int _vector, int _element_size, ByteBuffer _bb) { __reset(_vector, _element_size, _bb); return this; }
|
||||
public Vector __assign(int _vector, int _element_size, ByteBuffer _bb) {
|
||||
__reset(_vector, _element_size, _bb);
|
||||
return this;
|
||||
}
|
||||
|
||||
public StructInNestedNS get(int j) { return get(new StructInNestedNS(), j); }
|
||||
public StructInNestedNS get(StructInNestedNS obj, int j) { return obj.__assign(__element(j), bb); }
|
||||
public StructInNestedNS get(int j) {
|
||||
return get(new StructInNestedNS(), j);
|
||||
}
|
||||
|
||||
public StructInNestedNS get(StructInNestedNS obj, int j) {
|
||||
return obj.__assign(__element(j), bb);
|
||||
}
|
||||
}
|
||||
|
||||
public StructInNestedNST unpack() {
|
||||
StructInNestedNST _o = new StructInNestedNST();
|
||||
unpackTo(_o);
|
||||
return _o;
|
||||
}
|
||||
|
||||
public void unpackTo(StructInNestedNST _o) {
|
||||
int _oA = a();
|
||||
_o.setA(_oA);
|
||||
int _oB = b();
|
||||
_o.setB(_oB);
|
||||
}
|
||||
|
||||
public static int pack(FlatBufferBuilder builder, StructInNestedNST _o) {
|
||||
if (_o == null) return 0;
|
||||
return createStructInNestedNS(
|
||||
builder,
|
||||
_o.getA(),
|
||||
_o.getB());
|
||||
return createStructInNestedNS(builder, _o.getA(), _o.getB());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,43 +2,39 @@
|
||||
|
||||
package NamespaceA.NamespaceB
|
||||
|
||||
import com.google.flatbuffers.BaseVector
|
||||
import com.google.flatbuffers.BooleanVector
|
||||
import com.google.flatbuffers.ByteVector
|
||||
import com.google.flatbuffers.Constants
|
||||
import com.google.flatbuffers.DoubleVector
|
||||
import com.google.flatbuffers.FlatBufferBuilder
|
||||
import com.google.flatbuffers.FloatVector
|
||||
import com.google.flatbuffers.LongVector
|
||||
import com.google.flatbuffers.StringVector
|
||||
import com.google.flatbuffers.Struct
|
||||
import com.google.flatbuffers.Table
|
||||
import com.google.flatbuffers.UnionVector
|
||||
import java.nio.ByteBuffer
|
||||
import java.nio.ByteOrder
|
||||
import kotlin.math.sign
|
||||
|
||||
@Suppress("unused")
|
||||
@ExperimentalUnsignedTypes
|
||||
class StructInNestedNS : Struct() {
|
||||
|
||||
fun __init(_i: Int, _bb: ByteBuffer) {
|
||||
__reset(_i, _bb)
|
||||
}
|
||||
fun __assign(_i: Int, _bb: ByteBuffer) : StructInNestedNS {
|
||||
__init(_i, _bb)
|
||||
return this
|
||||
}
|
||||
val a : Int get() = bb.getInt(bb_pos + 0)
|
||||
fun mutateA(a: Int) : ByteBuffer = bb.putInt(bb_pos + 0, a)
|
||||
val b : Int get() = bb.getInt(bb_pos + 4)
|
||||
fun mutateB(b: Int) : ByteBuffer = bb.putInt(bb_pos + 4, b)
|
||||
companion object {
|
||||
fun createStructInNestedNS(builder: FlatBufferBuilder, a: Int, b: Int) : Int {
|
||||
builder.prep(4, 8)
|
||||
builder.putInt(b)
|
||||
builder.putInt(a)
|
||||
return builder.offset()
|
||||
}
|
||||
fun __init(_i: Int, _bb: ByteBuffer) {
|
||||
__reset(_i, _bb)
|
||||
}
|
||||
|
||||
fun __assign(_i: Int, _bb: ByteBuffer): StructInNestedNS {
|
||||
__init(_i, _bb)
|
||||
return this
|
||||
}
|
||||
|
||||
val a: Int
|
||||
get() = bb.getInt(bb_pos + 0)
|
||||
|
||||
fun mutateA(a: Int): ByteBuffer = bb.putInt(bb_pos + 0, a)
|
||||
|
||||
val b: Int
|
||||
get() = bb.getInt(bb_pos + 4)
|
||||
|
||||
fun mutateB(b: Int): ByteBuffer = bb.putInt(bb_pos + 4, b)
|
||||
|
||||
companion object {
|
||||
fun createStructInNestedNS(builder: FlatBufferBuilder, a: Int, b: Int): Int {
|
||||
builder.prep(4, 8)
|
||||
builder.putInt(b)
|
||||
builder.putInt(a)
|
||||
return builder.offset()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,57 +4,69 @@
|
||||
|
||||
import flatbuffers
|
||||
from flatbuffers.compat import import_numpy
|
||||
|
||||
np = import_numpy()
|
||||
|
||||
|
||||
class StructInNestedNS(object):
|
||||
__slots__ = ['_tab']
|
||||
__slots__ = ['_tab']
|
||||
|
||||
@classmethod
|
||||
def SizeOf(cls):
|
||||
return 8
|
||||
@classmethod
|
||||
def SizeOf(cls):
|
||||
return 8
|
||||
|
||||
# StructInNestedNS
|
||||
def Init(self, buf, pos):
|
||||
self._tab = flatbuffers.table.Table(buf, pos)
|
||||
# StructInNestedNS
|
||||
def Init(self, buf, pos):
|
||||
self._tab = flatbuffers.table.Table(buf, pos)
|
||||
|
||||
# StructInNestedNS
|
||||
def A(self):
|
||||
return self._tab.Get(
|
||||
flatbuffers.number_types.Int32Flags,
|
||||
self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(0),
|
||||
)
|
||||
|
||||
# StructInNestedNS
|
||||
def B(self):
|
||||
return self._tab.Get(
|
||||
flatbuffers.number_types.Int32Flags,
|
||||
self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(4),
|
||||
)
|
||||
|
||||
# StructInNestedNS
|
||||
def A(self): return self._tab.Get(flatbuffers.number_types.Int32Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(0))
|
||||
# StructInNestedNS
|
||||
def B(self): return self._tab.Get(flatbuffers.number_types.Int32Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(4))
|
||||
|
||||
def CreateStructInNestedNS(builder, a, b):
|
||||
builder.Prep(4, 8)
|
||||
builder.PrependInt32(b)
|
||||
builder.PrependInt32(a)
|
||||
return builder.Offset()
|
||||
builder.Prep(4, 8)
|
||||
builder.PrependInt32(b)
|
||||
builder.PrependInt32(a)
|
||||
return builder.Offset()
|
||||
|
||||
|
||||
class StructInNestedNST(object):
|
||||
|
||||
# StructInNestedNST
|
||||
def __init__(self):
|
||||
self.a = 0 # type: int
|
||||
self.b = 0 # type: int
|
||||
# StructInNestedNST
|
||||
def __init__(self):
|
||||
self.a = 0 # type: int
|
||||
self.b = 0 # type: int
|
||||
|
||||
@classmethod
|
||||
def InitFromBuf(cls, buf, pos):
|
||||
structInNestedNS = StructInNestedNS()
|
||||
structInNestedNS.Init(buf, pos)
|
||||
return cls.InitFromObj(structInNestedNS)
|
||||
@classmethod
|
||||
def InitFromBuf(cls, buf, pos):
|
||||
structInNestedNS = StructInNestedNS()
|
||||
structInNestedNS.Init(buf, pos)
|
||||
return cls.InitFromObj(structInNestedNS)
|
||||
|
||||
@classmethod
|
||||
def InitFromObj(cls, structInNestedNS):
|
||||
x = StructInNestedNST()
|
||||
x._UnPack(structInNestedNS)
|
||||
return x
|
||||
@classmethod
|
||||
def InitFromObj(cls, structInNestedNS):
|
||||
x = StructInNestedNST()
|
||||
x._UnPack(structInNestedNS)
|
||||
return x
|
||||
|
||||
# StructInNestedNST
|
||||
def _UnPack(self, structInNestedNS):
|
||||
if structInNestedNS is None:
|
||||
return
|
||||
self.a = structInNestedNS.A()
|
||||
self.b = structInNestedNS.B()
|
||||
# StructInNestedNST
|
||||
def _UnPack(self, structInNestedNS):
|
||||
if structInNestedNS is None:
|
||||
return
|
||||
self.a = structInNestedNS.A()
|
||||
self.b = structInNestedNS.B()
|
||||
|
||||
# StructInNestedNST
|
||||
def Pack(self, builder):
|
||||
return CreateStructInNestedNS(builder, self.a, self.b)
|
||||
# StructInNestedNST
|
||||
def Pack(self, builder):
|
||||
return CreateStructInNestedNS(builder, self.a, self.b)
|
||||
|
||||
@@ -2,27 +2,32 @@
|
||||
|
||||
package NamespaceA.NamespaceB;
|
||||
|
||||
import java.nio.*;
|
||||
import java.lang.*;
|
||||
import java.util.*;
|
||||
import com.google.flatbuffers.*;
|
||||
import java.nio.*;
|
||||
import java.util.*;
|
||||
|
||||
public class StructInNestedNST {
|
||||
private int a;
|
||||
private int b;
|
||||
|
||||
public int getA() { return a; }
|
||||
public int getA() {
|
||||
return a;
|
||||
}
|
||||
|
||||
public void setA(int a) { this.a = a; }
|
||||
public void setA(int a) {
|
||||
this.a = a;
|
||||
}
|
||||
|
||||
public int getB() { return b; }
|
||||
|
||||
public void setB(int b) { this.b = b; }
|
||||
public int getB() {
|
||||
return b;
|
||||
}
|
||||
|
||||
public void setB(int b) {
|
||||
this.b = b;
|
||||
}
|
||||
|
||||
public StructInNestedNST() {
|
||||
this.a = 0;
|
||||
this.b = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,9 @@ type TableInNestedNST struct {
|
||||
}
|
||||
|
||||
func (t *TableInNestedNST) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
|
||||
if t == nil { return 0 }
|
||||
if t == nil {
|
||||
return 0
|
||||
}
|
||||
TableInNestedNSStart(builder)
|
||||
TableInNestedNSAddFoo(builder, t.Foo)
|
||||
return TableInNestedNSEnd(builder)
|
||||
@@ -22,7 +24,9 @@ func (rcv *TableInNestedNS) UnPackTo(t *TableInNestedNST) {
|
||||
}
|
||||
|
||||
func (rcv *TableInNestedNS) UnPack() *TableInNestedNST {
|
||||
if rcv == nil { return nil }
|
||||
if rcv == nil {
|
||||
return nil
|
||||
}
|
||||
t := &TableInNestedNST{}
|
||||
rcv.UnPackTo(t)
|
||||
return t
|
||||
|
||||
@@ -2,56 +2,96 @@
|
||||
|
||||
package NamespaceA.NamespaceB;
|
||||
|
||||
import java.nio.*;
|
||||
import java.lang.*;
|
||||
import java.util.*;
|
||||
import com.google.flatbuffers.*;
|
||||
import java.nio.*;
|
||||
import java.util.*;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public final class TableInNestedNS extends Table {
|
||||
public static void ValidateVersion() { Constants.FLATBUFFERS_25_2_10(); }
|
||||
public static TableInNestedNS getRootAsTableInNestedNS(ByteBuffer _bb) { return getRootAsTableInNestedNS(_bb, new TableInNestedNS()); }
|
||||
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 static void ValidateVersion() {
|
||||
Constants.FLATBUFFERS_25_2_10();
|
||||
}
|
||||
|
||||
public int foo() { int o = __offset(4); return o != 0 ? bb.getInt(o + bb_pos) : 0; }
|
||||
public boolean mutateFoo(int foo) { int o = __offset(4); if (o != 0) { bb.putInt(o + bb_pos, foo); return true; } else { return false; } }
|
||||
public static TableInNestedNS getRootAsTableInNestedNS(ByteBuffer _bb) {
|
||||
return getRootAsTableInNestedNS(_bb, new TableInNestedNS());
|
||||
}
|
||||
|
||||
public static int createTableInNestedNS(FlatBufferBuilder builder,
|
||||
int foo) {
|
||||
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;
|
||||
}
|
||||
|
||||
public boolean mutateFoo(int foo) {
|
||||
int o = __offset(4);
|
||||
if (o != 0) {
|
||||
bb.putInt(o + bb_pos, foo);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static int createTableInNestedNS(FlatBufferBuilder builder, int foo) {
|
||||
builder.startTable(1);
|
||||
TableInNestedNS.addFoo(builder, foo);
|
||||
return TableInNestedNS.endTableInNestedNS(builder);
|
||||
}
|
||||
|
||||
public static void startTableInNestedNS(FlatBufferBuilder builder) { builder.startTable(1); }
|
||||
public static void addFoo(FlatBufferBuilder builder, int foo) { builder.addInt(0, foo, 0); }
|
||||
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.endTable();
|
||||
return o;
|
||||
}
|
||||
|
||||
public static final class Vector extends BaseVector {
|
||||
public Vector __assign(int _vector, int _element_size, ByteBuffer _bb) { __reset(_vector, _element_size, _bb); return this; }
|
||||
public Vector __assign(int _vector, int _element_size, ByteBuffer _bb) {
|
||||
__reset(_vector, _element_size, _bb);
|
||||
return this;
|
||||
}
|
||||
|
||||
public TableInNestedNS get(int j) { return get(new TableInNestedNS(), j); }
|
||||
public TableInNestedNS get(TableInNestedNS obj, int j) { return obj.__assign(__indirect(__element(j), bb), bb); }
|
||||
public TableInNestedNS get(int j) {
|
||||
return get(new TableInNestedNS(), j);
|
||||
}
|
||||
|
||||
public TableInNestedNS get(TableInNestedNS obj, int j) {
|
||||
return obj.__assign(__indirect(__element(j), bb), bb);
|
||||
}
|
||||
}
|
||||
|
||||
public TableInNestedNST unpack() {
|
||||
TableInNestedNST _o = new TableInNestedNST();
|
||||
unpackTo(_o);
|
||||
return _o;
|
||||
}
|
||||
|
||||
public void unpackTo(TableInNestedNST _o) {
|
||||
int _oFoo = foo();
|
||||
_o.setFoo(_oFoo);
|
||||
}
|
||||
|
||||
public static int pack(FlatBufferBuilder builder, TableInNestedNST _o) {
|
||||
if (_o == null) return 0;
|
||||
return createTableInNestedNS(
|
||||
builder,
|
||||
_o.getFoo());
|
||||
return createTableInNestedNS(builder, _o.getFoo());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,64 +2,65 @@
|
||||
|
||||
package NamespaceA.NamespaceB
|
||||
|
||||
import com.google.flatbuffers.BaseVector
|
||||
import com.google.flatbuffers.BooleanVector
|
||||
import com.google.flatbuffers.ByteVector
|
||||
import com.google.flatbuffers.Constants
|
||||
import com.google.flatbuffers.DoubleVector
|
||||
import com.google.flatbuffers.FlatBufferBuilder
|
||||
import com.google.flatbuffers.FloatVector
|
||||
import com.google.flatbuffers.LongVector
|
||||
import com.google.flatbuffers.StringVector
|
||||
import com.google.flatbuffers.Struct
|
||||
import com.google.flatbuffers.Table
|
||||
import com.google.flatbuffers.UnionVector
|
||||
import java.nio.ByteBuffer
|
||||
import java.nio.ByteOrder
|
||||
import kotlin.math.sign
|
||||
|
||||
@Suppress("unused")
|
||||
@ExperimentalUnsignedTypes
|
||||
class TableInNestedNS : Table() {
|
||||
|
||||
fun __init(_i: Int, _bb: ByteBuffer) {
|
||||
__reset(_i, _bb)
|
||||
fun __init(_i: Int, _bb: ByteBuffer) {
|
||||
__reset(_i, _bb)
|
||||
}
|
||||
|
||||
fun __assign(_i: Int, _bb: ByteBuffer): TableInNestedNS {
|
||||
__init(_i, _bb)
|
||||
return this
|
||||
}
|
||||
|
||||
val foo: Int
|
||||
get() {
|
||||
val o = __offset(4)
|
||||
return if (o != 0) bb.getInt(o + bb_pos) else 0
|
||||
}
|
||||
fun __assign(_i: Int, _bb: ByteBuffer) : TableInNestedNS {
|
||||
__init(_i, _bb)
|
||||
return this
|
||||
|
||||
fun mutateFoo(foo: Int): Boolean {
|
||||
val o = __offset(4)
|
||||
return if (o != 0) {
|
||||
bb.putInt(o + bb_pos, foo)
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
val foo : Int
|
||||
get() {
|
||||
val o = __offset(4)
|
||||
return if(o != 0) bb.getInt(o + bb_pos) else 0
|
||||
}
|
||||
fun mutateFoo(foo: Int) : Boolean {
|
||||
val o = __offset(4)
|
||||
return if (o != 0) {
|
||||
bb.putInt(o + bb_pos, foo)
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun validateVersion() = Constants.FLATBUFFERS_25_2_10()
|
||||
|
||||
fun getRootAsTableInNestedNS(_bb: ByteBuffer): TableInNestedNS =
|
||||
getRootAsTableInNestedNS(_bb, TableInNestedNS())
|
||||
|
||||
fun getRootAsTableInNestedNS(_bb: ByteBuffer, obj: TableInNestedNS): TableInNestedNS {
|
||||
_bb.order(ByteOrder.LITTLE_ENDIAN)
|
||||
return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb))
|
||||
}
|
||||
companion object {
|
||||
fun validateVersion() = Constants.FLATBUFFERS_25_2_10()
|
||||
fun getRootAsTableInNestedNS(_bb: ByteBuffer): TableInNestedNS = getRootAsTableInNestedNS(_bb, TableInNestedNS())
|
||||
fun getRootAsTableInNestedNS(_bb: ByteBuffer, obj: TableInNestedNS): TableInNestedNS {
|
||||
_bb.order(ByteOrder.LITTLE_ENDIAN)
|
||||
return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb))
|
||||
}
|
||||
fun createTableInNestedNS(builder: FlatBufferBuilder, foo: Int) : Int {
|
||||
builder.startTable(1)
|
||||
addFoo(builder, foo)
|
||||
return endTableInNestedNS(builder)
|
||||
}
|
||||
fun startTableInNestedNS(builder: FlatBufferBuilder) = builder.startTable(1)
|
||||
fun addFoo(builder: FlatBufferBuilder, foo: Int) = builder.addInt(0, foo, 0)
|
||||
fun endTableInNestedNS(builder: FlatBufferBuilder) : Int {
|
||||
val o = builder.endTable()
|
||||
return o
|
||||
}
|
||||
|
||||
fun createTableInNestedNS(builder: FlatBufferBuilder, foo: Int): Int {
|
||||
builder.startTable(1)
|
||||
addFoo(builder, foo)
|
||||
return endTableInNestedNS(builder)
|
||||
}
|
||||
|
||||
fun startTableInNestedNS(builder: FlatBufferBuilder) = builder.startTable(1)
|
||||
|
||||
fun addFoo(builder: FlatBufferBuilder, foo: Int) = builder.addInt(0, foo, 0)
|
||||
|
||||
fun endTableInNestedNS(builder: FlatBufferBuilder): Int {
|
||||
val o = builder.endTable()
|
||||
return o
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,70 +4,90 @@
|
||||
|
||||
import flatbuffers
|
||||
from flatbuffers.compat import import_numpy
|
||||
|
||||
np = import_numpy()
|
||||
|
||||
|
||||
class TableInNestedNS(object):
|
||||
__slots__ = ['_tab']
|
||||
__slots__ = ['_tab']
|
||||
|
||||
@classmethod
|
||||
def GetRootAs(cls, buf, offset=0):
|
||||
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
||||
x = TableInNestedNS()
|
||||
x.Init(buf, n + offset)
|
||||
return x
|
||||
@classmethod
|
||||
def GetRootAs(cls, buf, offset=0):
|
||||
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
||||
x = TableInNestedNS()
|
||||
x.Init(buf, n + offset)
|
||||
return x
|
||||
|
||||
@classmethod
|
||||
def GetRootAsTableInNestedNS(cls, buf, offset=0):
|
||||
"""This method is deprecated. Please switch to GetRootAs."""
|
||||
return cls.GetRootAs(buf, offset)
|
||||
# TableInNestedNS
|
||||
def Init(self, buf, pos):
|
||||
self._tab = flatbuffers.table.Table(buf, pos)
|
||||
@classmethod
|
||||
def GetRootAsTableInNestedNS(cls, buf, offset=0):
|
||||
"""This method is deprecated. Please switch to GetRootAs."""
|
||||
return cls.GetRootAs(buf, offset)
|
||||
|
||||
# TableInNestedNS
|
||||
def Init(self, buf, pos):
|
||||
self._tab = flatbuffers.table.Table(buf, pos)
|
||||
|
||||
# TableInNestedNS
|
||||
def Foo(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
||||
if o != 0:
|
||||
return self._tab.Get(
|
||||
flatbuffers.number_types.Int32Flags, o + self._tab.Pos
|
||||
)
|
||||
return 0
|
||||
|
||||
|
||||
def TableInNestedNSStart(builder):
|
||||
builder.StartObject(1)
|
||||
|
||||
# TableInNestedNS
|
||||
def Foo(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
|
||||
def TableInNestedNSStart(builder): builder.StartObject(1)
|
||||
def Start(builder):
|
||||
return TableInNestedNSStart(builder)
|
||||
def TableInNestedNSAddFoo(builder, foo): builder.PrependInt32Slot(0, foo, 0)
|
||||
return TableInNestedNSStart(builder)
|
||||
|
||||
|
||||
def TableInNestedNSAddFoo(builder, foo):
|
||||
builder.PrependInt32Slot(0, foo, 0)
|
||||
|
||||
|
||||
def AddFoo(builder, foo):
|
||||
return TableInNestedNSAddFoo(builder, foo)
|
||||
def TableInNestedNSEnd(builder): return builder.EndObject()
|
||||
return TableInNestedNSAddFoo(builder, foo)
|
||||
|
||||
|
||||
def TableInNestedNSEnd(builder):
|
||||
return builder.EndObject()
|
||||
|
||||
|
||||
def End(builder):
|
||||
return TableInNestedNSEnd(builder)
|
||||
return TableInNestedNSEnd(builder)
|
||||
|
||||
|
||||
class TableInNestedNST(object):
|
||||
|
||||
# TableInNestedNST
|
||||
def __init__(self):
|
||||
self.foo = 0 # type: int
|
||||
# TableInNestedNST
|
||||
def __init__(self):
|
||||
self.foo = 0 # type: int
|
||||
|
||||
@classmethod
|
||||
def InitFromBuf(cls, buf, pos):
|
||||
tableInNestedNS = TableInNestedNS()
|
||||
tableInNestedNS.Init(buf, pos)
|
||||
return cls.InitFromObj(tableInNestedNS)
|
||||
@classmethod
|
||||
def InitFromBuf(cls, buf, pos):
|
||||
tableInNestedNS = TableInNestedNS()
|
||||
tableInNestedNS.Init(buf, pos)
|
||||
return cls.InitFromObj(tableInNestedNS)
|
||||
|
||||
@classmethod
|
||||
def InitFromObj(cls, tableInNestedNS):
|
||||
x = TableInNestedNST()
|
||||
x._UnPack(tableInNestedNS)
|
||||
return x
|
||||
@classmethod
|
||||
def InitFromObj(cls, tableInNestedNS):
|
||||
x = TableInNestedNST()
|
||||
x._UnPack(tableInNestedNS)
|
||||
return x
|
||||
|
||||
# TableInNestedNST
|
||||
def _UnPack(self, tableInNestedNS):
|
||||
if tableInNestedNS is None:
|
||||
return
|
||||
self.foo = tableInNestedNS.Foo()
|
||||
# TableInNestedNST
|
||||
def _UnPack(self, tableInNestedNS):
|
||||
if tableInNestedNS is None:
|
||||
return
|
||||
self.foo = tableInNestedNS.Foo()
|
||||
|
||||
# TableInNestedNST
|
||||
def Pack(self, builder):
|
||||
TableInNestedNSStart(builder)
|
||||
TableInNestedNSAddFoo(builder, self.foo)
|
||||
tableInNestedNS = TableInNestedNSEnd(builder)
|
||||
return tableInNestedNS
|
||||
# TableInNestedNST
|
||||
def Pack(self, builder):
|
||||
TableInNestedNSStart(builder)
|
||||
TableInNestedNSAddFoo(builder, self.foo)
|
||||
tableInNestedNS = TableInNestedNSEnd(builder)
|
||||
return tableInNestedNS
|
||||
|
||||
@@ -2,21 +2,22 @@
|
||||
|
||||
package NamespaceA.NamespaceB;
|
||||
|
||||
import java.nio.*;
|
||||
import java.lang.*;
|
||||
import java.util.*;
|
||||
import com.google.flatbuffers.*;
|
||||
import java.nio.*;
|
||||
import java.util.*;
|
||||
|
||||
public class TableInNestedNST {
|
||||
private int foo;
|
||||
|
||||
public int getFoo() { return foo; }
|
||||
|
||||
public void setFoo(int foo) { this.foo = foo; }
|
||||
public int getFoo() {
|
||||
return foo;
|
||||
}
|
||||
|
||||
public void setFoo(int foo) {
|
||||
this.foo = foo;
|
||||
}
|
||||
|
||||
public TableInNestedNST() {
|
||||
this.foo = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
)
|
||||
|
||||
type UnionInNestedNST struct {
|
||||
Type UnionInNestedNS
|
||||
Type UnionInNestedNS
|
||||
Value interface{}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ func (rcv UnionInNestedNS) UnPack(table flatbuffers.Table) *UnionInNestedNST {
|
||||
switch rcv {
|
||||
case UnionInNestedNSTableInNestedNS:
|
||||
x := TableInNestedNS{_tab: table}
|
||||
return &NamespaceA__NamespaceB.UnionInNestedNST{ Type: UnionInNestedNSTableInNestedNS, Value: x.UnPack() }
|
||||
return &NamespaceA__NamespaceB.UnionInNestedNST{Type: UnionInNestedNSTableInNestedNS, Value: x.UnPack()}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -4,12 +4,16 @@ package NamespaceA.NamespaceB;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public final class UnionInNestedNS {
|
||||
private UnionInNestedNS() { }
|
||||
private UnionInNestedNS() {}
|
||||
|
||||
public static final byte NONE = 0;
|
||||
public static final byte TableInNestedNS = 1;
|
||||
|
||||
public static final String[] names = { "NONE", "TableInNestedNS", };
|
||||
public static final String[] names = {
|
||||
"NONE", "TableInNestedNS",
|
||||
};
|
||||
|
||||
public static String name(int e) { return names[e]; }
|
||||
public static String name(int e) {
|
||||
return names[e];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,10 +5,11 @@ package NamespaceA.NamespaceB
|
||||
@Suppress("unused")
|
||||
@ExperimentalUnsignedTypes
|
||||
class UnionInNestedNS private constructor() {
|
||||
companion object {
|
||||
const val NONE: UByte = 0u
|
||||
const val TableInNestedNS: UByte = 1u
|
||||
val names : Array<String> = arrayOf("NONE", "TableInNestedNS")
|
||||
fun name(e: Int) : String = names[e]
|
||||
}
|
||||
companion object {
|
||||
const val NONE: UByte = 0u
|
||||
const val TableInNestedNS: UByte = 1u
|
||||
val names: Array<String> = arrayOf("NONE", "TableInNestedNS")
|
||||
|
||||
fun name(e: Int): String = names[e]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,14 +2,17 @@
|
||||
|
||||
# namespace: NamespaceB
|
||||
|
||||
|
||||
class UnionInNestedNS(object):
|
||||
NONE = 0
|
||||
TableInNestedNS = 1
|
||||
NONE = 0
|
||||
TableInNestedNS = 1
|
||||
|
||||
|
||||
def UnionInNestedNSCreator(unionType, table):
|
||||
from flatbuffers.table import Table
|
||||
if not isinstance(table, Table):
|
||||
return None
|
||||
if unionType == UnionInNestedNS().TableInNestedNS:
|
||||
return TableInNestedNST.InitFromBuf(table.Bytes, table.Pos)
|
||||
from flatbuffers.table import Table
|
||||
|
||||
if not isinstance(table, Table):
|
||||
return None
|
||||
if unionType == UnionInNestedNS().TableInNestedNS:
|
||||
return TableInNestedNST.InitFromBuf(table.Bytes, table.Pos)
|
||||
return None
|
||||
|
||||
@@ -8,26 +8,37 @@ public class UnionInNestedNSUnion {
|
||||
private byte type;
|
||||
private Object value;
|
||||
|
||||
public byte getType() { return type; }
|
||||
public byte getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(byte type) { this.type = type; }
|
||||
public void setType(byte type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Object getValue() { return value; }
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(Object value) { this.value = value; }
|
||||
public void setValue(Object value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public UnionInNestedNSUnion() {
|
||||
this.type = UnionInNestedNS.NONE;
|
||||
this.value = null;
|
||||
}
|
||||
|
||||
public NamespaceA.NamespaceB.TableInNestedNST asTableInNestedNS() { return (NamespaceA.NamespaceB.TableInNestedNST) value; }
|
||||
public NamespaceA.NamespaceB.TableInNestedNST asTableInNestedNS() {
|
||||
return (NamespaceA.NamespaceB.TableInNestedNST) value;
|
||||
}
|
||||
|
||||
public static int pack(FlatBufferBuilder builder, UnionInNestedNSUnion _o) {
|
||||
switch (_o.type) {
|
||||
case UnionInNestedNS.TableInNestedNS: return NamespaceA.NamespaceB.TableInNestedNS.pack(builder, _o.asTableInNestedNS());
|
||||
default: return 0;
|
||||
case UnionInNestedNS.TableInNestedNS:
|
||||
return NamespaceA.NamespaceB.TableInNestedNS.pack(builder, _o.asTableInNestedNS());
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,9 @@ type SecondTableInAT struct {
|
||||
}
|
||||
|
||||
func (t *SecondTableInAT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
|
||||
if t == nil { return 0 }
|
||||
if t == nil {
|
||||
return 0
|
||||
}
|
||||
referToCOffset := t.ReferToC.Pack(builder)
|
||||
SecondTableInAStart(builder)
|
||||
SecondTableInAAddReferToC(builder, referToCOffset)
|
||||
@@ -25,7 +27,9 @@ func (rcv *SecondTableInA) UnPackTo(t *SecondTableInAT) {
|
||||
}
|
||||
|
||||
func (rcv *SecondTableInA) UnPack() *SecondTableInAT {
|
||||
if rcv == nil { return nil }
|
||||
if rcv == nil {
|
||||
return nil
|
||||
}
|
||||
t := &SecondTableInAT{}
|
||||
rcv.UnPackTo(t)
|
||||
return t
|
||||
|
||||
@@ -2,57 +2,92 @@
|
||||
|
||||
package NamespaceA;
|
||||
|
||||
import java.nio.*;
|
||||
import java.lang.*;
|
||||
import java.util.*;
|
||||
import com.google.flatbuffers.*;
|
||||
import java.nio.*;
|
||||
import java.util.*;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public final class SecondTableInA extends Table {
|
||||
public static void ValidateVersion() { Constants.FLATBUFFERS_25_2_10(); }
|
||||
public static SecondTableInA getRootAsSecondTableInA(ByteBuffer _bb) { return getRootAsSecondTableInA(_bb, new SecondTableInA()); }
|
||||
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 static void ValidateVersion() {
|
||||
Constants.FLATBUFFERS_25_2_10();
|
||||
}
|
||||
|
||||
public NamespaceC.TableInC referToC() { return referToC(new NamespaceC.TableInC()); }
|
||||
public NamespaceC.TableInC referToC(NamespaceC.TableInC obj) { int o = __offset(4); return o != 0 ? obj.__assign(__indirect(o + bb_pos), bb) : null; }
|
||||
public static SecondTableInA getRootAsSecondTableInA(ByteBuffer _bb) {
|
||||
return getRootAsSecondTableInA(_bb, new SecondTableInA());
|
||||
}
|
||||
|
||||
public static int createSecondTableInA(FlatBufferBuilder builder,
|
||||
int referToCOffset) {
|
||||
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());
|
||||
}
|
||||
|
||||
public NamespaceC.TableInC referToC(NamespaceC.TableInC obj) {
|
||||
int o = __offset(4);
|
||||
return o != 0 ? obj.__assign(__indirect(o + bb_pos), bb) : null;
|
||||
}
|
||||
|
||||
public static int createSecondTableInA(FlatBufferBuilder builder, int referToCOffset) {
|
||||
builder.startTable(1);
|
||||
SecondTableInA.addReferToC(builder, referToCOffset);
|
||||
return SecondTableInA.endSecondTableInA(builder);
|
||||
}
|
||||
|
||||
public static void startSecondTableInA(FlatBufferBuilder builder) { builder.startTable(1); }
|
||||
public static void addReferToC(FlatBufferBuilder builder, int referToCOffset) { builder.addOffset(0, referToCOffset, 0); }
|
||||
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.endTable();
|
||||
return o;
|
||||
}
|
||||
|
||||
public static final class Vector extends BaseVector {
|
||||
public Vector __assign(int _vector, int _element_size, ByteBuffer _bb) { __reset(_vector, _element_size, _bb); return this; }
|
||||
public Vector __assign(int _vector, int _element_size, ByteBuffer _bb) {
|
||||
__reset(_vector, _element_size, _bb);
|
||||
return this;
|
||||
}
|
||||
|
||||
public SecondTableInA get(int j) { return get(new SecondTableInA(), j); }
|
||||
public SecondTableInA get(SecondTableInA obj, int j) { return obj.__assign(__indirect(__element(j), bb), bb); }
|
||||
public SecondTableInA get(int j) {
|
||||
return get(new SecondTableInA(), j);
|
||||
}
|
||||
|
||||
public SecondTableInA get(SecondTableInA obj, int j) {
|
||||
return obj.__assign(__indirect(__element(j), bb), bb);
|
||||
}
|
||||
}
|
||||
|
||||
public SecondTableInAT unpack() {
|
||||
SecondTableInAT _o = new SecondTableInAT();
|
||||
unpackTo(_o);
|
||||
return _o;
|
||||
}
|
||||
|
||||
public void unpackTo(SecondTableInAT _o) {
|
||||
if (referToC() != null) _o.setReferToC(referToC().unpack());
|
||||
else _o.setReferToC(null);
|
||||
}
|
||||
|
||||
public static int pack(FlatBufferBuilder builder, SecondTableInAT _o) {
|
||||
if (_o == null) return 0;
|
||||
int _refer_to_c = _o.getReferToC() == null ? 0 : NamespaceC.TableInC.pack(builder, _o.getReferToC());
|
||||
return createSecondTableInA(
|
||||
builder,
|
||||
_refer_to_c);
|
||||
int _refer_to_c =
|
||||
_o.getReferToC() == null ? 0 : NamespaceC.TableInC.pack(builder, _o.getReferToC());
|
||||
return createSecondTableInA(builder, _refer_to_c);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,59 +2,61 @@
|
||||
|
||||
package NamespaceA
|
||||
|
||||
import com.google.flatbuffers.BaseVector
|
||||
import com.google.flatbuffers.BooleanVector
|
||||
import com.google.flatbuffers.ByteVector
|
||||
import com.google.flatbuffers.Constants
|
||||
import com.google.flatbuffers.DoubleVector
|
||||
import com.google.flatbuffers.FlatBufferBuilder
|
||||
import com.google.flatbuffers.FloatVector
|
||||
import com.google.flatbuffers.LongVector
|
||||
import com.google.flatbuffers.StringVector
|
||||
import com.google.flatbuffers.Struct
|
||||
import com.google.flatbuffers.Table
|
||||
import com.google.flatbuffers.UnionVector
|
||||
import java.nio.ByteBuffer
|
||||
import java.nio.ByteOrder
|
||||
import kotlin.math.sign
|
||||
|
||||
@Suppress("unused")
|
||||
@ExperimentalUnsignedTypes
|
||||
class SecondTableInA : Table() {
|
||||
|
||||
fun __init(_i: Int, _bb: ByteBuffer) {
|
||||
__reset(_i, _bb)
|
||||
fun __init(_i: Int, _bb: ByteBuffer) {
|
||||
__reset(_i, _bb)
|
||||
}
|
||||
|
||||
fun __assign(_i: Int, _bb: ByteBuffer): SecondTableInA {
|
||||
__init(_i, _bb)
|
||||
return this
|
||||
}
|
||||
|
||||
val referToC: NamespaceC.TableInC?
|
||||
get() = referToC(NamespaceC.TableInC())
|
||||
|
||||
fun referToC(obj: NamespaceC.TableInC): NamespaceC.TableInC? {
|
||||
val o = __offset(4)
|
||||
return if (o != 0) {
|
||||
obj.__assign(__indirect(o + bb_pos), bb)
|
||||
} else {
|
||||
null
|
||||
}
|
||||
fun __assign(_i: Int, _bb: ByteBuffer) : SecondTableInA {
|
||||
__init(_i, _bb)
|
||||
return this
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun validateVersion() = Constants.FLATBUFFERS_25_2_10()
|
||||
|
||||
fun getRootAsSecondTableInA(_bb: ByteBuffer): SecondTableInA =
|
||||
getRootAsSecondTableInA(_bb, SecondTableInA())
|
||||
|
||||
fun getRootAsSecondTableInA(_bb: ByteBuffer, obj: SecondTableInA): SecondTableInA {
|
||||
_bb.order(ByteOrder.LITTLE_ENDIAN)
|
||||
return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb))
|
||||
}
|
||||
val referToC : NamespaceC.TableInC? get() = referToC(NamespaceC.TableInC())
|
||||
fun referToC(obj: NamespaceC.TableInC) : NamespaceC.TableInC? {
|
||||
val o = __offset(4)
|
||||
return if (o != 0) {
|
||||
obj.__assign(__indirect(o + bb_pos), bb)
|
||||
} else {
|
||||
null
|
||||
}
|
||||
|
||||
fun createSecondTableInA(builder: FlatBufferBuilder, referToCOffset: Int): Int {
|
||||
builder.startTable(1)
|
||||
addReferToC(builder, referToCOffset)
|
||||
return endSecondTableInA(builder)
|
||||
}
|
||||
companion object {
|
||||
fun validateVersion() = Constants.FLATBUFFERS_25_2_10()
|
||||
fun getRootAsSecondTableInA(_bb: ByteBuffer): SecondTableInA = getRootAsSecondTableInA(_bb, SecondTableInA())
|
||||
fun getRootAsSecondTableInA(_bb: ByteBuffer, obj: SecondTableInA): SecondTableInA {
|
||||
_bb.order(ByteOrder.LITTLE_ENDIAN)
|
||||
return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb))
|
||||
}
|
||||
fun createSecondTableInA(builder: FlatBufferBuilder, referToCOffset: Int) : Int {
|
||||
builder.startTable(1)
|
||||
addReferToC(builder, referToCOffset)
|
||||
return endSecondTableInA(builder)
|
||||
}
|
||||
fun startSecondTableInA(builder: FlatBufferBuilder) = builder.startTable(1)
|
||||
fun addReferToC(builder: FlatBufferBuilder, referToC: Int) = builder.addOffset(0, referToC, 0)
|
||||
fun endSecondTableInA(builder: FlatBufferBuilder) : Int {
|
||||
val o = builder.endTable()
|
||||
return o
|
||||
}
|
||||
|
||||
fun startSecondTableInA(builder: FlatBufferBuilder) = builder.startTable(1)
|
||||
|
||||
fun addReferToC(builder: FlatBufferBuilder, referToC: Int) = builder.addOffset(0, referToC, 0)
|
||||
|
||||
fun endSecondTableInA(builder: FlatBufferBuilder): Int {
|
||||
val o = builder.endTable()
|
||||
return o
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,81 +4,103 @@
|
||||
|
||||
import flatbuffers
|
||||
from flatbuffers.compat import import_numpy
|
||||
|
||||
np = import_numpy()
|
||||
|
||||
|
||||
class SecondTableInA(object):
|
||||
__slots__ = ['_tab']
|
||||
__slots__ = ['_tab']
|
||||
|
||||
@classmethod
|
||||
def GetRootAs(cls, buf, offset=0):
|
||||
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
||||
x = SecondTableInA()
|
||||
x.Init(buf, n + offset)
|
||||
return x
|
||||
@classmethod
|
||||
def GetRootAs(cls, buf, offset=0):
|
||||
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
||||
x = SecondTableInA()
|
||||
x.Init(buf, n + offset)
|
||||
return x
|
||||
|
||||
@classmethod
|
||||
def GetRootAsSecondTableInA(cls, buf, offset=0):
|
||||
"""This method is deprecated. Please switch to GetRootAs."""
|
||||
return cls.GetRootAs(buf, offset)
|
||||
# SecondTableInA
|
||||
def Init(self, buf, pos):
|
||||
self._tab = flatbuffers.table.Table(buf, pos)
|
||||
@classmethod
|
||||
def GetRootAsSecondTableInA(cls, buf, offset=0):
|
||||
"""This method is deprecated. Please switch to GetRootAs."""
|
||||
return cls.GetRootAs(buf, offset)
|
||||
|
||||
# SecondTableInA
|
||||
def Init(self, buf, pos):
|
||||
self._tab = flatbuffers.table.Table(buf, pos)
|
||||
|
||||
# SecondTableInA
|
||||
def ReferToC(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
||||
if o != 0:
|
||||
x = self._tab.Indirect(o + self._tab.Pos)
|
||||
obj = TableInC()
|
||||
obj.Init(self._tab.Bytes, x)
|
||||
return obj
|
||||
return None
|
||||
|
||||
|
||||
def SecondTableInAStart(builder):
|
||||
builder.StartObject(1)
|
||||
|
||||
# SecondTableInA
|
||||
def ReferToC(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
||||
if o != 0:
|
||||
x = self._tab.Indirect(o + self._tab.Pos)
|
||||
obj = TableInC()
|
||||
obj.Init(self._tab.Bytes, x)
|
||||
return obj
|
||||
return None
|
||||
|
||||
def SecondTableInAStart(builder): builder.StartObject(1)
|
||||
def Start(builder):
|
||||
return SecondTableInAStart(builder)
|
||||
def SecondTableInAAddReferToC(builder, referToC): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(referToC), 0)
|
||||
return SecondTableInAStart(builder)
|
||||
|
||||
|
||||
def SecondTableInAAddReferToC(builder, referToC):
|
||||
builder.PrependUOffsetTRelativeSlot(
|
||||
0, flatbuffers.number_types.UOffsetTFlags.py_type(referToC), 0
|
||||
)
|
||||
|
||||
|
||||
def AddReferToC(builder, referToC):
|
||||
return SecondTableInAAddReferToC(builder, referToC)
|
||||
def SecondTableInAEnd(builder): return builder.EndObject()
|
||||
return SecondTableInAAddReferToC(builder, referToC)
|
||||
|
||||
|
||||
def SecondTableInAEnd(builder):
|
||||
return builder.EndObject()
|
||||
|
||||
|
||||
def End(builder):
|
||||
return SecondTableInAEnd(builder)
|
||||
return SecondTableInAEnd(builder)
|
||||
|
||||
|
||||
try:
|
||||
from typing import Optional
|
||||
from typing import Optional
|
||||
except:
|
||||
pass
|
||||
pass
|
||||
|
||||
|
||||
class SecondTableInAT(object):
|
||||
|
||||
# SecondTableInAT
|
||||
def __init__(self):
|
||||
self.referToC = None # type: Optional[TableInCT]
|
||||
# SecondTableInAT
|
||||
def __init__(self):
|
||||
self.referToC = None # type: Optional[TableInCT]
|
||||
|
||||
@classmethod
|
||||
def InitFromBuf(cls, buf, pos):
|
||||
secondTableInA = SecondTableInA()
|
||||
secondTableInA.Init(buf, pos)
|
||||
return cls.InitFromObj(secondTableInA)
|
||||
@classmethod
|
||||
def InitFromBuf(cls, buf, pos):
|
||||
secondTableInA = SecondTableInA()
|
||||
secondTableInA.Init(buf, pos)
|
||||
return cls.InitFromObj(secondTableInA)
|
||||
|
||||
@classmethod
|
||||
def InitFromObj(cls, secondTableInA):
|
||||
x = SecondTableInAT()
|
||||
x._UnPack(secondTableInA)
|
||||
return x
|
||||
@classmethod
|
||||
def InitFromObj(cls, secondTableInA):
|
||||
x = SecondTableInAT()
|
||||
x._UnPack(secondTableInA)
|
||||
return x
|
||||
|
||||
# SecondTableInAT
|
||||
def _UnPack(self, secondTableInA):
|
||||
if secondTableInA is None:
|
||||
return
|
||||
if secondTableInA.ReferToC() is not None:
|
||||
self.referToC = TableInCT.InitFromObj(secondTableInA.ReferToC())
|
||||
# SecondTableInAT
|
||||
def _UnPack(self, secondTableInA):
|
||||
if secondTableInA is None:
|
||||
return
|
||||
if secondTableInA.ReferToC() is not None:
|
||||
self.referToC = TableInCT.InitFromObj(secondTableInA.ReferToC())
|
||||
|
||||
# SecondTableInAT
|
||||
def Pack(self, builder):
|
||||
if self.referToC is not None:
|
||||
referToC = self.referToC.Pack(builder)
|
||||
SecondTableInAStart(builder)
|
||||
if self.referToC is not None:
|
||||
SecondTableInAAddReferToC(builder, referToC)
|
||||
secondTableInA = SecondTableInAEnd(builder)
|
||||
return secondTableInA
|
||||
# SecondTableInAT
|
||||
def Pack(self, builder):
|
||||
if self.referToC is not None:
|
||||
referToC = self.referToC.Pack(builder)
|
||||
SecondTableInAStart(builder)
|
||||
if self.referToC is not None:
|
||||
SecondTableInAAddReferToC(builder, referToC)
|
||||
secondTableInA = SecondTableInAEnd(builder)
|
||||
return secondTableInA
|
||||
|
||||
@@ -2,21 +2,22 @@
|
||||
|
||||
package NamespaceA;
|
||||
|
||||
import java.nio.*;
|
||||
import java.lang.*;
|
||||
import java.util.*;
|
||||
import com.google.flatbuffers.*;
|
||||
import java.nio.*;
|
||||
import java.util.*;
|
||||
|
||||
public class SecondTableInAT {
|
||||
private NamespaceC.TableInCT referToC;
|
||||
|
||||
public NamespaceC.TableInCT getReferToC() { return referToC; }
|
||||
|
||||
public void setReferToC(NamespaceC.TableInCT referToC) { this.referToC = referToC; }
|
||||
public NamespaceC.TableInCT getReferToC() {
|
||||
return referToC;
|
||||
}
|
||||
|
||||
public void setReferToC(NamespaceC.TableInCT referToC) {
|
||||
this.referToC = referToC;
|
||||
}
|
||||
|
||||
public SecondTableInAT() {
|
||||
this.referToC = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ package NamespaceA
|
||||
import (
|
||||
flatbuffers "github.com/google/flatbuffers/go"
|
||||
)
|
||||
|
||||
type TableInC struct {
|
||||
_tab flatbuffers.Table
|
||||
}
|
||||
@@ -41,6 +42,10 @@ func (rcv *TableInC) ReferToA2(obj *SecondTableInA) *SecondTableInA {
|
||||
}
|
||||
|
||||
func TableInCStart(builder *flatbuffers.Builder) { builder.StartObject(2) }
|
||||
func TableInCAddReferToA1(builder *flatbuffers.Builder, referToA1 flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(referToA1), 0) }
|
||||
func TableInCAddReferToA2(builder *flatbuffers.Builder, referToA2 flatbuffers.UOffsetT) { builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(referToA2), 0) }
|
||||
func TableInCAddReferToA1(builder *flatbuffers.Builder, referToA1 flatbuffers.UOffsetT) {
|
||||
builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(referToA1), 0)
|
||||
}
|
||||
func TableInCAddReferToA2(builder *flatbuffers.Builder, referToA2 flatbuffers.UOffsetT) {
|
||||
builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(referToA2), 0)
|
||||
}
|
||||
func TableInCEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() }
|
||||
|
||||
@@ -4,36 +4,54 @@
|
||||
|
||||
import flatbuffers
|
||||
|
||||
|
||||
class TableInC(object):
|
||||
__slots__ = ['_tab']
|
||||
__slots__ = ['_tab']
|
||||
|
||||
# TableInC
|
||||
def Init(self, buf, pos):
|
||||
self._tab = flatbuffers.table.Table(buf, pos)
|
||||
# TableInC
|
||||
def Init(self, buf, pos):
|
||||
self._tab = flatbuffers.table.Table(buf, pos)
|
||||
|
||||
# TableInC
|
||||
def ReferToA1(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
||||
if o != 0:
|
||||
x = self._tab.Indirect(o + self._tab.Pos)
|
||||
from .TableInFirstNS import TableInFirstNS
|
||||
obj = TableInFirstNS()
|
||||
obj.Init(self._tab.Bytes, x)
|
||||
return obj
|
||||
return None
|
||||
# TableInC
|
||||
def ReferToA1(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
||||
if o != 0:
|
||||
x = self._tab.Indirect(o + self._tab.Pos)
|
||||
from .TableInFirstNS import TableInFirstNS
|
||||
|
||||
# TableInC
|
||||
def ReferToA2(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
||||
if o != 0:
|
||||
x = self._tab.Indirect(o + self._tab.Pos)
|
||||
from .SecondTableInA import SecondTableInA
|
||||
obj = SecondTableInA()
|
||||
obj.Init(self._tab.Bytes, x)
|
||||
return obj
|
||||
return None
|
||||
obj = TableInFirstNS()
|
||||
obj.Init(self._tab.Bytes, x)
|
||||
return obj
|
||||
return None
|
||||
|
||||
def TableInCStart(builder): builder.StartObject(2)
|
||||
def TableInCAddReferToA1(builder, referToA1): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(referToA1), 0)
|
||||
def TableInCAddReferToA2(builder, referToA2): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(referToA2), 0)
|
||||
def TableInCEnd(builder): return builder.EndObject()
|
||||
# TableInC
|
||||
def ReferToA2(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
||||
if o != 0:
|
||||
x = self._tab.Indirect(o + self._tab.Pos)
|
||||
from .SecondTableInA import SecondTableInA
|
||||
|
||||
obj = SecondTableInA()
|
||||
obj.Init(self._tab.Bytes, x)
|
||||
return obj
|
||||
return None
|
||||
|
||||
|
||||
def TableInCStart(builder):
|
||||
builder.StartObject(2)
|
||||
|
||||
|
||||
def TableInCAddReferToA1(builder, referToA1):
|
||||
builder.PrependUOffsetTRelativeSlot(
|
||||
0, flatbuffers.number_types.UOffsetTFlags.py_type(referToA1), 0
|
||||
)
|
||||
|
||||
|
||||
def TableInCAddReferToA2(builder, referToA2):
|
||||
builder.PrependUOffsetTRelativeSlot(
|
||||
1, flatbuffers.number_types.UOffsetTFlags.py_type(referToA2), 0
|
||||
)
|
||||
|
||||
|
||||
def TableInCEnd(builder):
|
||||
return builder.EndObject()
|
||||
|
||||
@@ -9,17 +9,19 @@ import (
|
||||
)
|
||||
|
||||
type TableInFirstNST struct {
|
||||
FooTable *NamespaceA__NamespaceB.TableInNestedNST
|
||||
FooEnum NamespaceA__NamespaceB.EnumInNestedNS
|
||||
FooUnion *NamespaceA__NamespaceB.UnionInNestedNST
|
||||
FooTable *NamespaceA__NamespaceB.TableInNestedNST
|
||||
FooEnum NamespaceA__NamespaceB.EnumInNestedNS
|
||||
FooUnion *NamespaceA__NamespaceB.UnionInNestedNST
|
||||
FooStruct *NamespaceA__NamespaceB.StructInNestedNST
|
||||
}
|
||||
|
||||
func (t *TableInFirstNST) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
|
||||
if t == nil { return 0 }
|
||||
if t == nil {
|
||||
return 0
|
||||
}
|
||||
fooTableOffset := t.FooTable.Pack(builder)
|
||||
fooUnionOffset := t.FooUnion.Pack(builder)
|
||||
|
||||
|
||||
TableInFirstNSStart(builder)
|
||||
TableInFirstNSAddFooTable(builder, fooTableOffset)
|
||||
TableInFirstNSAddFooEnum(builder, t.FooEnum)
|
||||
@@ -43,7 +45,9 @@ func (rcv *TableInFirstNS) UnPackTo(t *TableInFirstNST) {
|
||||
}
|
||||
|
||||
func (rcv *TableInFirstNS) UnPack() *TableInFirstNST {
|
||||
if rcv == nil { return nil }
|
||||
if rcv == nil {
|
||||
return nil
|
||||
}
|
||||
t := &TableInFirstNST{}
|
||||
rcv.UnPackTo(t)
|
||||
return t
|
||||
|
||||
@@ -2,75 +2,168 @@
|
||||
|
||||
package NamespaceA;
|
||||
|
||||
import java.nio.*;
|
||||
import java.lang.*;
|
||||
import java.util.*;
|
||||
import com.google.flatbuffers.*;
|
||||
import java.nio.*;
|
||||
import java.util.*;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public final class TableInFirstNS extends Table {
|
||||
public static void ValidateVersion() { Constants.FLATBUFFERS_25_2_10(); }
|
||||
public static TableInFirstNS getRootAsTableInFirstNS(ByteBuffer _bb) { return getRootAsTableInFirstNS(_bb, new TableInFirstNS()); }
|
||||
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 static void ValidateVersion() {
|
||||
Constants.FLATBUFFERS_25_2_10();
|
||||
}
|
||||
|
||||
public NamespaceA.NamespaceB.TableInNestedNS fooTable() { return fooTable(new NamespaceA.NamespaceB.TableInNestedNS()); }
|
||||
public NamespaceA.NamespaceB.TableInNestedNS fooTable(NamespaceA.NamespaceB.TableInNestedNS obj) { int o = __offset(4); return o != 0 ? obj.__assign(__indirect(o + bb_pos), bb) : null; }
|
||||
public byte fooEnum() { int o = __offset(6); return o != 0 ? bb.get(o + bb_pos) : 0; }
|
||||
public boolean mutateFooEnum(byte foo_enum) { int o = __offset(6); if (o != 0) { bb.put(o + bb_pos, foo_enum); return true; } else { return false; } }
|
||||
public byte fooUnionType() { int o = __offset(8); return o != 0 ? bb.get(o + bb_pos) : 0; }
|
||||
public Table fooUnion(Table obj) { int o = __offset(10); return o != 0 ? __union(obj, o + bb_pos) : null; }
|
||||
public NamespaceA.NamespaceB.StructInNestedNS fooStruct() { return fooStruct(new NamespaceA.NamespaceB.StructInNestedNS()); }
|
||||
public NamespaceA.NamespaceB.StructInNestedNS fooStruct(NamespaceA.NamespaceB.StructInNestedNS obj) { int o = __offset(12); return o != 0 ? obj.__assign(o + bb_pos, bb) : null; }
|
||||
public static TableInFirstNS getRootAsTableInFirstNS(ByteBuffer _bb) {
|
||||
return getRootAsTableInFirstNS(_bb, new TableInFirstNS());
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
|
||||
public NamespaceA.NamespaceB.TableInNestedNS fooTable(NamespaceA.NamespaceB.TableInNestedNS obj) {
|
||||
int o = __offset(4);
|
||||
return o != 0 ? obj.__assign(__indirect(o + bb_pos), bb) : null;
|
||||
}
|
||||
|
||||
public byte fooEnum() {
|
||||
int o = __offset(6);
|
||||
return o != 0 ? bb.get(o + bb_pos) : 0;
|
||||
}
|
||||
|
||||
public boolean mutateFooEnum(byte foo_enum) {
|
||||
int o = __offset(6);
|
||||
if (o != 0) {
|
||||
bb.put(o + bb_pos, foo_enum);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public byte fooUnionType() {
|
||||
int o = __offset(8);
|
||||
return o != 0 ? bb.get(o + bb_pos) : 0;
|
||||
}
|
||||
|
||||
public Table fooUnion(Table obj) {
|
||||
int o = __offset(10);
|
||||
return o != 0 ? __union(obj, o + bb_pos) : null;
|
||||
}
|
||||
|
||||
public NamespaceA.NamespaceB.StructInNestedNS fooStruct() {
|
||||
return fooStruct(new NamespaceA.NamespaceB.StructInNestedNS());
|
||||
}
|
||||
|
||||
public NamespaceA.NamespaceB.StructInNestedNS fooStruct(
|
||||
NamespaceA.NamespaceB.StructInNestedNS obj) {
|
||||
int o = __offset(12);
|
||||
return o != 0 ? obj.__assign(o + bb_pos, bb) : null;
|
||||
}
|
||||
|
||||
public static void startTableInFirstNS(FlatBufferBuilder builder) {
|
||||
builder.startTable(5);
|
||||
}
|
||||
|
||||
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 addFooUnionType(FlatBufferBuilder builder, byte fooUnionType) {
|
||||
builder.addByte(2, fooUnionType, 0);
|
||||
}
|
||||
|
||||
public static void addFooUnion(FlatBufferBuilder builder, int fooUnionOffset) {
|
||||
builder.addOffset(3, fooUnionOffset, 0);
|
||||
}
|
||||
|
||||
public static void addFooStruct(FlatBufferBuilder builder, int fooStructOffset) {
|
||||
builder.addStruct(4, fooStructOffset, 0);
|
||||
}
|
||||
|
||||
public static void startTableInFirstNS(FlatBufferBuilder builder) { builder.startTable(5); }
|
||||
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 addFooUnionType(FlatBufferBuilder builder, byte fooUnionType) { builder.addByte(2, fooUnionType, 0); }
|
||||
public static void addFooUnion(FlatBufferBuilder builder, int fooUnionOffset) { builder.addOffset(3, fooUnionOffset, 0); }
|
||||
public static void addFooStruct(FlatBufferBuilder builder, int fooStructOffset) { builder.addStruct(4, fooStructOffset, 0); }
|
||||
public static int endTableInFirstNS(FlatBufferBuilder builder) {
|
||||
int o = builder.endTable();
|
||||
return o;
|
||||
}
|
||||
|
||||
public static final class Vector extends BaseVector {
|
||||
public Vector __assign(int _vector, int _element_size, ByteBuffer _bb) { __reset(_vector, _element_size, _bb); return this; }
|
||||
public Vector __assign(int _vector, int _element_size, ByteBuffer _bb) {
|
||||
__reset(_vector, _element_size, _bb);
|
||||
return this;
|
||||
}
|
||||
|
||||
public TableInFirstNS get(int j) { return get(new TableInFirstNS(), j); }
|
||||
public TableInFirstNS get(TableInFirstNS obj, int j) { return obj.__assign(__indirect(__element(j), bb), bb); }
|
||||
public TableInFirstNS get(int j) {
|
||||
return get(new TableInFirstNS(), j);
|
||||
}
|
||||
|
||||
public TableInFirstNS get(TableInFirstNS obj, int j) {
|
||||
return obj.__assign(__indirect(__element(j), bb), bb);
|
||||
}
|
||||
}
|
||||
|
||||
public TableInFirstNST unpack() {
|
||||
TableInFirstNST _o = new TableInFirstNST();
|
||||
unpackTo(_o);
|
||||
return _o;
|
||||
}
|
||||
|
||||
public void unpackTo(TableInFirstNST _o) {
|
||||
if (fooTable() != null) _o.setFooTable(fooTable().unpack());
|
||||
else _o.setFooTable(null);
|
||||
byte _oFooEnum = fooEnum();
|
||||
_o.setFooEnum(_oFooEnum);
|
||||
NamespaceA.NamespaceB.UnionInNestedNSUnion _oFooUnion = new NamespaceA.NamespaceB.UnionInNestedNSUnion();
|
||||
NamespaceA.NamespaceB.UnionInNestedNSUnion _oFooUnion =
|
||||
new NamespaceA.NamespaceB.UnionInNestedNSUnion();
|
||||
byte _oFooUnionType = fooUnionType();
|
||||
_oFooUnion.setType(_oFooUnionType);
|
||||
Table _oFooUnionValue;
|
||||
switch (_oFooUnionType) {
|
||||
case NamespaceA.NamespaceB.UnionInNestedNS.TableInNestedNS:
|
||||
_oFooUnionValue = fooUnion(new NamespaceA.NamespaceB.TableInNestedNS());
|
||||
_oFooUnion.setValue(_oFooUnionValue != null ? ((NamespaceA.NamespaceB.TableInNestedNS) _oFooUnionValue).unpack() : null);
|
||||
_oFooUnion.setValue(
|
||||
_oFooUnionValue != null
|
||||
? ((NamespaceA.NamespaceB.TableInNestedNS) _oFooUnionValue).unpack()
|
||||
: null);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
_o.setFooUnion(_oFooUnion);
|
||||
if (fooStruct() != null) fooStruct().unpackTo(_o.getFooStruct());
|
||||
else _o.setFooStruct(null);
|
||||
}
|
||||
|
||||
public static int pack(FlatBufferBuilder builder, TableInFirstNST _o) {
|
||||
if (_o == null) return 0;
|
||||
int _foo_table = _o.getFooTable() == null ? 0 : NamespaceA.NamespaceB.TableInNestedNS.pack(builder, _o.getFooTable());
|
||||
byte _fooUnionType = _o.getFooUnion() == null ? NamespaceA.NamespaceB.UnionInNestedNS.NONE : _o.getFooUnion().getType();
|
||||
int _fooUnion = _o.getFooUnion() == null ? 0 : NamespaceA.NamespaceB.UnionInNestedNSUnion.pack(builder, _o.getFooUnion());
|
||||
int _foo_table =
|
||||
_o.getFooTable() == null
|
||||
? 0
|
||||
: NamespaceA.NamespaceB.TableInNestedNS.pack(builder, _o.getFooTable());
|
||||
byte _fooUnionType =
|
||||
_o.getFooUnion() == null
|
||||
? NamespaceA.NamespaceB.UnionInNestedNS.NONE
|
||||
: _o.getFooUnion().getType();
|
||||
int _fooUnion =
|
||||
_o.getFooUnion() == null
|
||||
? 0
|
||||
: NamespaceA.NamespaceB.UnionInNestedNSUnion.pack(builder, _o.getFooUnion());
|
||||
startTableInFirstNS(builder);
|
||||
addFooTable(builder, _foo_table);
|
||||
addFooEnum(builder, _o.getFooEnum());
|
||||
@@ -80,4 +173,3 @@ public final class TableInFirstNS extends Table {
|
||||
return endTableInFirstNS(builder);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,98 +2,116 @@
|
||||
|
||||
package NamespaceA
|
||||
|
||||
import com.google.flatbuffers.BaseVector
|
||||
import com.google.flatbuffers.BooleanVector
|
||||
import com.google.flatbuffers.ByteVector
|
||||
import com.google.flatbuffers.Constants
|
||||
import com.google.flatbuffers.DoubleVector
|
||||
import com.google.flatbuffers.FlatBufferBuilder
|
||||
import com.google.flatbuffers.FloatVector
|
||||
import com.google.flatbuffers.LongVector
|
||||
import com.google.flatbuffers.StringVector
|
||||
import com.google.flatbuffers.Struct
|
||||
import com.google.flatbuffers.Table
|
||||
import com.google.flatbuffers.UnionVector
|
||||
import java.nio.ByteBuffer
|
||||
import java.nio.ByteOrder
|
||||
import kotlin.math.sign
|
||||
|
||||
@Suppress("unused")
|
||||
@ExperimentalUnsignedTypes
|
||||
class TableInFirstNS : Table() {
|
||||
|
||||
fun __init(_i: Int, _bb: ByteBuffer) {
|
||||
__reset(_i, _bb)
|
||||
fun __init(_i: Int, _bb: ByteBuffer) {
|
||||
__reset(_i, _bb)
|
||||
}
|
||||
|
||||
fun __assign(_i: Int, _bb: ByteBuffer): TableInFirstNS {
|
||||
__init(_i, _bb)
|
||||
return this
|
||||
}
|
||||
|
||||
val fooTable: NamespaceA.NamespaceB.TableInNestedNS?
|
||||
get() = fooTable(NamespaceA.NamespaceB.TableInNestedNS())
|
||||
|
||||
fun fooTable(obj: NamespaceA.NamespaceB.TableInNestedNS): NamespaceA.NamespaceB.TableInNestedNS? {
|
||||
val o = __offset(4)
|
||||
return if (o != 0) {
|
||||
obj.__assign(__indirect(o + bb_pos), bb)
|
||||
} else {
|
||||
null
|
||||
}
|
||||
fun __assign(_i: Int, _bb: ByteBuffer) : TableInFirstNS {
|
||||
__init(_i, _bb)
|
||||
return this
|
||||
}
|
||||
|
||||
val fooEnum: Byte
|
||||
get() {
|
||||
val o = __offset(6)
|
||||
return if (o != 0) bb.get(o + bb_pos) else 0
|
||||
}
|
||||
val fooTable : NamespaceA.NamespaceB.TableInNestedNS? get() = fooTable(NamespaceA.NamespaceB.TableInNestedNS())
|
||||
fun fooTable(obj: NamespaceA.NamespaceB.TableInNestedNS) : NamespaceA.NamespaceB.TableInNestedNS? {
|
||||
val o = __offset(4)
|
||||
return if (o != 0) {
|
||||
obj.__assign(__indirect(o + bb_pos), bb)
|
||||
} else {
|
||||
null
|
||||
}
|
||||
|
||||
fun mutateFooEnum(fooEnum: Byte): Boolean {
|
||||
val o = __offset(6)
|
||||
return if (o != 0) {
|
||||
bb.put(o + bb_pos, fooEnum)
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
val fooEnum : Byte
|
||||
get() {
|
||||
val o = __offset(6)
|
||||
return if(o != 0) bb.get(o + bb_pos) else 0
|
||||
}
|
||||
fun mutateFooEnum(fooEnum: Byte) : Boolean {
|
||||
val o = __offset(6)
|
||||
return if (o != 0) {
|
||||
bb.put(o + bb_pos, fooEnum)
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
val fooUnionType: UByte
|
||||
get() {
|
||||
val o = __offset(8)
|
||||
return if (o != 0) bb.get(o + bb_pos).toUByte() else 0u
|
||||
}
|
||||
val fooUnionType : UByte
|
||||
get() {
|
||||
val o = __offset(8)
|
||||
return if(o != 0) bb.get(o + bb_pos).toUByte() else 0u
|
||||
}
|
||||
fun mutateFooUnionType(fooUnionType: UByte) : Boolean {
|
||||
val o = __offset(8)
|
||||
return if (o != 0) {
|
||||
bb.put(o + bb_pos, fooUnionType.toByte())
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
|
||||
fun mutateFooUnionType(fooUnionType: UByte): Boolean {
|
||||
val o = __offset(8)
|
||||
return if (o != 0) {
|
||||
bb.put(o + bb_pos, fooUnionType.toByte())
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
fun fooUnion(obj: Table) : Table? {
|
||||
val o = __offset(10); return if (o != 0) __union(obj, o + bb_pos) else null
|
||||
}
|
||||
|
||||
fun fooUnion(obj: Table): Table? {
|
||||
val o = __offset(10)
|
||||
return if (o != 0) __union(obj, o + bb_pos) else null
|
||||
}
|
||||
|
||||
val fooStruct: NamespaceA.NamespaceB.StructInNestedNS?
|
||||
get() = fooStruct(NamespaceA.NamespaceB.StructInNestedNS())
|
||||
|
||||
fun fooStruct(
|
||||
obj: NamespaceA.NamespaceB.StructInNestedNS
|
||||
): NamespaceA.NamespaceB.StructInNestedNS? {
|
||||
val o = __offset(12)
|
||||
return if (o != 0) {
|
||||
obj.__assign(o + bb_pos, bb)
|
||||
} else {
|
||||
null
|
||||
}
|
||||
val fooStruct : NamespaceA.NamespaceB.StructInNestedNS? get() = fooStruct(NamespaceA.NamespaceB.StructInNestedNS())
|
||||
fun fooStruct(obj: NamespaceA.NamespaceB.StructInNestedNS) : NamespaceA.NamespaceB.StructInNestedNS? {
|
||||
val o = __offset(12)
|
||||
return if (o != 0) {
|
||||
obj.__assign(o + bb_pos, bb)
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun validateVersion() = Constants.FLATBUFFERS_25_2_10()
|
||||
|
||||
fun getRootAsTableInFirstNS(_bb: ByteBuffer): TableInFirstNS =
|
||||
getRootAsTableInFirstNS(_bb, TableInFirstNS())
|
||||
|
||||
fun getRootAsTableInFirstNS(_bb: ByteBuffer, obj: TableInFirstNS): TableInFirstNS {
|
||||
_bb.order(ByteOrder.LITTLE_ENDIAN)
|
||||
return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb))
|
||||
}
|
||||
companion object {
|
||||
fun validateVersion() = Constants.FLATBUFFERS_25_2_10()
|
||||
fun getRootAsTableInFirstNS(_bb: ByteBuffer): TableInFirstNS = getRootAsTableInFirstNS(_bb, TableInFirstNS())
|
||||
fun getRootAsTableInFirstNS(_bb: ByteBuffer, obj: TableInFirstNS): TableInFirstNS {
|
||||
_bb.order(ByteOrder.LITTLE_ENDIAN)
|
||||
return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb))
|
||||
}
|
||||
fun startTableInFirstNS(builder: FlatBufferBuilder) = builder.startTable(5)
|
||||
fun addFooTable(builder: FlatBufferBuilder, fooTable: Int) = builder.addOffset(0, fooTable, 0)
|
||||
fun addFooEnum(builder: FlatBufferBuilder, fooEnum: Byte) = builder.addByte(1, fooEnum, 0)
|
||||
fun addFooUnionType(builder: FlatBufferBuilder, fooUnionType: UByte) = builder.addByte(2, fooUnionType.toByte(), 0)
|
||||
fun addFooUnion(builder: FlatBufferBuilder, fooUnion: Int) = builder.addOffset(3, fooUnion, 0)
|
||||
fun addFooStruct(builder: FlatBufferBuilder, fooStruct: Int) = builder.addStruct(4, fooStruct, 0)
|
||||
fun endTableInFirstNS(builder: FlatBufferBuilder) : Int {
|
||||
val o = builder.endTable()
|
||||
return o
|
||||
}
|
||||
|
||||
fun startTableInFirstNS(builder: FlatBufferBuilder) = builder.startTable(5)
|
||||
|
||||
fun addFooTable(builder: FlatBufferBuilder, fooTable: Int) = builder.addOffset(0, fooTable, 0)
|
||||
|
||||
fun addFooEnum(builder: FlatBufferBuilder, fooEnum: Byte) = builder.addByte(1, fooEnum, 0)
|
||||
|
||||
fun addFooUnionType(builder: FlatBufferBuilder, fooUnionType: UByte) =
|
||||
builder.addByte(2, fooUnionType.toByte(), 0)
|
||||
|
||||
fun addFooUnion(builder: FlatBufferBuilder, fooUnion: Int) = builder.addOffset(3, fooUnion, 0)
|
||||
|
||||
fun addFooStruct(builder: FlatBufferBuilder, fooStruct: Int) =
|
||||
builder.addStruct(4, fooStruct, 0)
|
||||
|
||||
fun endTableInFirstNS(builder: FlatBufferBuilder): Int {
|
||||
val o = builder.endTable()
|
||||
return o
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,145 +4,198 @@
|
||||
|
||||
import flatbuffers
|
||||
from flatbuffers.compat import import_numpy
|
||||
|
||||
np = import_numpy()
|
||||
|
||||
|
||||
class TableInFirstNS(object):
|
||||
__slots__ = ['_tab']
|
||||
__slots__ = ['_tab']
|
||||
|
||||
@classmethod
|
||||
def GetRootAs(cls, buf, offset=0):
|
||||
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
||||
x = TableInFirstNS()
|
||||
x.Init(buf, n + offset)
|
||||
return x
|
||||
@classmethod
|
||||
def GetRootAs(cls, buf, offset=0):
|
||||
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
||||
x = TableInFirstNS()
|
||||
x.Init(buf, n + offset)
|
||||
return x
|
||||
|
||||
@classmethod
|
||||
def GetRootAsTableInFirstNS(cls, buf, offset=0):
|
||||
"""This method is deprecated. Please switch to GetRootAs."""
|
||||
return cls.GetRootAs(buf, offset)
|
||||
# TableInFirstNS
|
||||
def Init(self, buf, pos):
|
||||
self._tab = flatbuffers.table.Table(buf, pos)
|
||||
@classmethod
|
||||
def GetRootAsTableInFirstNS(cls, buf, offset=0):
|
||||
"""This method is deprecated. Please switch to GetRootAs."""
|
||||
return cls.GetRootAs(buf, offset)
|
||||
|
||||
# TableInFirstNS
|
||||
def FooTable(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
||||
if o != 0:
|
||||
x = self._tab.Indirect(o + self._tab.Pos)
|
||||
obj = TableInNestedNS()
|
||||
obj.Init(self._tab.Bytes, x)
|
||||
return obj
|
||||
return None
|
||||
# TableInFirstNS
|
||||
def Init(self, buf, pos):
|
||||
self._tab = flatbuffers.table.Table(buf, pos)
|
||||
|
||||
# TableInFirstNS
|
||||
def FooEnum(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
# TableInFirstNS
|
||||
def FooTable(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
||||
if o != 0:
|
||||
x = self._tab.Indirect(o + self._tab.Pos)
|
||||
obj = TableInNestedNS()
|
||||
obj.Init(self._tab.Bytes, x)
|
||||
return obj
|
||||
return None
|
||||
|
||||
# TableInFirstNS
|
||||
def FooUnionType(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
|
||||
if o != 0:
|
||||
return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
|
||||
return 0
|
||||
# TableInFirstNS
|
||||
def FooEnum(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
||||
if o != 0:
|
||||
return self._tab.Get(
|
||||
flatbuffers.number_types.Int8Flags, o + self._tab.Pos
|
||||
)
|
||||
return 0
|
||||
|
||||
# TableInFirstNS
|
||||
def FooUnion(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
|
||||
if o != 0:
|
||||
from flatbuffers.table import Table
|
||||
obj = Table(bytearray(), 0)
|
||||
self._tab.Union(obj, o)
|
||||
return obj
|
||||
return None
|
||||
# TableInFirstNS
|
||||
def FooUnionType(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
|
||||
if o != 0:
|
||||
return self._tab.Get(
|
||||
flatbuffers.number_types.Uint8Flags, o + self._tab.Pos
|
||||
)
|
||||
return 0
|
||||
|
||||
# TableInFirstNS
|
||||
def FooUnion(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
|
||||
if o != 0:
|
||||
from flatbuffers.table import Table
|
||||
|
||||
obj = Table(bytearray(), 0)
|
||||
self._tab.Union(obj, o)
|
||||
return obj
|
||||
return None
|
||||
|
||||
# TableInFirstNS
|
||||
def FooStruct(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
|
||||
if o != 0:
|
||||
x = o + self._tab.Pos
|
||||
obj = StructInNestedNS()
|
||||
obj.Init(self._tab.Bytes, x)
|
||||
return obj
|
||||
return None
|
||||
|
||||
|
||||
def TableInFirstNSStart(builder):
|
||||
builder.StartObject(5)
|
||||
|
||||
# TableInFirstNS
|
||||
def FooStruct(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
|
||||
if o != 0:
|
||||
x = o + self._tab.Pos
|
||||
obj = StructInNestedNS()
|
||||
obj.Init(self._tab.Bytes, x)
|
||||
return obj
|
||||
return None
|
||||
|
||||
def TableInFirstNSStart(builder): builder.StartObject(5)
|
||||
def Start(builder):
|
||||
return TableInFirstNSStart(builder)
|
||||
def TableInFirstNSAddFooTable(builder, fooTable): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(fooTable), 0)
|
||||
return TableInFirstNSStart(builder)
|
||||
|
||||
|
||||
def TableInFirstNSAddFooTable(builder, fooTable):
|
||||
builder.PrependUOffsetTRelativeSlot(
|
||||
0, flatbuffers.number_types.UOffsetTFlags.py_type(fooTable), 0
|
||||
)
|
||||
|
||||
|
||||
def AddFooTable(builder, fooTable):
|
||||
return TableInFirstNSAddFooTable(builder, fooTable)
|
||||
def TableInFirstNSAddFooEnum(builder, fooEnum): builder.PrependInt8Slot(1, fooEnum, 0)
|
||||
return TableInFirstNSAddFooTable(builder, fooTable)
|
||||
|
||||
|
||||
def TableInFirstNSAddFooEnum(builder, fooEnum):
|
||||
builder.PrependInt8Slot(1, fooEnum, 0)
|
||||
|
||||
|
||||
def AddFooEnum(builder, fooEnum):
|
||||
return TableInFirstNSAddFooEnum(builder, fooEnum)
|
||||
def TableInFirstNSAddFooUnionType(builder, fooUnionType): builder.PrependUint8Slot(2, fooUnionType, 0)
|
||||
return TableInFirstNSAddFooEnum(builder, fooEnum)
|
||||
|
||||
|
||||
def TableInFirstNSAddFooUnionType(builder, fooUnionType):
|
||||
builder.PrependUint8Slot(2, fooUnionType, 0)
|
||||
|
||||
|
||||
def AddFooUnionType(builder, fooUnionType):
|
||||
return TableInFirstNSAddFooUnionType(builder, fooUnionType)
|
||||
def TableInFirstNSAddFooUnion(builder, fooUnion): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(fooUnion), 0)
|
||||
return TableInFirstNSAddFooUnionType(builder, fooUnionType)
|
||||
|
||||
|
||||
def TableInFirstNSAddFooUnion(builder, fooUnion):
|
||||
builder.PrependUOffsetTRelativeSlot(
|
||||
3, flatbuffers.number_types.UOffsetTFlags.py_type(fooUnion), 0
|
||||
)
|
||||
|
||||
|
||||
def AddFooUnion(builder, fooUnion):
|
||||
return TableInFirstNSAddFooUnion(builder, fooUnion)
|
||||
def TableInFirstNSAddFooStruct(builder, fooStruct): builder.PrependStructSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(fooStruct), 0)
|
||||
return TableInFirstNSAddFooUnion(builder, fooUnion)
|
||||
|
||||
|
||||
def TableInFirstNSAddFooStruct(builder, fooStruct):
|
||||
builder.PrependStructSlot(
|
||||
4, flatbuffers.number_types.UOffsetTFlags.py_type(fooStruct), 0
|
||||
)
|
||||
|
||||
|
||||
def AddFooStruct(builder, fooStruct):
|
||||
return TableInFirstNSAddFooStruct(builder, fooStruct)
|
||||
def TableInFirstNSEnd(builder): return builder.EndObject()
|
||||
return TableInFirstNSAddFooStruct(builder, fooStruct)
|
||||
|
||||
|
||||
def TableInFirstNSEnd(builder):
|
||||
return builder.EndObject()
|
||||
|
||||
|
||||
def End(builder):
|
||||
return TableInFirstNSEnd(builder)
|
||||
return TableInFirstNSEnd(builder)
|
||||
|
||||
|
||||
try:
|
||||
from typing import Optional, Union
|
||||
from typing import Optional, Union
|
||||
except:
|
||||
pass
|
||||
pass
|
||||
|
||||
|
||||
class TableInFirstNST(object):
|
||||
|
||||
# TableInFirstNST
|
||||
def __init__(self):
|
||||
self.fooTable = None # type: Optional[TableInNestedNST]
|
||||
self.fooEnum = 0 # type: int
|
||||
self.fooUnionType = 0 # type: int
|
||||
self.fooUnion = None # type: Union[None, TableInNestedNST]
|
||||
self.fooStruct = None # type: Optional[StructInNestedNST]
|
||||
# TableInFirstNST
|
||||
def __init__(self):
|
||||
self.fooTable = None # type: Optional[TableInNestedNST]
|
||||
self.fooEnum = 0 # type: int
|
||||
self.fooUnionType = 0 # type: int
|
||||
self.fooUnion = None # type: Union[None, TableInNestedNST]
|
||||
self.fooStruct = None # type: Optional[StructInNestedNST]
|
||||
|
||||
@classmethod
|
||||
def InitFromBuf(cls, buf, pos):
|
||||
tableInFirstNS = TableInFirstNS()
|
||||
tableInFirstNS.Init(buf, pos)
|
||||
return cls.InitFromObj(tableInFirstNS)
|
||||
@classmethod
|
||||
def InitFromBuf(cls, buf, pos):
|
||||
tableInFirstNS = TableInFirstNS()
|
||||
tableInFirstNS.Init(buf, pos)
|
||||
return cls.InitFromObj(tableInFirstNS)
|
||||
|
||||
@classmethod
|
||||
def InitFromObj(cls, tableInFirstNS):
|
||||
x = TableInFirstNST()
|
||||
x._UnPack(tableInFirstNS)
|
||||
return x
|
||||
@classmethod
|
||||
def InitFromObj(cls, tableInFirstNS):
|
||||
x = TableInFirstNST()
|
||||
x._UnPack(tableInFirstNS)
|
||||
return x
|
||||
|
||||
# TableInFirstNST
|
||||
def _UnPack(self, tableInFirstNS):
|
||||
if tableInFirstNS is None:
|
||||
return
|
||||
if tableInFirstNS.FooTable() is not None:
|
||||
self.fooTable = TableInNestedNST.InitFromObj(tableInFirstNS.FooTable())
|
||||
self.fooEnum = tableInFirstNS.FooEnum()
|
||||
self.fooUnionType = tableInFirstNS.FooUnionType()
|
||||
self.fooUnion = UnionInNestedNSCreator(self.fooUnionType, tableInFirstNS.FooUnion())
|
||||
if tableInFirstNS.FooStruct() is not None:
|
||||
self.fooStruct = StructInNestedNST.InitFromObj(tableInFirstNS.FooStruct())
|
||||
# TableInFirstNST
|
||||
def _UnPack(self, tableInFirstNS):
|
||||
if tableInFirstNS is None:
|
||||
return
|
||||
if tableInFirstNS.FooTable() is not None:
|
||||
self.fooTable = TableInNestedNST.InitFromObj(tableInFirstNS.FooTable())
|
||||
self.fooEnum = tableInFirstNS.FooEnum()
|
||||
self.fooUnionType = tableInFirstNS.FooUnionType()
|
||||
self.fooUnion = UnionInNestedNSCreator(
|
||||
self.fooUnionType, tableInFirstNS.FooUnion()
|
||||
)
|
||||
if tableInFirstNS.FooStruct() is not None:
|
||||
self.fooStruct = StructInNestedNST.InitFromObj(tableInFirstNS.FooStruct())
|
||||
|
||||
# TableInFirstNST
|
||||
def Pack(self, builder):
|
||||
if self.fooTable is not None:
|
||||
fooTable = self.fooTable.Pack(builder)
|
||||
if self.fooUnion is not None:
|
||||
fooUnion = self.fooUnion.Pack(builder)
|
||||
TableInFirstNSStart(builder)
|
||||
if self.fooTable is not None:
|
||||
TableInFirstNSAddFooTable(builder, fooTable)
|
||||
TableInFirstNSAddFooEnum(builder, self.fooEnum)
|
||||
TableInFirstNSAddFooUnionType(builder, self.fooUnionType)
|
||||
if self.fooUnion is not None:
|
||||
TableInFirstNSAddFooUnion(builder, fooUnion)
|
||||
if self.fooStruct is not None:
|
||||
fooStruct = self.fooStruct.Pack(builder)
|
||||
TableInFirstNSAddFooStruct(builder, fooStruct)
|
||||
tableInFirstNS = TableInFirstNSEnd(builder)
|
||||
return tableInFirstNS
|
||||
# TableInFirstNST
|
||||
def Pack(self, builder):
|
||||
if self.fooTable is not None:
|
||||
fooTable = self.fooTable.Pack(builder)
|
||||
if self.fooUnion is not None:
|
||||
fooUnion = self.fooUnion.Pack(builder)
|
||||
TableInFirstNSStart(builder)
|
||||
if self.fooTable is not None:
|
||||
TableInFirstNSAddFooTable(builder, fooTable)
|
||||
TableInFirstNSAddFooEnum(builder, self.fooEnum)
|
||||
TableInFirstNSAddFooUnionType(builder, self.fooUnionType)
|
||||
if self.fooUnion is not None:
|
||||
TableInFirstNSAddFooUnion(builder, fooUnion)
|
||||
if self.fooStruct is not None:
|
||||
fooStruct = self.fooStruct.Pack(builder)
|
||||
TableInFirstNSAddFooStruct(builder, fooStruct)
|
||||
tableInFirstNS = TableInFirstNSEnd(builder)
|
||||
return tableInFirstNS
|
||||
|
||||
@@ -2,10 +2,9 @@
|
||||
|
||||
package NamespaceA;
|
||||
|
||||
import java.nio.*;
|
||||
import java.lang.*;
|
||||
import java.util.*;
|
||||
import com.google.flatbuffers.*;
|
||||
import java.nio.*;
|
||||
import java.util.*;
|
||||
|
||||
public class TableInFirstNST {
|
||||
private NamespaceA.NamespaceB.TableInNestedNST fooTable;
|
||||
@@ -13,22 +12,37 @@ public class TableInFirstNST {
|
||||
private NamespaceA.NamespaceB.UnionInNestedNSUnion fooUnion;
|
||||
private NamespaceA.NamespaceB.StructInNestedNST fooStruct;
|
||||
|
||||
public NamespaceA.NamespaceB.TableInNestedNST getFooTable() { return fooTable; }
|
||||
public NamespaceA.NamespaceB.TableInNestedNST getFooTable() {
|
||||
return fooTable;
|
||||
}
|
||||
|
||||
public void setFooTable(NamespaceA.NamespaceB.TableInNestedNST fooTable) { this.fooTable = fooTable; }
|
||||
public void setFooTable(NamespaceA.NamespaceB.TableInNestedNST fooTable) {
|
||||
this.fooTable = fooTable;
|
||||
}
|
||||
|
||||
public byte getFooEnum() { return fooEnum; }
|
||||
public byte getFooEnum() {
|
||||
return fooEnum;
|
||||
}
|
||||
|
||||
public void setFooEnum(byte fooEnum) { this.fooEnum = fooEnum; }
|
||||
public void setFooEnum(byte fooEnum) {
|
||||
this.fooEnum = fooEnum;
|
||||
}
|
||||
|
||||
public NamespaceA.NamespaceB.UnionInNestedNSUnion getFooUnion() { return fooUnion; }
|
||||
public NamespaceA.NamespaceB.UnionInNestedNSUnion getFooUnion() {
|
||||
return fooUnion;
|
||||
}
|
||||
|
||||
public void setFooUnion(NamespaceA.NamespaceB.UnionInNestedNSUnion fooUnion) { this.fooUnion = fooUnion; }
|
||||
public void setFooUnion(NamespaceA.NamespaceB.UnionInNestedNSUnion fooUnion) {
|
||||
this.fooUnion = fooUnion;
|
||||
}
|
||||
|
||||
public NamespaceA.NamespaceB.StructInNestedNST getFooStruct() { return fooStruct; }
|
||||
|
||||
public void setFooStruct(NamespaceA.NamespaceB.StructInNestedNST fooStruct) { this.fooStruct = fooStruct; }
|
||||
public NamespaceA.NamespaceB.StructInNestedNST getFooStruct() {
|
||||
return fooStruct;
|
||||
}
|
||||
|
||||
public void setFooStruct(NamespaceA.NamespaceB.StructInNestedNST fooStruct) {
|
||||
this.fooStruct = fooStruct;
|
||||
}
|
||||
|
||||
public TableInFirstNST() {
|
||||
this.fooTable = null;
|
||||
@@ -37,4 +51,3 @@ public class TableInFirstNST {
|
||||
this.fooStruct = new NamespaceA.NamespaceB.StructInNestedNST();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,9 @@ type TableInCT struct {
|
||||
}
|
||||
|
||||
func (t *TableInCT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
|
||||
if t == nil { return 0 }
|
||||
if t == nil {
|
||||
return 0
|
||||
}
|
||||
referToA1Offset := t.ReferToA1.Pack(builder)
|
||||
referToA2Offset := t.ReferToA2.Pack(builder)
|
||||
TableInCStart(builder)
|
||||
@@ -29,7 +31,9 @@ func (rcv *TableInC) UnPackTo(t *TableInCT) {
|
||||
}
|
||||
|
||||
func (rcv *TableInC) UnPack() *TableInCT {
|
||||
if rcv == nil { return nil }
|
||||
if rcv == nil {
|
||||
return nil
|
||||
}
|
||||
t := &TableInCT{}
|
||||
rcv.UnPackTo(t)
|
||||
return t
|
||||
|
||||
@@ -2,66 +2,111 @@
|
||||
|
||||
package NamespaceC;
|
||||
|
||||
import java.nio.*;
|
||||
import java.lang.*;
|
||||
import java.util.*;
|
||||
import com.google.flatbuffers.*;
|
||||
import java.nio.*;
|
||||
import java.util.*;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public final class TableInC extends Table {
|
||||
public static void ValidateVersion() { Constants.FLATBUFFERS_25_2_10(); }
|
||||
public static TableInC getRootAsTableInC(ByteBuffer _bb) { return getRootAsTableInC(_bb, new TableInC()); }
|
||||
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 static void ValidateVersion() {
|
||||
Constants.FLATBUFFERS_25_2_10();
|
||||
}
|
||||
|
||||
public NamespaceA.TableInFirstNS referToA1() { return referToA1(new NamespaceA.TableInFirstNS()); }
|
||||
public NamespaceA.TableInFirstNS referToA1(NamespaceA.TableInFirstNS obj) { int o = __offset(4); return o != 0 ? obj.__assign(__indirect(o + bb_pos), bb) : null; }
|
||||
public NamespaceA.SecondTableInA referToA2() { return referToA2(new NamespaceA.SecondTableInA()); }
|
||||
public NamespaceA.SecondTableInA referToA2(NamespaceA.SecondTableInA obj) { int o = __offset(6); return o != 0 ? obj.__assign(__indirect(o + bb_pos), bb) : null; }
|
||||
public static TableInC getRootAsTableInC(ByteBuffer _bb) {
|
||||
return getRootAsTableInC(_bb, new TableInC());
|
||||
}
|
||||
|
||||
public static int createTableInC(FlatBufferBuilder builder,
|
||||
int referToA1Offset,
|
||||
int referToA2Offset) {
|
||||
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());
|
||||
}
|
||||
|
||||
public NamespaceA.TableInFirstNS referToA1(NamespaceA.TableInFirstNS obj) {
|
||||
int o = __offset(4);
|
||||
return o != 0 ? obj.__assign(__indirect(o + bb_pos), bb) : null;
|
||||
}
|
||||
|
||||
public NamespaceA.SecondTableInA referToA2() {
|
||||
return referToA2(new NamespaceA.SecondTableInA());
|
||||
}
|
||||
|
||||
public NamespaceA.SecondTableInA referToA2(NamespaceA.SecondTableInA obj) {
|
||||
int o = __offset(6);
|
||||
return o != 0 ? obj.__assign(__indirect(o + bb_pos), bb) : null;
|
||||
}
|
||||
|
||||
public static int createTableInC(
|
||||
FlatBufferBuilder builder, int referToA1Offset, int referToA2Offset) {
|
||||
builder.startTable(2);
|
||||
TableInC.addReferToA2(builder, referToA2Offset);
|
||||
TableInC.addReferToA1(builder, referToA1Offset);
|
||||
return TableInC.endTableInC(builder);
|
||||
}
|
||||
|
||||
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 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.endTable();
|
||||
return o;
|
||||
}
|
||||
|
||||
public static final class Vector extends BaseVector {
|
||||
public Vector __assign(int _vector, int _element_size, ByteBuffer _bb) { __reset(_vector, _element_size, _bb); return this; }
|
||||
public Vector __assign(int _vector, int _element_size, ByteBuffer _bb) {
|
||||
__reset(_vector, _element_size, _bb);
|
||||
return this;
|
||||
}
|
||||
|
||||
public TableInC get(int j) { return get(new TableInC(), j); }
|
||||
public TableInC get(TableInC obj, int j) { return obj.__assign(__indirect(__element(j), bb), bb); }
|
||||
public TableInC get(int j) {
|
||||
return get(new TableInC(), j);
|
||||
}
|
||||
|
||||
public TableInC get(TableInC obj, int j) {
|
||||
return obj.__assign(__indirect(__element(j), bb), bb);
|
||||
}
|
||||
}
|
||||
|
||||
public TableInCT unpack() {
|
||||
TableInCT _o = new TableInCT();
|
||||
unpackTo(_o);
|
||||
return _o;
|
||||
}
|
||||
|
||||
public void unpackTo(TableInCT _o) {
|
||||
if (referToA1() != null) _o.setReferToA1(referToA1().unpack());
|
||||
else _o.setReferToA1(null);
|
||||
if (referToA2() != null) _o.setReferToA2(referToA2().unpack());
|
||||
else _o.setReferToA2(null);
|
||||
}
|
||||
|
||||
public static int pack(FlatBufferBuilder builder, TableInCT _o) {
|
||||
if (_o == null) return 0;
|
||||
int _refer_to_a1 = _o.getReferToA1() == null ? 0 : NamespaceA.TableInFirstNS.pack(builder, _o.getReferToA1());
|
||||
int _refer_to_a2 = _o.getReferToA2() == null ? 0 : NamespaceA.SecondTableInA.pack(builder, _o.getReferToA2());
|
||||
return createTableInC(
|
||||
builder,
|
||||
_refer_to_a1,
|
||||
_refer_to_a2);
|
||||
int _refer_to_a1 =
|
||||
_o.getReferToA1() == null ? 0 : NamespaceA.TableInFirstNS.pack(builder, _o.getReferToA1());
|
||||
int _refer_to_a2 =
|
||||
_o.getReferToA2() == null ? 0 : NamespaceA.SecondTableInA.pack(builder, _o.getReferToA2());
|
||||
return createTableInC(builder, _refer_to_a1, _refer_to_a2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,70 +2,81 @@
|
||||
|
||||
package NamespaceC
|
||||
|
||||
import com.google.flatbuffers.BaseVector
|
||||
import com.google.flatbuffers.BooleanVector
|
||||
import com.google.flatbuffers.ByteVector
|
||||
import com.google.flatbuffers.Constants
|
||||
import com.google.flatbuffers.DoubleVector
|
||||
import com.google.flatbuffers.FlatBufferBuilder
|
||||
import com.google.flatbuffers.FloatVector
|
||||
import com.google.flatbuffers.LongVector
|
||||
import com.google.flatbuffers.StringVector
|
||||
import com.google.flatbuffers.Struct
|
||||
import com.google.flatbuffers.Table
|
||||
import com.google.flatbuffers.UnionVector
|
||||
import java.nio.ByteBuffer
|
||||
import java.nio.ByteOrder
|
||||
import kotlin.math.sign
|
||||
|
||||
@Suppress("unused")
|
||||
@ExperimentalUnsignedTypes
|
||||
class TableInC : Table() {
|
||||
|
||||
fun __init(_i: Int, _bb: ByteBuffer) {
|
||||
__reset(_i, _bb)
|
||||
fun __init(_i: Int, _bb: ByteBuffer) {
|
||||
__reset(_i, _bb)
|
||||
}
|
||||
|
||||
fun __assign(_i: Int, _bb: ByteBuffer): TableInC {
|
||||
__init(_i, _bb)
|
||||
return this
|
||||
}
|
||||
|
||||
val referToA1: NamespaceA.TableInFirstNS?
|
||||
get() = referToA1(NamespaceA.TableInFirstNS())
|
||||
|
||||
fun referToA1(obj: NamespaceA.TableInFirstNS): NamespaceA.TableInFirstNS? {
|
||||
val o = __offset(4)
|
||||
return if (o != 0) {
|
||||
obj.__assign(__indirect(o + bb_pos), bb)
|
||||
} else {
|
||||
null
|
||||
}
|
||||
fun __assign(_i: Int, _bb: ByteBuffer) : TableInC {
|
||||
__init(_i, _bb)
|
||||
return this
|
||||
}
|
||||
|
||||
val referToA2: NamespaceA.SecondTableInA?
|
||||
get() = referToA2(NamespaceA.SecondTableInA())
|
||||
|
||||
fun referToA2(obj: NamespaceA.SecondTableInA): NamespaceA.SecondTableInA? {
|
||||
val o = __offset(6)
|
||||
return if (o != 0) {
|
||||
obj.__assign(__indirect(o + bb_pos), bb)
|
||||
} else {
|
||||
null
|
||||
}
|
||||
val referToA1 : NamespaceA.TableInFirstNS? get() = referToA1(NamespaceA.TableInFirstNS())
|
||||
fun referToA1(obj: NamespaceA.TableInFirstNS) : NamespaceA.TableInFirstNS? {
|
||||
val o = __offset(4)
|
||||
return if (o != 0) {
|
||||
obj.__assign(__indirect(o + bb_pos), bb)
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun validateVersion() = Constants.FLATBUFFERS_25_2_10()
|
||||
|
||||
fun getRootAsTableInC(_bb: ByteBuffer): TableInC = getRootAsTableInC(_bb, TableInC())
|
||||
|
||||
fun getRootAsTableInC(_bb: ByteBuffer, obj: TableInC): TableInC {
|
||||
_bb.order(ByteOrder.LITTLE_ENDIAN)
|
||||
return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb))
|
||||
}
|
||||
val referToA2 : NamespaceA.SecondTableInA? get() = referToA2(NamespaceA.SecondTableInA())
|
||||
fun referToA2(obj: NamespaceA.SecondTableInA) : NamespaceA.SecondTableInA? {
|
||||
val o = __offset(6)
|
||||
return if (o != 0) {
|
||||
obj.__assign(__indirect(o + bb_pos), bb)
|
||||
} else {
|
||||
null
|
||||
}
|
||||
|
||||
fun createTableInC(
|
||||
builder: FlatBufferBuilder,
|
||||
referToA1Offset: Int,
|
||||
referToA2Offset: Int,
|
||||
): Int {
|
||||
builder.startTable(2)
|
||||
addReferToA2(builder, referToA2Offset)
|
||||
addReferToA1(builder, referToA1Offset)
|
||||
return endTableInC(builder)
|
||||
}
|
||||
companion object {
|
||||
fun validateVersion() = Constants.FLATBUFFERS_25_2_10()
|
||||
fun getRootAsTableInC(_bb: ByteBuffer): TableInC = getRootAsTableInC(_bb, TableInC())
|
||||
fun getRootAsTableInC(_bb: ByteBuffer, obj: TableInC): TableInC {
|
||||
_bb.order(ByteOrder.LITTLE_ENDIAN)
|
||||
return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb))
|
||||
}
|
||||
fun createTableInC(builder: FlatBufferBuilder, referToA1Offset: Int, referToA2Offset: Int) : Int {
|
||||
builder.startTable(2)
|
||||
addReferToA2(builder, referToA2Offset)
|
||||
addReferToA1(builder, referToA1Offset)
|
||||
return endTableInC(builder)
|
||||
}
|
||||
fun startTableInC(builder: FlatBufferBuilder) = builder.startTable(2)
|
||||
fun addReferToA1(builder: FlatBufferBuilder, referToA1: Int) = builder.addOffset(0, referToA1, 0)
|
||||
fun addReferToA2(builder: FlatBufferBuilder, referToA2: Int) = builder.addOffset(1, referToA2, 0)
|
||||
fun endTableInC(builder: FlatBufferBuilder) : Int {
|
||||
val o = builder.endTable()
|
||||
return o
|
||||
}
|
||||
|
||||
fun startTableInC(builder: FlatBufferBuilder) = builder.startTable(2)
|
||||
|
||||
fun addReferToA1(builder: FlatBufferBuilder, referToA1: Int) =
|
||||
builder.addOffset(0, referToA1, 0)
|
||||
|
||||
fun addReferToA2(builder: FlatBufferBuilder, referToA2: Int) =
|
||||
builder.addOffset(1, referToA2, 0)
|
||||
|
||||
fun endTableInC(builder: FlatBufferBuilder): Int {
|
||||
val o = builder.endTable()
|
||||
return o
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,101 +4,130 @@
|
||||
|
||||
import flatbuffers
|
||||
from flatbuffers.compat import import_numpy
|
||||
|
||||
np = import_numpy()
|
||||
|
||||
|
||||
class TableInC(object):
|
||||
__slots__ = ['_tab']
|
||||
__slots__ = ['_tab']
|
||||
|
||||
@classmethod
|
||||
def GetRootAs(cls, buf, offset=0):
|
||||
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
||||
x = TableInC()
|
||||
x.Init(buf, n + offset)
|
||||
return x
|
||||
@classmethod
|
||||
def GetRootAs(cls, buf, offset=0):
|
||||
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
||||
x = TableInC()
|
||||
x.Init(buf, n + offset)
|
||||
return x
|
||||
|
||||
@classmethod
|
||||
def GetRootAsTableInC(cls, buf, offset=0):
|
||||
"""This method is deprecated. Please switch to GetRootAs."""
|
||||
return cls.GetRootAs(buf, offset)
|
||||
# TableInC
|
||||
def Init(self, buf, pos):
|
||||
self._tab = flatbuffers.table.Table(buf, pos)
|
||||
@classmethod
|
||||
def GetRootAsTableInC(cls, buf, offset=0):
|
||||
"""This method is deprecated. Please switch to GetRootAs."""
|
||||
return cls.GetRootAs(buf, offset)
|
||||
|
||||
# TableInC
|
||||
def ReferToA1(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
||||
if o != 0:
|
||||
x = self._tab.Indirect(o + self._tab.Pos)
|
||||
obj = TableInFirstNS()
|
||||
obj.Init(self._tab.Bytes, x)
|
||||
return obj
|
||||
return None
|
||||
# TableInC
|
||||
def Init(self, buf, pos):
|
||||
self._tab = flatbuffers.table.Table(buf, pos)
|
||||
|
||||
# TableInC
|
||||
def ReferToA1(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
||||
if o != 0:
|
||||
x = self._tab.Indirect(o + self._tab.Pos)
|
||||
obj = TableInFirstNS()
|
||||
obj.Init(self._tab.Bytes, x)
|
||||
return obj
|
||||
return None
|
||||
|
||||
# TableInC
|
||||
def ReferToA2(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
||||
if o != 0:
|
||||
x = self._tab.Indirect(o + self._tab.Pos)
|
||||
obj = SecondTableInA()
|
||||
obj.Init(self._tab.Bytes, x)
|
||||
return obj
|
||||
return None
|
||||
|
||||
|
||||
def TableInCStart(builder):
|
||||
builder.StartObject(2)
|
||||
|
||||
# TableInC
|
||||
def ReferToA2(self):
|
||||
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
||||
if o != 0:
|
||||
x = self._tab.Indirect(o + self._tab.Pos)
|
||||
obj = SecondTableInA()
|
||||
obj.Init(self._tab.Bytes, x)
|
||||
return obj
|
||||
return None
|
||||
|
||||
def TableInCStart(builder): builder.StartObject(2)
|
||||
def Start(builder):
|
||||
return TableInCStart(builder)
|
||||
def TableInCAddReferToA1(builder, referToA1): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(referToA1), 0)
|
||||
return TableInCStart(builder)
|
||||
|
||||
|
||||
def TableInCAddReferToA1(builder, referToA1):
|
||||
builder.PrependUOffsetTRelativeSlot(
|
||||
0, flatbuffers.number_types.UOffsetTFlags.py_type(referToA1), 0
|
||||
)
|
||||
|
||||
|
||||
def AddReferToA1(builder, referToA1):
|
||||
return TableInCAddReferToA1(builder, referToA1)
|
||||
def TableInCAddReferToA2(builder, referToA2): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(referToA2), 0)
|
||||
return TableInCAddReferToA1(builder, referToA1)
|
||||
|
||||
|
||||
def TableInCAddReferToA2(builder, referToA2):
|
||||
builder.PrependUOffsetTRelativeSlot(
|
||||
1, flatbuffers.number_types.UOffsetTFlags.py_type(referToA2), 0
|
||||
)
|
||||
|
||||
|
||||
def AddReferToA2(builder, referToA2):
|
||||
return TableInCAddReferToA2(builder, referToA2)
|
||||
def TableInCEnd(builder): return builder.EndObject()
|
||||
return TableInCAddReferToA2(builder, referToA2)
|
||||
|
||||
|
||||
def TableInCEnd(builder):
|
||||
return builder.EndObject()
|
||||
|
||||
|
||||
def End(builder):
|
||||
return TableInCEnd(builder)
|
||||
return TableInCEnd(builder)
|
||||
|
||||
|
||||
try:
|
||||
from typing import Optional
|
||||
from typing import Optional
|
||||
except:
|
||||
pass
|
||||
pass
|
||||
|
||||
|
||||
class TableInCT(object):
|
||||
|
||||
# TableInCT
|
||||
def __init__(self):
|
||||
self.referToA1 = None # type: Optional[TableInFirstNST]
|
||||
self.referToA2 = None # type: Optional[SecondTableInAT]
|
||||
# TableInCT
|
||||
def __init__(self):
|
||||
self.referToA1 = None # type: Optional[TableInFirstNST]
|
||||
self.referToA2 = None # type: Optional[SecondTableInAT]
|
||||
|
||||
@classmethod
|
||||
def InitFromBuf(cls, buf, pos):
|
||||
tableInC = TableInC()
|
||||
tableInC.Init(buf, pos)
|
||||
return cls.InitFromObj(tableInC)
|
||||
@classmethod
|
||||
def InitFromBuf(cls, buf, pos):
|
||||
tableInC = TableInC()
|
||||
tableInC.Init(buf, pos)
|
||||
return cls.InitFromObj(tableInC)
|
||||
|
||||
@classmethod
|
||||
def InitFromObj(cls, tableInC):
|
||||
x = TableInCT()
|
||||
x._UnPack(tableInC)
|
||||
return x
|
||||
@classmethod
|
||||
def InitFromObj(cls, tableInC):
|
||||
x = TableInCT()
|
||||
x._UnPack(tableInC)
|
||||
return x
|
||||
|
||||
# TableInCT
|
||||
def _UnPack(self, tableInC):
|
||||
if tableInC is None:
|
||||
return
|
||||
if tableInC.ReferToA1() is not None:
|
||||
self.referToA1 = TableInFirstNST.InitFromObj(tableInC.ReferToA1())
|
||||
if tableInC.ReferToA2() is not None:
|
||||
self.referToA2 = SecondTableInAT.InitFromObj(tableInC.ReferToA2())
|
||||
# TableInCT
|
||||
def _UnPack(self, tableInC):
|
||||
if tableInC is None:
|
||||
return
|
||||
if tableInC.ReferToA1() is not None:
|
||||
self.referToA1 = TableInFirstNST.InitFromObj(tableInC.ReferToA1())
|
||||
if tableInC.ReferToA2() is not None:
|
||||
self.referToA2 = SecondTableInAT.InitFromObj(tableInC.ReferToA2())
|
||||
|
||||
# TableInCT
|
||||
def Pack(self, builder):
|
||||
if self.referToA1 is not None:
|
||||
referToA1 = self.referToA1.Pack(builder)
|
||||
if self.referToA2 is not None:
|
||||
referToA2 = self.referToA2.Pack(builder)
|
||||
TableInCStart(builder)
|
||||
if self.referToA1 is not None:
|
||||
TableInCAddReferToA1(builder, referToA1)
|
||||
if self.referToA2 is not None:
|
||||
TableInCAddReferToA2(builder, referToA2)
|
||||
tableInC = TableInCEnd(builder)
|
||||
return tableInC
|
||||
# TableInCT
|
||||
def Pack(self, builder):
|
||||
if self.referToA1 is not None:
|
||||
referToA1 = self.referToA1.Pack(builder)
|
||||
if self.referToA2 is not None:
|
||||
referToA2 = self.referToA2.Pack(builder)
|
||||
TableInCStart(builder)
|
||||
if self.referToA1 is not None:
|
||||
TableInCAddReferToA1(builder, referToA1)
|
||||
if self.referToA2 is not None:
|
||||
TableInCAddReferToA2(builder, referToA2)
|
||||
tableInC = TableInCEnd(builder)
|
||||
return tableInC
|
||||
|
||||
@@ -2,27 +2,32 @@
|
||||
|
||||
package NamespaceC;
|
||||
|
||||
import java.nio.*;
|
||||
import java.lang.*;
|
||||
import java.util.*;
|
||||
import com.google.flatbuffers.*;
|
||||
import java.nio.*;
|
||||
import java.util.*;
|
||||
|
||||
public class TableInCT {
|
||||
private NamespaceA.TableInFirstNST referToA1;
|
||||
private NamespaceA.SecondTableInAT referToA2;
|
||||
|
||||
public NamespaceA.TableInFirstNST getReferToA1() { return referToA1; }
|
||||
public NamespaceA.TableInFirstNST getReferToA1() {
|
||||
return referToA1;
|
||||
}
|
||||
|
||||
public void setReferToA1(NamespaceA.TableInFirstNST referToA1) { this.referToA1 = referToA1; }
|
||||
public void setReferToA1(NamespaceA.TableInFirstNST referToA1) {
|
||||
this.referToA1 = referToA1;
|
||||
}
|
||||
|
||||
public NamespaceA.SecondTableInAT getReferToA2() { return referToA2; }
|
||||
|
||||
public void setReferToA2(NamespaceA.SecondTableInAT referToA2) { this.referToA2 = referToA2; }
|
||||
public NamespaceA.SecondTableInAT getReferToA2() {
|
||||
return referToA2;
|
||||
}
|
||||
|
||||
public void setReferToA2(NamespaceA.SecondTableInAT referToA2) {
|
||||
this.referToA2 = referToA2;
|
||||
}
|
||||
|
||||
public TableInCT() {
|
||||
this.referToA1 = null;
|
||||
this.referToA2 = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
library namespace_a.namespace_b;
|
||||
|
||||
import 'dart:typed_data' show Uint8List;
|
||||
import 'package:flat_buffers/flat_buffers.dart' as fb;
|
||||
|
||||
import 'package:flat_buffers/flat_buffers.dart' as fb;
|
||||
|
||||
class UnionInNestedNSTypeId {
|
||||
final int value;
|
||||
@@ -14,12 +14,14 @@ class UnionInNestedNSTypeId {
|
||||
factory UnionInNestedNSTypeId.fromValue(int value) {
|
||||
final result = values[value];
|
||||
if (result == null) {
|
||||
throw StateError('Invalid value $value for bit flag enum UnionInNestedNSTypeId');
|
||||
throw StateError(
|
||||
'Invalid value $value for bit flag enum UnionInNestedNSTypeId',
|
||||
);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static UnionInNestedNSTypeId? _createOrNull(int? value) =>
|
||||
static UnionInNestedNSTypeId? _createOrNull(int? value) =>
|
||||
value == null ? null : UnionInNestedNSTypeId.fromValue(value);
|
||||
|
||||
static const int minValue = 0;
|
||||
@@ -27,12 +29,16 @@ class UnionInNestedNSTypeId {
|
||||
static bool containsValue(int value) => values.containsKey(value);
|
||||
|
||||
static const UnionInNestedNSTypeId NONE = UnionInNestedNSTypeId._(0);
|
||||
static const UnionInNestedNSTypeId TableInNestedNS = UnionInNestedNSTypeId._(1);
|
||||
static const UnionInNestedNSTypeId TableInNestedNS = UnionInNestedNSTypeId._(
|
||||
1,
|
||||
);
|
||||
static const Map<int, UnionInNestedNSTypeId> values = {
|
||||
0: NONE,
|
||||
1: TableInNestedNS};
|
||||
1: TableInNestedNS,
|
||||
};
|
||||
|
||||
static const fb.Reader<UnionInNestedNSTypeId> reader = _UnionInNestedNSTypeIdReader();
|
||||
static const fb.Reader<UnionInNestedNSTypeId> reader =
|
||||
_UnionInNestedNSTypeIdReader();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
@@ -63,7 +69,7 @@ class EnumInNestedNS {
|
||||
return result;
|
||||
}
|
||||
|
||||
static EnumInNestedNS? _createOrNull(int? value) =>
|
||||
static EnumInNestedNS? _createOrNull(int? value) =>
|
||||
value == null ? null : EnumInNestedNS.fromValue(value);
|
||||
|
||||
static const int minValue = 0;
|
||||
@@ -73,10 +79,7 @@ class EnumInNestedNS {
|
||||
static const EnumInNestedNS A = EnumInNestedNS._(0);
|
||||
static const EnumInNestedNS B = EnumInNestedNS._(1);
|
||||
static const EnumInNestedNS C = EnumInNestedNS._(2);
|
||||
static const Map<int, EnumInNestedNS> values = {
|
||||
0: A,
|
||||
1: B,
|
||||
2: C};
|
||||
static const Map<int, EnumInNestedNS> values = {0: A, 1: B, 2: C};
|
||||
|
||||
static const fb.Reader<EnumInNestedNS> reader = _EnumInNestedNSReader();
|
||||
|
||||
@@ -116,8 +119,7 @@ class TableInNestedNS {
|
||||
return 'TableInNestedNS{foo: $foo}';
|
||||
}
|
||||
|
||||
TableInNestedNST unpack() => TableInNestedNST(
|
||||
foo: foo);
|
||||
TableInNestedNST unpack() => TableInNestedNST(foo: foo);
|
||||
|
||||
static int pack(fb.Builder fbBuilder, TableInNestedNST? object) {
|
||||
if (object == null) return 0;
|
||||
@@ -128,8 +130,7 @@ class TableInNestedNS {
|
||||
class TableInNestedNST implements fb.Packable {
|
||||
int foo;
|
||||
|
||||
TableInNestedNST({
|
||||
this.foo = 0});
|
||||
TableInNestedNST({this.foo = 0});
|
||||
|
||||
@override
|
||||
int pack(fb.Builder fbBuilder) {
|
||||
@@ -148,8 +149,8 @@ class _TableInNestedNSReader extends fb.TableReader<TableInNestedNS> {
|
||||
const _TableInNestedNSReader();
|
||||
|
||||
@override
|
||||
TableInNestedNS createObject(fb.BufferContext bc, int offset) =>
|
||||
TableInNestedNS._(bc, offset);
|
||||
TableInNestedNS createObject(fb.BufferContext bc, int offset) =>
|
||||
TableInNestedNS._(bc, offset);
|
||||
}
|
||||
|
||||
class TableInNestedNSBuilder {
|
||||
@@ -174,10 +175,7 @@ class TableInNestedNSBuilder {
|
||||
class TableInNestedNSObjectBuilder extends fb.ObjectBuilder {
|
||||
final int? _foo;
|
||||
|
||||
TableInNestedNSObjectBuilder({
|
||||
int? foo,
|
||||
})
|
||||
: _foo = foo;
|
||||
TableInNestedNSObjectBuilder({int? foo}) : _foo = foo;
|
||||
|
||||
/// Finish building, and store into the [fbBuilder].
|
||||
@override
|
||||
@@ -195,6 +193,7 @@ class TableInNestedNSObjectBuilder extends fb.ObjectBuilder {
|
||||
return fbBuilder.buffer;
|
||||
}
|
||||
}
|
||||
|
||||
class StructInNestedNS {
|
||||
StructInNestedNS._(this._bc, this._bcOffset);
|
||||
|
||||
@@ -211,9 +210,7 @@ class StructInNestedNS {
|
||||
return 'StructInNestedNS{a: $a, b: $b}';
|
||||
}
|
||||
|
||||
StructInNestedNST unpack() => StructInNestedNST(
|
||||
a: a,
|
||||
b: b);
|
||||
StructInNestedNST unpack() => StructInNestedNST(a: a, b: b);
|
||||
|
||||
static int pack(fb.Builder fbBuilder, StructInNestedNST? object) {
|
||||
if (object == null) return 0;
|
||||
@@ -225,9 +222,7 @@ class StructInNestedNST implements fb.Packable {
|
||||
int a;
|
||||
int b;
|
||||
|
||||
StructInNestedNST({
|
||||
required this.a,
|
||||
required this.b});
|
||||
StructInNestedNST({required this.a, required this.b});
|
||||
|
||||
@override
|
||||
int pack(fb.Builder fbBuilder) {
|
||||
@@ -249,8 +244,8 @@ class _StructInNestedNSReader extends fb.StructReader<StructInNestedNS> {
|
||||
int get size => 8;
|
||||
|
||||
@override
|
||||
StructInNestedNS createObject(fb.BufferContext bc, int offset) =>
|
||||
StructInNestedNS._(bc, offset);
|
||||
StructInNestedNS createObject(fb.BufferContext bc, int offset) =>
|
||||
StructInNestedNS._(bc, offset);
|
||||
}
|
||||
|
||||
class StructInNestedNSBuilder {
|
||||
@@ -263,19 +258,15 @@ class StructInNestedNSBuilder {
|
||||
fbBuilder.putInt32(a);
|
||||
return fbBuilder.offset;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class StructInNestedNSObjectBuilder extends fb.ObjectBuilder {
|
||||
final int _a;
|
||||
final int _b;
|
||||
|
||||
StructInNestedNSObjectBuilder({
|
||||
required int a,
|
||||
required int b,
|
||||
})
|
||||
: _a = a,
|
||||
_b = b;
|
||||
StructInNestedNSObjectBuilder({required int a, required int b})
|
||||
: _a = a,
|
||||
_b = b;
|
||||
|
||||
/// Finish building, and store into the [fbBuilder].
|
||||
@override
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
library namespace_a;
|
||||
|
||||
import 'dart:typed_data' show Uint8List;
|
||||
|
||||
import 'package:flat_buffers/flat_buffers.dart' as fb;
|
||||
|
||||
import './namespace_test2_namespace_c_generated.dart' as namespace_c;
|
||||
@@ -20,16 +21,34 @@ class TableInFirstNS {
|
||||
final fb.BufferContext _bc;
|
||||
final int _bcOffset;
|
||||
|
||||
namespace_a_namespace_b.TableInNestedNS? get fooTable => namespace_a_namespace_b.TableInNestedNS.reader.vTableGetNullable(_bc, _bcOffset, 4);
|
||||
EnumInNestedNS get fooEnum => EnumInNestedNS.fromValue(const fb.Int8Reader().vTableGet(_bc, _bcOffset, 6, 0));
|
||||
UnionInNestedNSTypeId? get fooUnionType => UnionInNestedNSTypeId._createOrNull(const fb.Uint8Reader().vTableGetNullable(_bc, _bcOffset, 8));
|
||||
namespace_a_namespace_b.TableInNestedNS? get fooTable =>
|
||||
namespace_a_namespace_b.TableInNestedNS.reader.vTableGetNullable(
|
||||
_bc,
|
||||
_bcOffset,
|
||||
4,
|
||||
);
|
||||
EnumInNestedNS get fooEnum => EnumInNestedNS.fromValue(
|
||||
const fb.Int8Reader().vTableGet(_bc, _bcOffset, 6, 0),
|
||||
);
|
||||
UnionInNestedNSTypeId? get fooUnionType =>
|
||||
UnionInNestedNSTypeId._createOrNull(
|
||||
const fb.Uint8Reader().vTableGetNullable(_bc, _bcOffset, 8),
|
||||
);
|
||||
dynamic get fooUnion {
|
||||
switch (fooUnionType?.value) {
|
||||
case 1: return TableInNestedNS.reader.vTableGetNullable(_bc, _bcOffset, 10);
|
||||
default: return null;
|
||||
case 1:
|
||||
return TableInNestedNS.reader.vTableGetNullable(_bc, _bcOffset, 10);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
namespace_a_namespace_b.StructInNestedNS? get fooStruct => namespace_a_namespace_b.StructInNestedNS.reader.vTableGetNullable(_bc, _bcOffset, 12);
|
||||
|
||||
namespace_a_namespace_b.StructInNestedNS? get fooStruct =>
|
||||
namespace_a_namespace_b.StructInNestedNS.reader.vTableGetNullable(
|
||||
_bc,
|
||||
_bcOffset,
|
||||
12,
|
||||
);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
@@ -37,11 +56,12 @@ class TableInFirstNS {
|
||||
}
|
||||
|
||||
TableInFirstNST unpack() => TableInFirstNST(
|
||||
fooTable: fooTable?.unpack(),
|
||||
fooEnum: fooEnum,
|
||||
fooUnionType: fooUnionType,
|
||||
fooUnion: fooUnion,
|
||||
fooStruct: fooStruct?.unpack());
|
||||
fooTable: fooTable?.unpack(),
|
||||
fooEnum: fooEnum,
|
||||
fooUnionType: fooUnionType,
|
||||
fooUnion: fooUnion,
|
||||
fooStruct: fooStruct?.unpack(),
|
||||
);
|
||||
|
||||
static int pack(fb.Builder fbBuilder, TableInFirstNST? object) {
|
||||
if (object == null) return 0;
|
||||
@@ -57,11 +77,12 @@ class TableInFirstNST implements fb.Packable {
|
||||
namespace_a_namespace_b.StructInNestedNST? fooStruct;
|
||||
|
||||
TableInFirstNST({
|
||||
this.fooTable,
|
||||
this.fooEnum = EnumInNestedNS.A,
|
||||
this.fooUnionType,
|
||||
this.fooUnion,
|
||||
this.fooStruct});
|
||||
this.fooTable,
|
||||
this.fooEnum = EnumInNestedNS.A,
|
||||
this.fooUnionType,
|
||||
this.fooUnion,
|
||||
this.fooStruct,
|
||||
});
|
||||
|
||||
@override
|
||||
int pack(fb.Builder fbBuilder) {
|
||||
@@ -88,8 +109,8 @@ class _TableInFirstNSReader extends fb.TableReader<TableInFirstNS> {
|
||||
const _TableInFirstNSReader();
|
||||
|
||||
@override
|
||||
TableInFirstNS createObject(fb.BufferContext bc, int offset) =>
|
||||
TableInFirstNS._(bc, offset);
|
||||
TableInFirstNS createObject(fb.BufferContext bc, int offset) =>
|
||||
TableInFirstNS._(bc, offset);
|
||||
}
|
||||
|
||||
class TableInFirstNSBuilder {
|
||||
@@ -105,18 +126,22 @@ class TableInFirstNSBuilder {
|
||||
fbBuilder.addOffset(0, offset);
|
||||
return fbBuilder.offset;
|
||||
}
|
||||
|
||||
int addFooEnum(EnumInNestedNS? fooEnum) {
|
||||
fbBuilder.addInt8(1, fooEnum?.value);
|
||||
return fbBuilder.offset;
|
||||
}
|
||||
|
||||
int addFooUnionType(UnionInNestedNSTypeId? fooUnionType) {
|
||||
fbBuilder.addUint8(2, fooUnionType?.value);
|
||||
return fbBuilder.offset;
|
||||
}
|
||||
|
||||
int addFooUnionOffset(int? offset) {
|
||||
fbBuilder.addOffset(3, offset);
|
||||
return fbBuilder.offset;
|
||||
}
|
||||
|
||||
int addFooStruct(int offset) {
|
||||
fbBuilder.addStruct(4, offset);
|
||||
return fbBuilder.offset;
|
||||
@@ -140,12 +165,11 @@ class TableInFirstNSObjectBuilder extends fb.ObjectBuilder {
|
||||
UnionInNestedNSTypeId? fooUnionType,
|
||||
dynamic fooUnion,
|
||||
namespace_a_namespace_b.StructInNestedNSObjectBuilder? fooStruct,
|
||||
})
|
||||
: _fooTable = fooTable,
|
||||
_fooEnum = fooEnum,
|
||||
_fooUnionType = fooUnionType,
|
||||
_fooUnion = fooUnion,
|
||||
_fooStruct = fooStruct;
|
||||
}) : _fooTable = fooTable,
|
||||
_fooEnum = fooEnum,
|
||||
_fooUnionType = fooUnionType,
|
||||
_fooUnion = fooUnion,
|
||||
_fooStruct = fooStruct;
|
||||
|
||||
/// Finish building, and store into the [fbBuilder].
|
||||
@override
|
||||
@@ -171,6 +195,7 @@ class TableInFirstNSObjectBuilder extends fb.ObjectBuilder {
|
||||
return fbBuilder.buffer;
|
||||
}
|
||||
}
|
||||
|
||||
class SecondTableInA {
|
||||
SecondTableInA._(this._bc, this._bcOffset);
|
||||
factory SecondTableInA(List<int> bytes) {
|
||||
@@ -183,15 +208,15 @@ class SecondTableInA {
|
||||
final fb.BufferContext _bc;
|
||||
final int _bcOffset;
|
||||
|
||||
namespace_c.TableInC? get referToC => namespace_c.TableInC.reader.vTableGetNullable(_bc, _bcOffset, 4);
|
||||
namespace_c.TableInC? get referToC =>
|
||||
namespace_c.TableInC.reader.vTableGetNullable(_bc, _bcOffset, 4);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'SecondTableInA{referToC: $referToC}';
|
||||
}
|
||||
|
||||
SecondTableInAT unpack() => SecondTableInAT(
|
||||
referToC: referToC?.unpack());
|
||||
SecondTableInAT unpack() => SecondTableInAT(referToC: referToC?.unpack());
|
||||
|
||||
static int pack(fb.Builder fbBuilder, SecondTableInAT? object) {
|
||||
if (object == null) return 0;
|
||||
@@ -202,8 +227,7 @@ class SecondTableInA {
|
||||
class SecondTableInAT implements fb.Packable {
|
||||
namespace_c.TableInCT? referToC;
|
||||
|
||||
SecondTableInAT({
|
||||
this.referToC});
|
||||
SecondTableInAT({this.referToC});
|
||||
|
||||
@override
|
||||
int pack(fb.Builder fbBuilder) {
|
||||
@@ -223,8 +247,8 @@ class _SecondTableInAReader extends fb.TableReader<SecondTableInA> {
|
||||
const _SecondTableInAReader();
|
||||
|
||||
@override
|
||||
SecondTableInA createObject(fb.BufferContext bc, int offset) =>
|
||||
SecondTableInA._(bc, offset);
|
||||
SecondTableInA createObject(fb.BufferContext bc, int offset) =>
|
||||
SecondTableInA._(bc, offset);
|
||||
}
|
||||
|
||||
class SecondTableInABuilder {
|
||||
@@ -249,10 +273,8 @@ class SecondTableInABuilder {
|
||||
class SecondTableInAObjectBuilder extends fb.ObjectBuilder {
|
||||
final namespace_c.TableInCObjectBuilder? _referToC;
|
||||
|
||||
SecondTableInAObjectBuilder({
|
||||
namespace_c.TableInCObjectBuilder? referToC,
|
||||
})
|
||||
: _referToC = referToC;
|
||||
SecondTableInAObjectBuilder({namespace_c.TableInCObjectBuilder? referToC})
|
||||
: _referToC = referToC;
|
||||
|
||||
/// Finish building, and store into the [fbBuilder].
|
||||
@override
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
library namespace_c;
|
||||
|
||||
import 'dart:typed_data' show Uint8List;
|
||||
|
||||
import 'package:flat_buffers/flat_buffers.dart' as fb;
|
||||
|
||||
import './namespace_test2_namespace_a_generated.dart' as namespace_a;
|
||||
@@ -20,17 +21,18 @@ class TableInC {
|
||||
final fb.BufferContext _bc;
|
||||
final int _bcOffset;
|
||||
|
||||
namespace_a.TableInFirstNS? get referToA1 => namespace_a.TableInFirstNS.reader.vTableGetNullable(_bc, _bcOffset, 4);
|
||||
namespace_a.SecondTableInA? get referToA2 => namespace_a.SecondTableInA.reader.vTableGetNullable(_bc, _bcOffset, 6);
|
||||
namespace_a.TableInFirstNS? get referToA1 =>
|
||||
namespace_a.TableInFirstNS.reader.vTableGetNullable(_bc, _bcOffset, 4);
|
||||
namespace_a.SecondTableInA? get referToA2 =>
|
||||
namespace_a.SecondTableInA.reader.vTableGetNullable(_bc, _bcOffset, 6);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'TableInC{referToA1: $referToA1, referToA2: $referToA2}';
|
||||
}
|
||||
|
||||
TableInCT unpack() => TableInCT(
|
||||
referToA1: referToA1?.unpack(),
|
||||
referToA2: referToA2?.unpack());
|
||||
TableInCT unpack() =>
|
||||
TableInCT(referToA1: referToA1?.unpack(), referToA2: referToA2?.unpack());
|
||||
|
||||
static int pack(fb.Builder fbBuilder, TableInCT? object) {
|
||||
if (object == null) return 0;
|
||||
@@ -42,9 +44,7 @@ class TableInCT implements fb.Packable {
|
||||
namespace_a.TableInFirstNST? referToA1;
|
||||
namespace_a.SecondTableInAT? referToA2;
|
||||
|
||||
TableInCT({
|
||||
this.referToA1,
|
||||
this.referToA2});
|
||||
TableInCT({this.referToA1, this.referToA2});
|
||||
|
||||
@override
|
||||
int pack(fb.Builder fbBuilder) {
|
||||
@@ -66,8 +66,8 @@ class _TableInCReader extends fb.TableReader<TableInC> {
|
||||
const _TableInCReader();
|
||||
|
||||
@override
|
||||
TableInC createObject(fb.BufferContext bc, int offset) =>
|
||||
TableInC._(bc, offset);
|
||||
TableInC createObject(fb.BufferContext bc, int offset) =>
|
||||
TableInC._(bc, offset);
|
||||
}
|
||||
|
||||
class TableInCBuilder {
|
||||
@@ -83,6 +83,7 @@ class TableInCBuilder {
|
||||
fbBuilder.addOffset(0, offset);
|
||||
return fbBuilder.offset;
|
||||
}
|
||||
|
||||
int addReferToA2Offset(int? offset) {
|
||||
fbBuilder.addOffset(1, offset);
|
||||
return fbBuilder.offset;
|
||||
@@ -100,9 +101,8 @@ class TableInCObjectBuilder extends fb.ObjectBuilder {
|
||||
TableInCObjectBuilder({
|
||||
namespace_a.TableInFirstNSObjectBuilder? referToA1,
|
||||
namespace_a.SecondTableInAObjectBuilder? referToA2,
|
||||
})
|
||||
: _referToA1 = referToA1,
|
||||
_referToA2 = referToA2;
|
||||
}) : _referToA1 = referToA1,
|
||||
_referToA2 = referToA2;
|
||||
|
||||
/// Finish building, and store into the [fbBuilder].
|
||||
@override
|
||||
|
||||
Reference in New Issue
Block a user