Merge commit '0f6aab9da6fe982218a01f4a5b896e65fcced437' as 'third_party/flatbuffers'

This commit is contained in:
Siarhei Fedartsou
2024-06-22 13:33:34 +02:00
1814 changed files with 326902 additions and 0 deletions
@@ -0,0 +1,17 @@
// <auto-generated>
// automatically generated by the FlatBuffers compiler, do not modify
// </auto-generated>
namespace NamespaceA.NamespaceB
{
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
public enum EnumInNestedNS : sbyte
{
A = 0,
B = 1,
C = 2,
};
}
@@ -0,0 +1,32 @@
// Code generated by the FlatBuffers compiler. DO NOT EDIT.
package NamespaceB
import "strconv"
type EnumInNestedNS int8
const (
EnumInNestedNSA EnumInNestedNS = 0
EnumInNestedNSB EnumInNestedNS = 1
EnumInNestedNSC EnumInNestedNS = 2
)
var EnumNamesEnumInNestedNS = map[EnumInNestedNS]string{
EnumInNestedNSA: "A",
EnumInNestedNSB: "B",
EnumInNestedNSC: "C",
}
var EnumValuesEnumInNestedNS = map[string]EnumInNestedNS{
"A": EnumInNestedNSA,
"B": EnumInNestedNSB,
"C": EnumInNestedNSC,
}
func (v EnumInNestedNS) String() string {
if s, ok := EnumNamesEnumInNestedNS[v]; ok {
return s
}
return "EnumInNestedNS(" + strconv.FormatInt(int64(v), 10) + ")"
}
@@ -0,0 +1,16 @@
// automatically generated by the FlatBuffers compiler, do not modify
package NamespaceA.NamespaceB;
@SuppressWarnings("unused")
public final class 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 String name(int e) { return names[e]; }
}
@@ -0,0 +1,15 @@
// automatically generated by the FlatBuffers compiler, do not modify
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]
}
}
@@ -0,0 +1,11 @@
-- automatically generated by the FlatBuffers compiler, do not modify
-- namespace: NamespaceB
local EnumInNestedNS = {
A = 0,
B = 1,
C = 2,
}
return EnumInNestedNS -- return the module
@@ -0,0 +1,25 @@
<?php
// automatically generated by the FlatBuffers compiler, do not modify
namespace NamespaceA\NamespaceB;
class EnumInNestedNS
{
const A = 0;
const B = 1;
const C = 2;
private static $names = array(
EnumInNestedNS::A=>"A",
EnumInNestedNS::B=>"B",
EnumInNestedNS::C=>"C",
);
public static function Name($e)
{
if (!isset(self::$names[$e])) {
throw new \Exception();
}
return self::$names[$e];
}
}
@@ -0,0 +1,8 @@
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: NamespaceB
class EnumInNestedNS(object):
A = 0
B = 1
C = 2
@@ -0,0 +1,62 @@
// <auto-generated>
// automatically generated by the FlatBuffers compiler, do not modify
// </auto-generated>
namespace NamespaceA.NamespaceB
{
using global::System;
using global::System.Collections.Generic;
using global::Google.FlatBuffers;
public struct StructInNestedNS : IFlatbufferObject
{
private Struct __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public void __init(int _i, ByteBuffer _bb) { __p = new Struct(_i, _bb); }
public StructInNestedNS __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public int A { get { return __p.bb.GetInt(__p.bb_pos + 0); } }
public void MutateA(int a) { __p.bb.PutInt(__p.bb_pos + 0, a); }
public int B { get { return __p.bb.GetInt(__p.bb_pos + 4); } }
public void MutateB(int b) { __p.bb.PutInt(__p.bb_pos + 4, b); }
public static Offset<NamespaceA.NamespaceB.StructInNestedNS> CreateStructInNestedNS(FlatBufferBuilder builder, int A, int B) {
builder.Prep(4, 8);
builder.PutInt(B);
builder.PutInt(A);
return new Offset<NamespaceA.NamespaceB.StructInNestedNS>(builder.Offset);
}
public StructInNestedNST UnPack() {
var _o = new StructInNestedNST();
this.UnPackTo(_o);
return _o;
}
public void UnPackTo(StructInNestedNST _o) {
_o.A = this.A;
_o.B = this.B;
}
public static Offset<NamespaceA.NamespaceB.StructInNestedNS> Pack(FlatBufferBuilder builder, StructInNestedNST _o) {
if (_o == null) return default(Offset<NamespaceA.NamespaceB.StructInNestedNS>);
return CreateStructInNestedNS(
builder,
_o.A,
_o.B);
}
}
public class StructInNestedNST
{
[Newtonsoft.Json.JsonProperty("a")]
public int A { get; set; }
[Newtonsoft.Json.JsonProperty("b")]
public int B { get; set; }
public StructInNestedNST() {
this.A = 0;
this.B = 0;
}
}
}
@@ -0,0 +1,62 @@
// Code generated by the FlatBuffers compiler. DO NOT EDIT.
package NamespaceB
import (
flatbuffers "github.com/google/flatbuffers/go"
)
type StructInNestedNST struct {
A int32
B int32
}
func (t *StructInNestedNST) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
if t == nil { return 0 }
return CreateStructInNestedNS(builder, t.A, t.B)
}
func (rcv *StructInNestedNS) UnPackTo(t *StructInNestedNST) {
t.A = rcv.A()
t.B = rcv.B()
}
func (rcv *StructInNestedNS) UnPack() *StructInNestedNST {
if rcv == nil { return nil }
t := &StructInNestedNST{}
rcv.UnPackTo(t)
return t
}
type StructInNestedNS struct {
_tab flatbuffers.Struct
}
func (rcv *StructInNestedNS) Init(buf []byte, i flatbuffers.UOffsetT) {
rcv._tab.Bytes = buf
rcv._tab.Pos = i
}
func (rcv *StructInNestedNS) Table() flatbuffers.Table {
return rcv._tab.Table
}
func (rcv *StructInNestedNS) A() int32 {
return rcv._tab.GetInt32(rcv._tab.Pos + flatbuffers.UOffsetT(0))
}
func (rcv *StructInNestedNS) MutateA(n int32) bool {
return rcv._tab.MutateInt32(rcv._tab.Pos+flatbuffers.UOffsetT(0), n)
}
func (rcv *StructInNestedNS) B() int32 {
return rcv._tab.GetInt32(rcv._tab.Pos + flatbuffers.UOffsetT(4))
}
func (rcv *StructInNestedNS) MutateB(n int32) bool {
return rcv._tab.MutateInt32(rcv._tab.Pos+flatbuffers.UOffsetT(4), n)
}
func CreateStructInNestedNS(builder *flatbuffers.Builder, a int32, b int32) flatbuffers.UOffsetT {
builder.Prep(4, 8)
builder.PrependInt32(b)
builder.PrependInt32(a)
return builder.Offset()
}
@@ -0,0 +1,52 @@
// automatically generated by the FlatBuffers compiler, do not modify
package NamespaceA.NamespaceB;
import java.nio.*;
import java.lang.*;
import java.util.*;
import com.google.flatbuffers.*;
@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 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);
builder.putInt(b);
builder.putInt(a);
return builder.offset();
}
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 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());
}
}
@@ -0,0 +1,44 @@
// automatically generated by the FlatBuffers compiler, do not modify
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()
}
}
}
@@ -0,0 +1,31 @@
-- automatically generated by the FlatBuffers compiler, do not modify
-- namespace: NamespaceB
local flatbuffers = require('flatbuffers')
local StructInNestedNS = {} -- the module
local StructInNestedNS_mt = {} -- the class metatable
function StructInNestedNS.New()
local o = {}
setmetatable(o, {__index = StructInNestedNS_mt})
return o
end
function StructInNestedNS_mt:Init(buf, pos)
self.view = flatbuffers.view.New(buf, pos)
end
function StructInNestedNS_mt:A()
return self.view:Get(flatbuffers.N.Int32, self.view.pos + 0)
end
function StructInNestedNS_mt:B()
return self.view:Get(flatbuffers.N.Int32, self.view.pos + 4)
end
function StructInNestedNS.CreateStructInNestedNS(builder, a, b)
builder:Prep(4, 8)
builder:PrependInt32(b)
builder:PrependInt32(a)
return builder:Offset()
end
return StructInNestedNS -- return the module
@@ -0,0 +1,52 @@
<?php
// automatically generated by the FlatBuffers compiler, do not modify
namespace NamespaceA\NamespaceB;
use \Google\FlatBuffers\Struct;
use \Google\FlatBuffers\Table;
use \Google\FlatBuffers\ByteBuffer;
use \Google\FlatBuffers\FlatBufferBuilder;
class StructInNestedNS extends Struct
{
/**
* @param int $_i offset
* @param ByteBuffer $_bb
* @return StructInNestedNS
**/
public function init($_i, ByteBuffer $_bb)
{
$this->bb_pos = $_i;
$this->bb = $_bb;
return $this;
}
/**
* @return int
*/
public function GetA()
{
return $this->bb->getInt($this->bb_pos + 0);
}
/**
* @return int
*/
public function GetB()
{
return $this->bb->getInt($this->bb_pos + 4);
}
/**
* @return int offset
*/
public static function createStructInNestedNS(FlatBufferBuilder $builder, $a, $b)
{
$builder->prep(4, 8);
$builder->putInt($b);
$builder->putInt($a);
return $builder->offset();
}
}
@@ -0,0 +1,60 @@
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: NamespaceB
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
class StructInNestedNS(object):
__slots__ = ['_tab']
@classmethod
def SizeOf(cls):
return 8
# 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))
def CreateStructInNestedNS(builder, a, b):
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
@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
# 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)
@@ -0,0 +1,28 @@
// automatically generated by the FlatBuffers compiler, do not modify
package NamespaceA.NamespaceB;
import java.nio.*;
import java.lang.*;
import java.util.*;
import com.google.flatbuffers.*;
public class StructInNestedNST {
private int a;
private int b;
public int getA() { return a; }
public void setA(int a) { this.a = a; }
public int getB() { return b; }
public void setB(int b) { this.b = b; }
public StructInNestedNST() {
this.a = 0;
this.b = 0;
}
}
@@ -0,0 +1,75 @@
// <auto-generated>
// automatically generated by the FlatBuffers compiler, do not modify
// </auto-generated>
namespace NamespaceA.NamespaceB
{
using global::System;
using global::System.Collections.Generic;
using global::Google.FlatBuffers;
public struct TableInNestedNS : IFlatbufferObject
{
private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); }
public static TableInNestedNS GetRootAsTableInNestedNS(ByteBuffer _bb) { return GetRootAsTableInNestedNS(_bb, new TableInNestedNS()); }
public static TableInNestedNS GetRootAsTableInNestedNS(ByteBuffer _bb, TableInNestedNS obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
public TableInNestedNS __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public int Foo { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } }
public bool MutateFoo(int foo) { int o = __p.__offset(4); if (o != 0) { __p.bb.PutInt(o + __p.bb_pos, foo); return true; } else { return false; } }
public static Offset<NamespaceA.NamespaceB.TableInNestedNS> CreateTableInNestedNS(FlatBufferBuilder builder,
int foo = 0) {
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 Offset<NamespaceA.NamespaceB.TableInNestedNS> EndTableInNestedNS(FlatBufferBuilder builder) {
int o = builder.EndTable();
return new Offset<NamespaceA.NamespaceB.TableInNestedNS>(o);
}
public TableInNestedNST UnPack() {
var _o = new TableInNestedNST();
this.UnPackTo(_o);
return _o;
}
public void UnPackTo(TableInNestedNST _o) {
_o.Foo = this.Foo;
}
public static Offset<NamespaceA.NamespaceB.TableInNestedNS> Pack(FlatBufferBuilder builder, TableInNestedNST _o) {
if (_o == null) return default(Offset<NamespaceA.NamespaceB.TableInNestedNS>);
return CreateTableInNestedNS(
builder,
_o.Foo);
}
}
public class TableInNestedNST
{
[Newtonsoft.Json.JsonProperty("foo")]
public int Foo { get; set; }
public TableInNestedNST() {
this.Foo = 0;
}
}
static public class TableInNestedNSVerify
{
static public bool Verify(Google.FlatBuffers.Verifier verifier, uint tablePos)
{
return verifier.VerifyTableStart(tablePos)
&& verifier.VerifyField(tablePos, 4 /*Foo*/, 4 /*int*/, 4, false)
&& verifier.VerifyTableEnd(tablePos);
}
}
}
@@ -0,0 +1,78 @@
// Code generated by the FlatBuffers compiler. DO NOT EDIT.
package NamespaceB
import (
flatbuffers "github.com/google/flatbuffers/go"
)
type TableInNestedNST struct {
Foo int32
}
func (t *TableInNestedNST) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
if t == nil { return 0 }
TableInNestedNSStart(builder)
TableInNestedNSAddFoo(builder, t.Foo)
return TableInNestedNSEnd(builder)
}
func (rcv *TableInNestedNS) UnPackTo(t *TableInNestedNST) {
t.Foo = rcv.Foo()
}
func (rcv *TableInNestedNS) UnPack() *TableInNestedNST {
if rcv == nil { return nil }
t := &TableInNestedNST{}
rcv.UnPackTo(t)
return t
}
type TableInNestedNS struct {
_tab flatbuffers.Table
}
func GetRootAsTableInNestedNS(buf []byte, offset flatbuffers.UOffsetT) *TableInNestedNS {
n := flatbuffers.GetUOffsetT(buf[offset:])
x := &TableInNestedNS{}
x.Init(buf, n+offset)
return x
}
func GetSizePrefixedRootAsTableInNestedNS(buf []byte, offset flatbuffers.UOffsetT) *TableInNestedNS {
n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:])
x := &TableInNestedNS{}
x.Init(buf, n+offset+flatbuffers.SizeUint32)
return x
}
func (rcv *TableInNestedNS) Init(buf []byte, i flatbuffers.UOffsetT) {
rcv._tab.Bytes = buf
rcv._tab.Pos = i
}
func (rcv *TableInNestedNS) Table() flatbuffers.Table {
return rcv._tab
}
func (rcv *TableInNestedNS) Foo() int32 {
o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
if o != 0 {
return rcv._tab.GetInt32(o + rcv._tab.Pos)
}
return 0
}
func (rcv *TableInNestedNS) MutateFoo(n int32) bool {
return rcv._tab.MutateInt32Slot(4, n)
}
func TableInNestedNSStart(builder *flatbuffers.Builder) {
builder.StartObject(1)
}
func TableInNestedNSAddFoo(builder *flatbuffers.Builder, foo int32) {
builder.PrependInt32Slot(0, foo, 0)
}
func TableInNestedNSEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
return builder.EndObject()
}
@@ -0,0 +1,57 @@
// automatically generated by the FlatBuffers compiler, do not modify
package NamespaceA.NamespaceB;
import java.nio.*;
import java.lang.*;
import java.util.*;
import com.google.flatbuffers.*;
@SuppressWarnings("unused")
public final class TableInNestedNS extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_24_3_25(); }
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 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 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 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());
}
}
@@ -0,0 +1,65 @@
// automatically generated by the FlatBuffers compiler, do not modify
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 __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 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_24_3_25()
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
}
}
}
@@ -0,0 +1,38 @@
-- automatically generated by the FlatBuffers compiler, do not modify
-- namespace: NamespaceB
local flatbuffers = require('flatbuffers')
local TableInNestedNS = {} -- the module
local TableInNestedNS_mt = {} -- the class metatable
function TableInNestedNS.New()
local o = {}
setmetatable(o, {__index = TableInNestedNS_mt})
return o
end
function TableInNestedNS.GetRootAsTableInNestedNS(buf, offset)
if type(buf) == "string" then
buf = flatbuffers.binaryArray.New(buf)
end
local n = flatbuffers.N.UOffsetT:Unpack(buf, offset)
local o = TableInNestedNS.New()
o:Init(buf, n + offset)
return o
end
function TableInNestedNS_mt:Init(buf, pos)
self.view = flatbuffers.view.New(buf, pos)
end
function TableInNestedNS_mt:Foo()
local o = self.view:Offset(4)
if o ~= 0 then
return self.view:Get(flatbuffers.N.Int32, o + self.view.pos)
end
return 0
end
function TableInNestedNS.Start(builder) builder:StartObject(1) end
function TableInNestedNS.AddFoo(builder, foo) builder:PrependInt32Slot(0, foo, 0) end
function TableInNestedNS.End(builder) return builder:EndObject() end
return TableInNestedNS -- return the module
@@ -0,0 +1,84 @@
<?php
// automatically generated by the FlatBuffers compiler, do not modify
namespace NamespaceA\NamespaceB;
use \Google\FlatBuffers\Struct;
use \Google\FlatBuffers\Table;
use \Google\FlatBuffers\ByteBuffer;
use \Google\FlatBuffers\FlatBufferBuilder;
class TableInNestedNS extends Table
{
/**
* @param ByteBuffer $bb
* @return TableInNestedNS
*/
public static function getRootAsTableInNestedNS(ByteBuffer $bb)
{
$obj = new TableInNestedNS();
return ($obj->init($bb->getInt($bb->getPosition()) + $bb->getPosition(), $bb));
}
/**
* @param int $_i offset
* @param ByteBuffer $_bb
* @return TableInNestedNS
**/
public function init($_i, ByteBuffer $_bb)
{
$this->bb_pos = $_i;
$this->bb = $_bb;
return $this;
}
/**
* @return int
*/
public function getFoo()
{
$o = $this->__offset(4);
return $o != 0 ? $this->bb->getInt($o + $this->bb_pos) : 0;
}
/**
* @param FlatBufferBuilder $builder
* @return void
*/
public static function startTableInNestedNS(FlatBufferBuilder $builder)
{
$builder->StartObject(1);
}
/**
* @param FlatBufferBuilder $builder
* @return TableInNestedNS
*/
public static function createTableInNestedNS(FlatBufferBuilder $builder, $foo)
{
$builder->startObject(1);
self::addFoo($builder, $foo);
$o = $builder->endObject();
return $o;
}
/**
* @param FlatBufferBuilder $builder
* @param int
* @return void
*/
public static function addFoo(FlatBufferBuilder $builder, $foo)
{
$builder->addIntX(0, $foo, 0);
}
/**
* @param FlatBufferBuilder $builder
* @return int table offset
*/
public static function endTableInNestedNS(FlatBufferBuilder $builder)
{
$o = $builder->endObject();
return $o;
}
}
@@ -0,0 +1,73 @@
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: NamespaceB
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
class TableInNestedNS(object):
__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 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)
def Start(builder):
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()
def End(builder):
return TableInNestedNSEnd(builder)
class TableInNestedNST(object):
# 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 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 Pack(self, builder):
TableInNestedNSStart(builder)
TableInNestedNSAddFoo(builder, self.foo)
tableInNestedNS = TableInNestedNSEnd(builder)
return tableInNestedNS
@@ -0,0 +1,22 @@
// automatically generated by the FlatBuffers compiler, do not modify
package NamespaceA.NamespaceB;
import java.nio.*;
import java.lang.*;
import java.util.*;
import com.google.flatbuffers.*;
public class TableInNestedNST {
private int foo;
public int getFoo() { return foo; }
public void setFoo(int foo) { this.foo = foo; }
public TableInNestedNST() {
this.foo = 0;
}
}
@@ -0,0 +1,97 @@
// <auto-generated>
// automatically generated by the FlatBuffers compiler, do not modify
// </auto-generated>
namespace NamespaceA.NamespaceB
{
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
public enum UnionInNestedNS : byte
{
NONE = 0,
TableInNestedNS = 1,
};
public class UnionInNestedNSUnion {
public UnionInNestedNS Type { get; set; }
public object Value { get; set; }
public UnionInNestedNSUnion() {
this.Type = UnionInNestedNS.NONE;
this.Value = null;
}
public T As<T>() where T : class { return this.Value as T; }
public NamespaceA.NamespaceB.TableInNestedNST AsTableInNestedNS() { return this.As<NamespaceA.NamespaceB.TableInNestedNST>(); }
public static UnionInNestedNSUnion FromTableInNestedNS(NamespaceA.NamespaceB.TableInNestedNST _tableinnestedns) { return new UnionInNestedNSUnion{ Type = UnionInNestedNS.TableInNestedNS, Value = _tableinnestedns }; }
public static int Pack(Google.FlatBuffers.FlatBufferBuilder builder, UnionInNestedNSUnion _o) {
switch (_o.Type) {
default: return 0;
case UnionInNestedNS.TableInNestedNS: return NamespaceA.NamespaceB.TableInNestedNS.Pack(builder, _o.AsTableInNestedNS()).Value;
}
}
}
public class UnionInNestedNSUnion_JsonConverter : Newtonsoft.Json.JsonConverter {
public override bool CanConvert(System.Type objectType) {
return objectType == typeof(UnionInNestedNSUnion) || objectType == typeof(System.Collections.Generic.List<UnionInNestedNSUnion>);
}
public override void WriteJson(Newtonsoft.Json.JsonWriter writer, object value, Newtonsoft.Json.JsonSerializer serializer) {
var _olist = value as System.Collections.Generic.List<UnionInNestedNSUnion>;
if (_olist != null) {
writer.WriteStartArray();
foreach (var _o in _olist) { this.WriteJson(writer, _o, serializer); }
writer.WriteEndArray();
} else {
this.WriteJson(writer, value as UnionInNestedNSUnion, serializer);
}
}
public void WriteJson(Newtonsoft.Json.JsonWriter writer, UnionInNestedNSUnion _o, Newtonsoft.Json.JsonSerializer serializer) {
if (_o == null) return;
serializer.Serialize(writer, _o.Value);
}
public override object ReadJson(Newtonsoft.Json.JsonReader reader, System.Type objectType, object existingValue, Newtonsoft.Json.JsonSerializer serializer) {
var _olist = existingValue as System.Collections.Generic.List<UnionInNestedNSUnion>;
if (_olist != null) {
for (var _j = 0; _j < _olist.Count; ++_j) {
reader.Read();
_olist[_j] = this.ReadJson(reader, _olist[_j], serializer);
}
reader.Read();
return _olist;
} else {
return this.ReadJson(reader, existingValue as UnionInNestedNSUnion, serializer);
}
}
public UnionInNestedNSUnion ReadJson(Newtonsoft.Json.JsonReader reader, UnionInNestedNSUnion _o, Newtonsoft.Json.JsonSerializer serializer) {
if (_o == null) return null;
switch (_o.Type) {
default: break;
case UnionInNestedNS.TableInNestedNS: _o.Value = serializer.Deserialize<NamespaceA.NamespaceB.TableInNestedNST>(reader); break;
}
return _o;
}
}
static public class UnionInNestedNSVerify
{
static public bool Verify(Google.FlatBuffers.Verifier verifier, byte typeId, uint tablePos)
{
bool result = true;
switch((UnionInNestedNS)typeId)
{
case UnionInNestedNS.TableInNestedNS:
result = NamespaceA.NamespaceB.TableInNestedNSVerify.Verify(verifier, tablePos);
break;
default: result = true;
break;
}
return result;
}
}
}
@@ -0,0 +1,36 @@
// Code generated by the FlatBuffers compiler. DO NOT EDIT.
package NamespaceB
import (
"strconv"
flatbuffers "github.com/google/flatbuffers/go"
NamespaceA__NamespaceB "NamespaceA/NamespaceB"
)
type UnionInNestedNST struct {
Type UnionInNestedNS
Value interface{}
}
func (t *UnionInNestedNST) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
if t == nil {
return 0
}
switch t.Type {
case UnionInNestedNSTableInNestedNS:
return t.Value.(*NamespaceA__NamespaceB.TableInNestedNST).Pack(builder)
}
return 0
}
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 nil
}
@@ -0,0 +1,15 @@
// automatically generated by the FlatBuffers compiler, do not modify
package NamespaceA.NamespaceB;
@SuppressWarnings("unused")
public final class UnionInNestedNS {
private UnionInNestedNS() { }
public static final byte NONE = 0;
public static final byte TableInNestedNS = 1;
public static final String[] names = { "NONE", "TableInNestedNS", };
public static String name(int e) { return names[e]; }
}
@@ -0,0 +1,14 @@
// automatically generated by the FlatBuffers compiler, do not modify
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]
}
}
@@ -0,0 +1,10 @@
-- automatically generated by the FlatBuffers compiler, do not modify
-- namespace: NamespaceB
local UnionInNestedNS = {
NONE = 0,
TableInNestedNS = 1,
}
return UnionInNestedNS -- return the module
@@ -0,0 +1,23 @@
<?php
// automatically generated by the FlatBuffers compiler, do not modify
namespace NamespaceA\NamespaceB;
class UnionInNestedNS
{
const NONE = 0;
const TableInNestedNS = 1;
private static $names = array(
UnionInNestedNS::NONE=>"NONE",
UnionInNestedNS::TableInNestedNS=>"TableInNestedNS",
);
public static function Name($e)
{
if (!isset(self::$names[$e])) {
throw new \Exception();
}
return self::$names[$e];
}
}
@@ -0,0 +1,15 @@
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: NamespaceB
class UnionInNestedNS(object):
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)
return None
@@ -0,0 +1,33 @@
// automatically generated by the FlatBuffers compiler, do not modify
package NamespaceA.NamespaceB;
import com.google.flatbuffers.FlatBufferBuilder;
public class UnionInNestedNSUnion {
private byte type;
private Object value;
public byte getType() { return type; }
public void setType(byte type) { this.type = type; }
public Object getValue() { return 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 static int pack(FlatBufferBuilder builder, UnionInNestedNSUnion _o) {
switch (_o.type) {
case UnionInNestedNS.TableInNestedNS: return NamespaceA.NamespaceB.TableInNestedNS.pack(builder, _o.asTableInNestedNS());
default: return 0;
}
}
}
@@ -0,0 +1,75 @@
// <auto-generated>
// automatically generated by the FlatBuffers compiler, do not modify
// </auto-generated>
namespace NamespaceA
{
using global::System;
using global::System.Collections.Generic;
using global::Google.FlatBuffers;
public struct SecondTableInA : IFlatbufferObject
{
private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); }
public static SecondTableInA GetRootAsSecondTableInA(ByteBuffer _bb) { return GetRootAsSecondTableInA(_bb, new SecondTableInA()); }
public static SecondTableInA GetRootAsSecondTableInA(ByteBuffer _bb, SecondTableInA obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
public SecondTableInA __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public NamespaceC.TableInC? ReferToC { get { int o = __p.__offset(4); return o != 0 ? (NamespaceC.TableInC?)(new NamespaceC.TableInC()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }
public static Offset<NamespaceA.SecondTableInA> CreateSecondTableInA(FlatBufferBuilder builder,
Offset<NamespaceC.TableInC> refer_to_cOffset = default(Offset<NamespaceC.TableInC>)) {
builder.StartTable(1);
SecondTableInA.AddReferToC(builder, refer_to_cOffset);
return SecondTableInA.EndSecondTableInA(builder);
}
public static void StartSecondTableInA(FlatBufferBuilder builder) { builder.StartTable(1); }
public static void AddReferToC(FlatBufferBuilder builder, Offset<NamespaceC.TableInC> referToCOffset) { builder.AddOffset(0, referToCOffset.Value, 0); }
public static Offset<NamespaceA.SecondTableInA> EndSecondTableInA(FlatBufferBuilder builder) {
int o = builder.EndTable();
return new Offset<NamespaceA.SecondTableInA>(o);
}
public SecondTableInAT UnPack() {
var _o = new SecondTableInAT();
this.UnPackTo(_o);
return _o;
}
public void UnPackTo(SecondTableInAT _o) {
_o.ReferToC = this.ReferToC.HasValue ? this.ReferToC.Value.UnPack() : null;
}
public static Offset<NamespaceA.SecondTableInA> Pack(FlatBufferBuilder builder, SecondTableInAT _o) {
if (_o == null) return default(Offset<NamespaceA.SecondTableInA>);
var _refer_to_c = _o.ReferToC == null ? default(Offset<NamespaceC.TableInC>) : NamespaceC.TableInC.Pack(builder, _o.ReferToC);
return CreateSecondTableInA(
builder,
_refer_to_c);
}
}
public class SecondTableInAT
{
[Newtonsoft.Json.JsonProperty("refer_to_c")]
public NamespaceC.TableInCT ReferToC { get; set; }
public SecondTableInAT() {
this.ReferToC = null;
}
}
static public class SecondTableInAVerify
{
static public bool Verify(Google.FlatBuffers.Verifier verifier, uint tablePos)
{
return verifier.VerifyTableStart(tablePos)
&& verifier.VerifyTable(tablePos, 4 /*ReferToC*/, NamespaceC.TableInCVerify.Verify, false)
&& verifier.VerifyTableEnd(tablePos);
}
}
}
@@ -0,0 +1,82 @@
// Code generated by the FlatBuffers compiler. DO NOT EDIT.
package NamespaceA
import (
flatbuffers "github.com/google/flatbuffers/go"
NamespaceC "NamespaceC"
)
type SecondTableInAT struct {
ReferToC *NamespaceC.TableInCT
}
func (t *SecondTableInAT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
if t == nil { return 0 }
referToCOffset := t.ReferToC.Pack(builder)
SecondTableInAStart(builder)
SecondTableInAAddReferToC(builder, referToCOffset)
return SecondTableInAEnd(builder)
}
func (rcv *SecondTableInA) UnPackTo(t *SecondTableInAT) {
t.ReferToC = rcv.ReferToC(nil).UnPack()
}
func (rcv *SecondTableInA) UnPack() *SecondTableInAT {
if rcv == nil { return nil }
t := &SecondTableInAT{}
rcv.UnPackTo(t)
return t
}
type SecondTableInA struct {
_tab flatbuffers.Table
}
func GetRootAsSecondTableInA(buf []byte, offset flatbuffers.UOffsetT) *SecondTableInA {
n := flatbuffers.GetUOffsetT(buf[offset:])
x := &SecondTableInA{}
x.Init(buf, n+offset)
return x
}
func GetSizePrefixedRootAsSecondTableInA(buf []byte, offset flatbuffers.UOffsetT) *SecondTableInA {
n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:])
x := &SecondTableInA{}
x.Init(buf, n+offset+flatbuffers.SizeUint32)
return x
}
func (rcv *SecondTableInA) Init(buf []byte, i flatbuffers.UOffsetT) {
rcv._tab.Bytes = buf
rcv._tab.Pos = i
}
func (rcv *SecondTableInA) Table() flatbuffers.Table {
return rcv._tab
}
func (rcv *SecondTableInA) ReferToC(obj *NamespaceC.TableInC) *NamespaceC.TableInC {
o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
if o != 0 {
x := rcv._tab.Indirect(o + rcv._tab.Pos)
if obj == nil {
obj = new(NamespaceC.TableInC)
}
obj.Init(rcv._tab.Bytes, x)
return obj
}
return nil
}
func SecondTableInAStart(builder *flatbuffers.Builder) {
builder.StartObject(1)
}
func SecondTableInAAddReferToC(builder *flatbuffers.Builder, referToC flatbuffers.UOffsetT) {
builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(referToC), 0)
}
func SecondTableInAEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
return builder.EndObject()
}
@@ -0,0 +1,58 @@
// automatically generated by the FlatBuffers compiler, do not modify
package NamespaceA;
import java.nio.*;
import java.lang.*;
import java.util.*;
import com.google.flatbuffers.*;
@SuppressWarnings("unused")
public final class SecondTableInA extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_24_3_25(); }
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 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 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 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);
}
}
@@ -0,0 +1,60 @@
// automatically generated by the FlatBuffers compiler, do not modify
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 __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
}
}
companion object {
fun validateVersion() = Constants.FLATBUFFERS_24_3_25()
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
}
}
}
@@ -0,0 +1,40 @@
-- automatically generated by the FlatBuffers compiler, do not modify
-- namespace: NamespaceA
local flatbuffers = require('flatbuffers')
local SecondTableInA = {} -- the module
local SecondTableInA_mt = {} -- the class metatable
function SecondTableInA.New()
local o = {}
setmetatable(o, {__index = SecondTableInA_mt})
return o
end
function SecondTableInA.GetRootAsSecondTableInA(buf, offset)
if type(buf) == "string" then
buf = flatbuffers.binaryArray.New(buf)
end
local n = flatbuffers.N.UOffsetT:Unpack(buf, offset)
local o = SecondTableInA.New()
o:Init(buf, n + offset)
return o
end
function SecondTableInA_mt:Init(buf, pos)
self.view = flatbuffers.view.New(buf, pos)
end
function SecondTableInA_mt:ReferToC()
local o = self.view:Offset(4)
if o ~= 0 then
local x = self.view:Indirect(o + self.view.pos)
local obj = require('NamespaceC.TableInC').New()
obj:Init(self.view.bytes, x)
return obj
end
end
function SecondTableInA.Start(builder) builder:StartObject(1) end
function SecondTableInA.AddReferToC(builder, referToC) builder:PrependUOffsetTRelativeSlot(0, referToC, 0) end
function SecondTableInA.End(builder) return builder:EndObject() end
return SecondTableInA -- return the module
@@ -0,0 +1,82 @@
<?php
// automatically generated by the FlatBuffers compiler, do not modify
namespace NamespaceA;
use \Google\FlatBuffers\Struct;
use \Google\FlatBuffers\Table;
use \Google\FlatBuffers\ByteBuffer;
use \Google\FlatBuffers\FlatBufferBuilder;
class SecondTableInA extends Table
{
/**
* @param ByteBuffer $bb
* @return SecondTableInA
*/
public static function getRootAsSecondTableInA(ByteBuffer $bb)
{
$obj = new SecondTableInA();
return ($obj->init($bb->getInt($bb->getPosition()) + $bb->getPosition(), $bb));
}
/**
* @param int $_i offset
* @param ByteBuffer $_bb
* @return SecondTableInA
**/
public function init($_i, ByteBuffer $_bb)
{
$this->bb_pos = $_i;
$this->bb = $_bb;
return $this;
}
public function getReferToC()
{
$obj = new TableInC();
$o = $this->__offset(4);
return $o != 0 ? $obj->init($this->__indirect($o + $this->bb_pos), $this->bb) : 0;
}
/**
* @param FlatBufferBuilder $builder
* @return void
*/
public static function startSecondTableInA(FlatBufferBuilder $builder)
{
$builder->StartObject(1);
}
/**
* @param FlatBufferBuilder $builder
* @return SecondTableInA
*/
public static function createSecondTableInA(FlatBufferBuilder $builder, $refer_to_c)
{
$builder->startObject(1);
self::addReferToC($builder, $refer_to_c);
$o = $builder->endObject();
return $o;
}
/**
* @param FlatBufferBuilder $builder
* @param int
* @return void
*/
public static function addReferToC(FlatBufferBuilder $builder, $referToC)
{
$builder->addOffsetX(0, $referToC, 0);
}
/**
* @param FlatBufferBuilder $builder
* @return int table offset
*/
public static function endSecondTableInA(FlatBufferBuilder $builder)
{
$o = $builder->endObject();
return $o;
}
}
@@ -0,0 +1,84 @@
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: NamespaceA
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
class SecondTableInA(object):
__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 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)
def Start(builder):
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()
def End(builder):
return SecondTableInAEnd(builder)
try:
from typing import Optional
except:
pass
class SecondTableInAT(object):
# 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 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 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
@@ -0,0 +1,22 @@
// automatically generated by the FlatBuffers compiler, do not modify
package NamespaceA;
import java.nio.*;
import java.lang.*;
import java.util.*;
import com.google.flatbuffers.*;
public class SecondTableInAT {
private NamespaceC.TableInCT referToC;
public NamespaceC.TableInCT getReferToC() { return referToC; }
public void setReferToC(NamespaceC.TableInCT referToC) { this.referToC = referToC; }
public SecondTableInAT() {
this.referToC = null;
}
}
@@ -0,0 +1,38 @@
// automatically generated by the FlatBuffers compiler, do not modify
namespace NamespaceA
{
using System;
using Google.FlatBuffers;
public sealed class TableInC : Table {
public static TableInC GetRootAsTableInC(ByteBuffer _bb) { return GetRootAsTableInC(_bb, new TableInC()); }
public static TableInC GetRootAsTableInC(ByteBuffer _bb, TableInC obj) { return (obj.__init(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public TableInC __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public NamespaceA.TableInFirstNS ReferToA1 { get { return GetReferToA1(new NamespaceA.TableInFirstNS()); } }
public NamespaceA.TableInFirstNS GetReferToA1(NamespaceA.TableInFirstNS obj) { int o = __offset(4); return o != 0 ? obj.__init(__indirect(o + bb_pos), bb) : null; }
public SecondTableInA ReferToA2 { get { return GetReferToA2(new SecondTableInA()); } }
public SecondTableInA GetReferToA2(SecondTableInA obj) { int o = __offset(6); return o != 0 ? obj.__init(__indirect(o + bb_pos), bb) : null; }
public static Offset<NamespaceC.TableInC> CreateTableInC(FlatBufferBuilder builder,
Offset<NamespaceA.TableInFirstNS> refer_to_a1Offset = default(Offset<NamespaceA.TableInFirstNS>),
Offset<SecondTableInA> refer_to_a2Offset = default(Offset<SecondTableInA>)) {
builder.StartObject(2);
TableInC.AddReferToA2(builder, refer_to_a2Offset);
TableInC.AddReferToA1(builder, refer_to_a1Offset);
return TableInC.EndTableInC(builder);
}
public static void StartTableInC(FlatBufferBuilder builder) { builder.StartObject(2); }
public static void AddReferToA1(FlatBufferBuilder builder, Offset<NamespaceA.TableInFirstNS> referToA1Offset) { builder.AddOffset(0, referToA1Offset.Value, 0); }
public static void AddReferToA2(FlatBufferBuilder builder, Offset<SecondTableInA> referToA2Offset) { builder.AddOffset(1, referToA2Offset.Value, 0); }
public static Offset<NamespaceC.TableInC> EndTableInC(FlatBufferBuilder builder) {
int o = builder.EndObject();
return new Offset<NamespaceC.TableInC>(o);
}
};
}
@@ -0,0 +1,46 @@
// automatically generated by the FlatBuffers compiler, do not modify
package NamespaceA
import (
flatbuffers "github.com/google/flatbuffers/go"
)
type TableInC struct {
_tab flatbuffers.Table
}
func (rcv *TableInC) Init(buf []byte, i flatbuffers.UOffsetT) {
rcv._tab.Bytes = buf
rcv._tab.Pos = i
}
func (rcv *TableInC) ReferToA1(obj *TableInFirstNS) *TableInFirstNS {
o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
if o != 0 {
x := rcv._tab.Indirect(o + rcv._tab.Pos)
if obj == nil {
obj = new(TableInFirstNS)
}
obj.Init(rcv._tab.Bytes, x)
return obj
}
return nil
}
func (rcv *TableInC) ReferToA2(obj *SecondTableInA) *SecondTableInA {
o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
if o != 0 {
x := rcv._tab.Indirect(o + rcv._tab.Pos)
if obj == nil {
obj = new(SecondTableInA)
}
obj.Init(rcv._tab.Bytes, x)
return obj
}
return nil
}
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 TableInCEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { return builder.EndObject() }
@@ -0,0 +1,100 @@
<?php
// automatically generated by the FlatBuffers compiler, do not modify
namespace NamespaceA;
use \Google\FlatBuffers\Struct;
use \Google\FlatBuffers\Table;
use \Google\FlatBuffers\ByteBuffer;
use \Google\FlatBuffers\FlatBufferBuilder;
class TableInC extends Table
{
/**
* @param ByteBuffer $bb
* @return TableInC
*/
public static function getRootAsTableInC(ByteBuffer $bb)
{
$obj = new TableInC();
return ($obj->init($bb->getInt($bb->getPosition()) + $bb->getPosition(), $bb));
}
/**
* @param int $_i offset
* @param ByteBuffer $_bb
* @return TableInC
**/
public function init($_i, ByteBuffer $_bb)
{
$this->bb_pos = $_i;
$this->bb = $_bb;
return $this;
}
public function getReferToA1()
{
$obj = new TableInFirstNS();
$o = $this->__offset(4);
return $o != 0 ? $obj->init($this->__indirect($o + $this->bb_pos), $this->bb) : 0;
}
public function getReferToA2()
{
$obj = new SecondTableInA();
$o = $this->__offset(6);
return $o != 0 ? $obj->init($this->__indirect($o + $this->bb_pos), $this->bb) : 0;
}
/**
* @param FlatBufferBuilder $builder
* @return void
*/
public static function startTableInC(FlatBufferBuilder $builder)
{
$builder->StartObject(2);
}
/**
* @param FlatBufferBuilder $builder
* @return TableInC
*/
public static function createTableInC(FlatBufferBuilder $builder, $refer_to_a1, $refer_to_a2)
{
$builder->startObject(2);
self::addReferToA1($builder, $refer_to_a1);
self::addReferToA2($builder, $refer_to_a2);
$o = $builder->endObject();
return $o;
}
/**
* @param FlatBufferBuilder $builder
* @param int
* @return void
*/
public static function addReferToA1(FlatBufferBuilder $builder, $referToA1)
{
$builder->addOffsetX(0, $referToA1, 0);
}
/**
* @param FlatBufferBuilder $builder
* @param int
* @return void
*/
public static function addReferToA2(FlatBufferBuilder $builder, $referToA2)
{
$builder->addOffsetX(1, $referToA2, 0);
}
/**
* @param FlatBufferBuilder $builder
* @return int table offset
*/
public static function endTableInC(FlatBufferBuilder $builder)
{
$o = $builder->endObject();
return $o;
}
}
@@ -0,0 +1,39 @@
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: NamespaceA
import flatbuffers
class TableInC(object):
__slots__ = ['_tab']
# 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 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()
@@ -0,0 +1,133 @@
// <auto-generated>
// automatically generated by the FlatBuffers compiler, do not modify
// </auto-generated>
namespace NamespaceA
{
using global::System;
using global::System.Collections.Generic;
using global::Google.FlatBuffers;
public struct TableInFirstNS : IFlatbufferObject
{
private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); }
public static TableInFirstNS GetRootAsTableInFirstNS(ByteBuffer _bb) { return GetRootAsTableInFirstNS(_bb, new TableInFirstNS()); }
public static TableInFirstNS GetRootAsTableInFirstNS(ByteBuffer _bb, TableInFirstNS obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
public TableInFirstNS __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public NamespaceA.NamespaceB.TableInNestedNS? FooTable { get { int o = __p.__offset(4); return o != 0 ? (NamespaceA.NamespaceB.TableInNestedNS?)(new NamespaceA.NamespaceB.TableInNestedNS()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }
public NamespaceA.NamespaceB.EnumInNestedNS FooEnum { get { int o = __p.__offset(6); return o != 0 ? (NamespaceA.NamespaceB.EnumInNestedNS)__p.bb.GetSbyte(o + __p.bb_pos) : NamespaceA.NamespaceB.EnumInNestedNS.A; } }
public bool MutateFooEnum(NamespaceA.NamespaceB.EnumInNestedNS foo_enum) { int o = __p.__offset(6); if (o != 0) { __p.bb.PutSbyte(o + __p.bb_pos, (sbyte)foo_enum); return true; } else { return false; } }
public NamespaceA.NamespaceB.UnionInNestedNS FooUnionType { get { int o = __p.__offset(8); return o != 0 ? (NamespaceA.NamespaceB.UnionInNestedNS)__p.bb.Get(o + __p.bb_pos) : NamespaceA.NamespaceB.UnionInNestedNS.NONE; } }
public TTable? FooUnion<TTable>() where TTable : struct, IFlatbufferObject { int o = __p.__offset(10); return o != 0 ? (TTable?)__p.__union<TTable>(o + __p.bb_pos) : null; }
public NamespaceA.NamespaceB.TableInNestedNS FooUnionAsTableInNestedNS() { return FooUnion<NamespaceA.NamespaceB.TableInNestedNS>().Value; }
public NamespaceA.NamespaceB.StructInNestedNS? FooStruct { get { int o = __p.__offset(12); return o != 0 ? (NamespaceA.NamespaceB.StructInNestedNS?)(new NamespaceA.NamespaceB.StructInNestedNS()).__assign(o + __p.bb_pos, __p.bb) : null; } }
public static Offset<NamespaceA.TableInFirstNS> CreateTableInFirstNS(FlatBufferBuilder builder,
Offset<NamespaceA.NamespaceB.TableInNestedNS> foo_tableOffset = default(Offset<NamespaceA.NamespaceB.TableInNestedNS>),
NamespaceA.NamespaceB.EnumInNestedNS foo_enum = NamespaceA.NamespaceB.EnumInNestedNS.A,
NamespaceA.NamespaceB.UnionInNestedNS foo_union_type = NamespaceA.NamespaceB.UnionInNestedNS.NONE,
int foo_unionOffset = 0,
NamespaceA.NamespaceB.StructInNestedNST foo_struct = null) {
builder.StartTable(5);
TableInFirstNS.AddFooStruct(builder, NamespaceA.NamespaceB.StructInNestedNS.Pack(builder, foo_struct));
TableInFirstNS.AddFooUnion(builder, foo_unionOffset);
TableInFirstNS.AddFooTable(builder, foo_tableOffset);
TableInFirstNS.AddFooUnionType(builder, foo_union_type);
TableInFirstNS.AddFooEnum(builder, foo_enum);
return TableInFirstNS.EndTableInFirstNS(builder);
}
public static void StartTableInFirstNS(FlatBufferBuilder builder) { builder.StartTable(5); }
public static void AddFooTable(FlatBufferBuilder builder, Offset<NamespaceA.NamespaceB.TableInNestedNS> fooTableOffset) { builder.AddOffset(0, fooTableOffset.Value, 0); }
public static void AddFooEnum(FlatBufferBuilder builder, NamespaceA.NamespaceB.EnumInNestedNS fooEnum) { builder.AddSbyte(1, (sbyte)fooEnum, 0); }
public static void AddFooUnionType(FlatBufferBuilder builder, NamespaceA.NamespaceB.UnionInNestedNS fooUnionType) { builder.AddByte(2, (byte)fooUnionType, 0); }
public static void AddFooUnion(FlatBufferBuilder builder, int fooUnionOffset) { builder.AddOffset(3, fooUnionOffset, 0); }
public static void AddFooStruct(FlatBufferBuilder builder, Offset<NamespaceA.NamespaceB.StructInNestedNS> fooStructOffset) { builder.AddStruct(4, fooStructOffset.Value, 0); }
public static Offset<NamespaceA.TableInFirstNS> EndTableInFirstNS(FlatBufferBuilder builder) {
int o = builder.EndTable();
return new Offset<NamespaceA.TableInFirstNS>(o);
}
public TableInFirstNST UnPack() {
var _o = new TableInFirstNST();
this.UnPackTo(_o);
return _o;
}
public void UnPackTo(TableInFirstNST _o) {
_o.FooTable = this.FooTable.HasValue ? this.FooTable.Value.UnPack() : null;
_o.FooEnum = this.FooEnum;
_o.FooUnion = new NamespaceA.NamespaceB.UnionInNestedNSUnion();
_o.FooUnion.Type = this.FooUnionType;
switch (this.FooUnionType) {
default: break;
case NamespaceA.NamespaceB.UnionInNestedNS.TableInNestedNS:
_o.FooUnion.Value = this.FooUnion<NamespaceA.NamespaceB.TableInNestedNS>().HasValue ? this.FooUnion<NamespaceA.NamespaceB.TableInNestedNS>().Value.UnPack() : null;
break;
}
_o.FooStruct = this.FooStruct.HasValue ? this.FooStruct.Value.UnPack() : null;
}
public static Offset<NamespaceA.TableInFirstNS> Pack(FlatBufferBuilder builder, TableInFirstNST _o) {
if (_o == null) return default(Offset<NamespaceA.TableInFirstNS>);
var _foo_table = _o.FooTable == null ? default(Offset<NamespaceA.NamespaceB.TableInNestedNS>) : NamespaceA.NamespaceB.TableInNestedNS.Pack(builder, _o.FooTable);
var _foo_union_type = _o.FooUnion == null ? NamespaceA.NamespaceB.UnionInNestedNS.NONE : _o.FooUnion.Type;
var _foo_union = _o.FooUnion == null ? 0 : NamespaceA.NamespaceB.UnionInNestedNSUnion.Pack(builder, _o.FooUnion);
return CreateTableInFirstNS(
builder,
_foo_table,
_o.FooEnum,
_foo_union_type,
_foo_union,
_o.FooStruct);
}
}
public class TableInFirstNST
{
[Newtonsoft.Json.JsonProperty("foo_table")]
public NamespaceA.NamespaceB.TableInNestedNST FooTable { get; set; }
[Newtonsoft.Json.JsonProperty("foo_enum")]
public NamespaceA.NamespaceB.EnumInNestedNS FooEnum { get; set; }
[Newtonsoft.Json.JsonProperty("foo_union_type")]
private NamespaceA.NamespaceB.UnionInNestedNS FooUnionType {
get {
return this.FooUnion != null ? this.FooUnion.Type : NamespaceA.NamespaceB.UnionInNestedNS.NONE;
}
set {
this.FooUnion = new NamespaceA.NamespaceB.UnionInNestedNSUnion();
this.FooUnion.Type = value;
}
}
[Newtonsoft.Json.JsonProperty("foo_union")]
[Newtonsoft.Json.JsonConverter(typeof(NamespaceA.NamespaceB.UnionInNestedNSUnion_JsonConverter))]
public NamespaceA.NamespaceB.UnionInNestedNSUnion FooUnion { get; set; }
[Newtonsoft.Json.JsonProperty("foo_struct")]
public NamespaceA.NamespaceB.StructInNestedNST FooStruct { get; set; }
public TableInFirstNST() {
this.FooTable = null;
this.FooEnum = NamespaceA.NamespaceB.EnumInNestedNS.A;
this.FooUnion = null;
this.FooStruct = new NamespaceA.NamespaceB.StructInNestedNST();
}
}
static public class TableInFirstNSVerify
{
static public bool Verify(Google.FlatBuffers.Verifier verifier, uint tablePos)
{
return verifier.VerifyTableStart(tablePos)
&& verifier.VerifyTable(tablePos, 4 /*FooTable*/, NamespaceA.NamespaceB.TableInNestedNSVerify.Verify, false)
&& verifier.VerifyField(tablePos, 6 /*FooEnum*/, 1 /*NamespaceA.NamespaceB.EnumInNestedNS*/, 1, false)
&& verifier.VerifyField(tablePos, 8 /*FooUnionType*/, 1 /*NamespaceA.NamespaceB.UnionInNestedNS*/, 1, false)
&& verifier.VerifyUnion(tablePos, 8, 10 /*FooUnion*/, NamespaceA.NamespaceB.UnionInNestedNSVerify.Verify, false)
&& verifier.VerifyField(tablePos, 12 /*FooStruct*/, 8 /*NamespaceA.NamespaceB.StructInNestedNS*/, 4, false)
&& verifier.VerifyTableEnd(tablePos);
}
}
}
@@ -0,0 +1,158 @@
// Code generated by the FlatBuffers compiler. DO NOT EDIT.
package NamespaceA
import (
flatbuffers "github.com/google/flatbuffers/go"
NamespaceA__NamespaceB "NamespaceA/NamespaceB"
)
type TableInFirstNST struct {
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 }
fooTableOffset := t.FooTable.Pack(builder)
fooUnionOffset := t.FooUnion.Pack(builder)
TableInFirstNSStart(builder)
TableInFirstNSAddFooTable(builder, fooTableOffset)
TableInFirstNSAddFooEnum(builder, t.FooEnum)
if t.FooUnion != nil {
TableInFirstNSAddFooUnionType(builder, t.FooUnion.Type)
}
TableInFirstNSAddFooUnion(builder, fooUnionOffset)
fooStructOffset := t.FooStruct.Pack(builder)
TableInFirstNSAddFooStruct(builder, fooStructOffset)
return TableInFirstNSEnd(builder)
}
func (rcv *TableInFirstNS) UnPackTo(t *TableInFirstNST) {
t.FooTable = rcv.FooTable(nil).UnPack()
t.FooEnum = rcv.FooEnum()
fooUnionTable := flatbuffers.Table{}
if rcv.FooUnion(&fooUnionTable) {
t.FooUnion = rcv.FooUnionType().UnPack(fooUnionTable)
}
t.FooStruct = rcv.FooStruct(nil).UnPack()
}
func (rcv *TableInFirstNS) UnPack() *TableInFirstNST {
if rcv == nil { return nil }
t := &TableInFirstNST{}
rcv.UnPackTo(t)
return t
}
type TableInFirstNS struct {
_tab flatbuffers.Table
}
func GetRootAsTableInFirstNS(buf []byte, offset flatbuffers.UOffsetT) *TableInFirstNS {
n := flatbuffers.GetUOffsetT(buf[offset:])
x := &TableInFirstNS{}
x.Init(buf, n+offset)
return x
}
func GetSizePrefixedRootAsTableInFirstNS(buf []byte, offset flatbuffers.UOffsetT) *TableInFirstNS {
n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:])
x := &TableInFirstNS{}
x.Init(buf, n+offset+flatbuffers.SizeUint32)
return x
}
func (rcv *TableInFirstNS) Init(buf []byte, i flatbuffers.UOffsetT) {
rcv._tab.Bytes = buf
rcv._tab.Pos = i
}
func (rcv *TableInFirstNS) Table() flatbuffers.Table {
return rcv._tab
}
func (rcv *TableInFirstNS) FooTable(obj *NamespaceA__NamespaceB.TableInNestedNS) *NamespaceA__NamespaceB.TableInNestedNS {
o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
if o != 0 {
x := rcv._tab.Indirect(o + rcv._tab.Pos)
if obj == nil {
obj = new(NamespaceA__NamespaceB.TableInNestedNS)
}
obj.Init(rcv._tab.Bytes, x)
return obj
}
return nil
}
func (rcv *TableInFirstNS) FooEnum() NamespaceA__NamespaceB.EnumInNestedNS {
o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
if o != 0 {
return NamespaceA__NamespaceB.EnumInNestedNS(rcv._tab.GetInt8(o + rcv._tab.Pos))
}
return 0
}
func (rcv *TableInFirstNS) MutateFooEnum(n NamespaceA__NamespaceB.EnumInNestedNS) bool {
return rcv._tab.MutateInt8Slot(6, int8(n))
}
func (rcv *TableInFirstNS) FooUnionType() NamespaceA__NamespaceB.UnionInNestedNS {
o := flatbuffers.UOffsetT(rcv._tab.Offset(8))
if o != 0 {
return NamespaceA__NamespaceB.UnionInNestedNS(rcv._tab.GetByte(o + rcv._tab.Pos))
}
return 0
}
func (rcv *TableInFirstNS) MutateFooUnionType(n NamespaceA__NamespaceB.UnionInNestedNS) bool {
return rcv._tab.MutateByteSlot(8, byte(n))
}
func (rcv *TableInFirstNS) FooUnion(obj *flatbuffers.Table) bool {
o := flatbuffers.UOffsetT(rcv._tab.Offset(10))
if o != 0 {
rcv._tab.Union(obj, o)
return true
}
return false
}
func (rcv *TableInFirstNS) FooStruct(obj *NamespaceA__NamespaceB.StructInNestedNS) *NamespaceA__NamespaceB.StructInNestedNS {
o := flatbuffers.UOffsetT(rcv._tab.Offset(12))
if o != 0 {
x := o + rcv._tab.Pos
if obj == nil {
obj = new(NamespaceA__NamespaceB.StructInNestedNS)
}
obj.Init(rcv._tab.Bytes, x)
return obj
}
return nil
}
func TableInFirstNSStart(builder *flatbuffers.Builder) {
builder.StartObject(5)
}
func TableInFirstNSAddFooTable(builder *flatbuffers.Builder, fooTable flatbuffers.UOffsetT) {
builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(fooTable), 0)
}
func TableInFirstNSAddFooEnum(builder *flatbuffers.Builder, fooEnum NamespaceA__NamespaceB.EnumInNestedNS) {
builder.PrependInt8Slot(1, int8(fooEnum), 0)
}
func TableInFirstNSAddFooUnionType(builder *flatbuffers.Builder, fooUnionType NamespaceA__NamespaceB.UnionInNestedNS) {
builder.PrependByteSlot(2, byte(fooUnionType), 0)
}
func TableInFirstNSAddFooUnion(builder *flatbuffers.Builder, fooUnion flatbuffers.UOffsetT) {
builder.PrependUOffsetTSlot(3, flatbuffers.UOffsetT(fooUnion), 0)
}
func TableInFirstNSAddFooStruct(builder *flatbuffers.Builder, fooStruct flatbuffers.UOffsetT) {
builder.PrependStructSlot(4, flatbuffers.UOffsetT(fooStruct), 0)
}
func TableInFirstNSEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
return builder.EndObject()
}
@@ -0,0 +1,83 @@
// automatically generated by the FlatBuffers compiler, do not modify
package NamespaceA;
import java.nio.*;
import java.lang.*;
import java.util.*;
import com.google.flatbuffers.*;
@SuppressWarnings("unused")
public final class TableInFirstNS extends Table {
public static void ValidateVersion() { Constants.FLATBUFFERS_24_3_25(); }
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 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 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();
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);
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());
startTableInFirstNS(builder);
addFooTable(builder, _foo_table);
addFooEnum(builder, _o.getFooEnum());
addFooUnionType(builder, _fooUnionType);
addFooUnion(builder, _fooUnion);
addFooStruct(builder, NamespaceA.NamespaceB.StructInNestedNS.pack(builder, _o.getFooStruct()));
return endTableInFirstNS(builder);
}
}
@@ -0,0 +1,99 @@
// automatically generated by the FlatBuffers compiler, do not modify
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 __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
}
}
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
}
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
}
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_24_3_25()
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
}
}
}
@@ -0,0 +1,75 @@
-- automatically generated by the FlatBuffers compiler, do not modify
-- namespace: NamespaceA
local flatbuffers = require('flatbuffers')
local TableInFirstNS = {} -- the module
local TableInFirstNS_mt = {} -- the class metatable
function TableInFirstNS.New()
local o = {}
setmetatable(o, {__index = TableInFirstNS_mt})
return o
end
function TableInFirstNS.GetRootAsTableInFirstNS(buf, offset)
if type(buf) == "string" then
buf = flatbuffers.binaryArray.New(buf)
end
local n = flatbuffers.N.UOffsetT:Unpack(buf, offset)
local o = TableInFirstNS.New()
o:Init(buf, n + offset)
return o
end
function TableInFirstNS_mt:Init(buf, pos)
self.view = flatbuffers.view.New(buf, pos)
end
function TableInFirstNS_mt:FooTable()
local o = self.view:Offset(4)
if o ~= 0 then
local x = self.view:Indirect(o + self.view.pos)
local obj = require('NamespaceA.NamespaceB.TableInNestedNS').New()
obj:Init(self.view.bytes, x)
return obj
end
end
function TableInFirstNS_mt:FooEnum()
local o = self.view:Offset(6)
if o ~= 0 then
return self.view:Get(flatbuffers.N.Int8, o + self.view.pos)
end
return 0
end
function TableInFirstNS_mt:FooUnionType()
local o = self.view:Offset(8)
if o ~= 0 then
return self.view:Get(flatbuffers.N.Uint8, o + self.view.pos)
end
return 0
end
function TableInFirstNS_mt:FooUnion()
local o = self.view:Offset(10)
if o ~= 0 then
local obj = flatbuffers.view.New(require('flatbuffers.binaryarray').New(0), 0)
self.view:Union(obj, o)
return obj
end
end
function TableInFirstNS_mt:FooStruct()
local o = self.view:Offset(12)
if o ~= 0 then
local x = o + self.view.pos
local obj = require('NamespaceA.NamespaceB.StructInNestedNS').New()
obj:Init(self.view.bytes, x)
return obj
end
end
function TableInFirstNS.Start(builder) builder:StartObject(5) end
function TableInFirstNS.AddFooTable(builder, fooTable) builder:PrependUOffsetTRelativeSlot(0, fooTable, 0) end
function TableInFirstNS.AddFooEnum(builder, fooEnum) builder:PrependInt8Slot(1, fooEnum, 0) end
function TableInFirstNS.AddFooUnionType(builder, fooUnionType) builder:PrependUint8Slot(2, fooUnionType, 0) end
function TableInFirstNS.AddFooUnion(builder, fooUnion) builder:PrependUOffsetTRelativeSlot(3, fooUnion, 0) end
function TableInFirstNS.AddFooStruct(builder, fooStruct) builder:PrependStructSlot(4, fooStruct, 0) end
function TableInFirstNS.End(builder) return builder:EndObject() end
return TableInFirstNS -- return the module
@@ -0,0 +1,155 @@
<?php
// automatically generated by the FlatBuffers compiler, do not modify
namespace NamespaceA;
use \Google\FlatBuffers\Struct;
use \Google\FlatBuffers\Table;
use \Google\FlatBuffers\ByteBuffer;
use \Google\FlatBuffers\FlatBufferBuilder;
class TableInFirstNS extends Table
{
/**
* @param ByteBuffer $bb
* @return TableInFirstNS
*/
public static function getRootAsTableInFirstNS(ByteBuffer $bb)
{
$obj = new TableInFirstNS();
return ($obj->init($bb->getInt($bb->getPosition()) + $bb->getPosition(), $bb));
}
/**
* @param int $_i offset
* @param ByteBuffer $_bb
* @return TableInFirstNS
**/
public function init($_i, ByteBuffer $_bb)
{
$this->bb_pos = $_i;
$this->bb = $_bb;
return $this;
}
public function getFooTable()
{
$obj = new TableInNestedNS();
$o = $this->__offset(4);
return $o != 0 ? $obj->init($this->__indirect($o + $this->bb_pos), $this->bb) : 0;
}
/**
* @return sbyte
*/
public function getFooEnum()
{
$o = $this->__offset(6);
return $o != 0 ? $this->bb->getSbyte($o + $this->bb_pos) : \NamespaceA\NamespaceB\EnumInNestedNS::A;
}
/**
* @return byte
*/
public function getFooUnionType()
{
$o = $this->__offset(8);
return $o != 0 ? $this->bb->getByte($o + $this->bb_pos) : \NamespaceA\NamespaceB\UnionInNestedNS::NONE;
}
/**
* @returnint
*/
public function getFooUnion($obj)
{
$o = $this->__offset(10);
return $o != 0 ? $this->__union($obj, $o) : null;
}
public function getFooStruct()
{
$obj = new StructInNestedNS();
$o = $this->__offset(12);
return $o != 0 ? $obj->init($o + $this->bb_pos, $this->bb) : 0;
}
/**
* @param FlatBufferBuilder $builder
* @return void
*/
public static function startTableInFirstNS(FlatBufferBuilder $builder)
{
$builder->StartObject(5);
}
/**
* @param FlatBufferBuilder $builder
* @return TableInFirstNS
*/
public static function createTableInFirstNS(FlatBufferBuilder $builder, $foo_table, $foo_enum, $foo_union_type, $foo_union, $foo_struct)
{
$builder->startObject(5);
self::addFooTable($builder, $foo_table);
self::addFooEnum($builder, $foo_enum);
self::addFooUnionType($builder, $foo_union_type);
self::addFooUnion($builder, $foo_union);
self::addFooStruct($builder, $foo_struct);
$o = $builder->endObject();
return $o;
}
/**
* @param FlatBufferBuilder $builder
* @param int
* @return void
*/
public static function addFooTable(FlatBufferBuilder $builder, $fooTable)
{
$builder->addOffsetX(0, $fooTable, 0);
}
/**
* @param FlatBufferBuilder $builder
* @param sbyte
* @return void
*/
public static function addFooEnum(FlatBufferBuilder $builder, $fooEnum)
{
$builder->addSbyteX(1, $fooEnum, 0);
}
/**
* @param FlatBufferBuilder $builder
* @param byte
* @return void
*/
public static function addFooUnionType(FlatBufferBuilder $builder, $fooUnionType)
{
$builder->addByteX(2, $fooUnionType, 0);
}
public static function addFooUnion(FlatBufferBuilder $builder, $offset)
{
$builder->addOffsetX(3, $offset, 0);
}
/**
* @param FlatBufferBuilder $builder
* @param int
* @return void
*/
public static function addFooStruct(FlatBufferBuilder $builder, $fooStruct)
{
$builder->addStructX(4, $fooStruct, 0);
}
/**
* @param FlatBufferBuilder $builder
* @return int table offset
*/
public static function endTableInFirstNS(FlatBufferBuilder $builder)
{
$o = $builder->endObject();
return $o;
}
}
@@ -0,0 +1,148 @@
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: NamespaceA
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
class TableInFirstNS(object):
__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 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)
# 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 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 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)
def Start(builder):
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)
def AddFooEnum(builder, fooEnum):
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)
def AddFooUnion(builder, fooUnion):
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()
def End(builder):
return TableInFirstNSEnd(builder)
try:
from typing import Optional, Union
except:
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]
@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
# 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
@@ -0,0 +1,40 @@
// automatically generated by the FlatBuffers compiler, do not modify
package NamespaceA;
import java.nio.*;
import java.lang.*;
import java.util.*;
import com.google.flatbuffers.*;
public class TableInFirstNST {
private NamespaceA.NamespaceB.TableInNestedNST fooTable;
private byte fooEnum;
private NamespaceA.NamespaceB.UnionInNestedNSUnion fooUnion;
private NamespaceA.NamespaceB.StructInNestedNST fooStruct;
public NamespaceA.NamespaceB.TableInNestedNST getFooTable() { return fooTable; }
public void setFooTable(NamespaceA.NamespaceB.TableInNestedNST fooTable) { this.fooTable = fooTable; }
public byte getFooEnum() { return fooEnum; }
public void setFooEnum(byte fooEnum) { this.fooEnum = fooEnum; }
public NamespaceA.NamespaceB.UnionInNestedNSUnion getFooUnion() { return 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 TableInFirstNST() {
this.fooTable = null;
this.fooEnum = 0;
this.fooUnion = null;
this.fooStruct = new NamespaceA.NamespaceB.StructInNestedNST();
}
}