2021-03-04 20:12:44 +00:00
|
|
|
// automatically generated by the FlatBuffers compiler, do not modify
|
|
|
|
|
|
|
|
import * as flatbuffers from 'flatbuffers';
|
|
|
|
|
|
|
|
import { EnumInNestedNS } from '../namespace-a/namespace-b/enum-in-nested-n-s';
|
|
|
|
import { StructInNestedNS, StructInNestedNST } from '../namespace-a/namespace-b/struct-in-nested-n-s';
|
|
|
|
import { TableInNestedNS, TableInNestedNST } from '../namespace-a/namespace-b/table-in-nested-n-s';
|
|
|
|
import { UnionInNestedNS, unionToUnionInNestedNS, unionListToUnionInNestedNS } from '../namespace-a/namespace-b/union-in-nested-n-s';
|
|
|
|
|
|
|
|
|
|
|
|
export class TableInFirstNS {
|
|
|
|
bb: flatbuffers.ByteBuffer|null = null;
|
|
|
|
bb_pos = 0;
|
|
|
|
__init(i:number, bb:flatbuffers.ByteBuffer):TableInFirstNS {
|
|
|
|
this.bb_pos = i;
|
|
|
|
this.bb = bb;
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
static getRootAsTableInFirstNS(bb:flatbuffers.ByteBuffer, obj?:TableInFirstNS):TableInFirstNS {
|
|
|
|
return (obj || new TableInFirstNS()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
|
|
}
|
|
|
|
|
|
|
|
static getSizePrefixedRootAsTableInFirstNS(bb:flatbuffers.ByteBuffer, obj?:TableInFirstNS):TableInFirstNS {
|
|
|
|
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
|
|
|
return (obj || new TableInFirstNS()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
|
|
}
|
|
|
|
|
2021-05-03 17:40:59 +00:00
|
|
|
fooTable(obj?:TableInNestedNS):TableInNestedNS|null {
|
2021-03-04 20:12:44 +00:00
|
|
|
const offset = this.bb!.__offset(this.bb_pos, 4);
|
2021-05-03 17:40:59 +00:00
|
|
|
return offset ? (obj || new TableInNestedNS()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
|
2021-03-04 20:12:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fooEnum():EnumInNestedNS {
|
|
|
|
const offset = this.bb!.__offset(this.bb_pos, 6);
|
|
|
|
return offset ? this.bb!.readInt8(this.bb_pos + offset) : EnumInNestedNS.A;
|
|
|
|
}
|
|
|
|
|
|
|
|
mutate_foo_enum(value:EnumInNestedNS):boolean {
|
|
|
|
const offset = this.bb!.__offset(this.bb_pos, 6);
|
|
|
|
|
|
|
|
if (offset === 0) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
this.bb!.writeInt8(this.bb_pos + offset, value);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
fooUnionType():UnionInNestedNS {
|
|
|
|
const offset = this.bb!.__offset(this.bb_pos, 8);
|
|
|
|
return offset ? this.bb!.readUint8(this.bb_pos + offset) : UnionInNestedNS.NONE;
|
|
|
|
}
|
|
|
|
|
|
|
|
fooUnion<T extends flatbuffers.Table>(obj:any):any|null {
|
|
|
|
const offset = this.bb!.__offset(this.bb_pos, 10);
|
|
|
|
return offset ? this.bb!.__union(obj, this.bb_pos + offset) : null;
|
|
|
|
}
|
|
|
|
|
2021-05-03 17:40:59 +00:00
|
|
|
fooStruct(obj?:StructInNestedNS):StructInNestedNS|null {
|
2021-03-04 20:12:44 +00:00
|
|
|
const offset = this.bb!.__offset(this.bb_pos, 12);
|
2021-05-03 17:40:59 +00:00
|
|
|
return offset ? (obj || new StructInNestedNS()).__init(this.bb_pos + offset, this.bb!) : null;
|
2021-03-04 20:12:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static getFullyQualifiedName():string {
|
|
|
|
return 'NamespaceA.TableInFirstNS';
|
|
|
|
}
|
|
|
|
|
|
|
|
static startTableInFirstNS(builder:flatbuffers.Builder) {
|
|
|
|
builder.startObject(5);
|
|
|
|
}
|
|
|
|
|
|
|
|
static addFooTable(builder:flatbuffers.Builder, fooTableOffset:flatbuffers.Offset) {
|
|
|
|
builder.addFieldOffset(0, fooTableOffset, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
static addFooEnum(builder:flatbuffers.Builder, fooEnum:EnumInNestedNS) {
|
|
|
|
builder.addFieldInt8(1, fooEnum, EnumInNestedNS.A);
|
|
|
|
}
|
|
|
|
|
|
|
|
static addFooUnionType(builder:flatbuffers.Builder, fooUnionType:UnionInNestedNS) {
|
|
|
|
builder.addFieldInt8(2, fooUnionType, UnionInNestedNS.NONE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static addFooUnion(builder:flatbuffers.Builder, fooUnionOffset:flatbuffers.Offset) {
|
|
|
|
builder.addFieldOffset(3, fooUnionOffset, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
static addFooStruct(builder:flatbuffers.Builder, fooStructOffset:flatbuffers.Offset) {
|
|
|
|
builder.addFieldStruct(4, fooStructOffset, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
static endTableInFirstNS(builder:flatbuffers.Builder):flatbuffers.Offset {
|
|
|
|
const offset = builder.endObject();
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
unpack(): TableInFirstNST {
|
|
|
|
return new TableInFirstNST(
|
|
|
|
(this.fooTable() !== null ? this.fooTable()!.unpack() : null),
|
|
|
|
this.fooEnum(),
|
|
|
|
this.fooUnionType(),
|
|
|
|
(() => {
|
|
|
|
let temp = unionToUnionInNestedNS(this.fooUnionType(), this.fooUnion.bind(this));
|
|
|
|
if(temp === null) { return null; }
|
|
|
|
return temp.unpack()
|
|
|
|
})(),
|
|
|
|
(this.fooStruct() !== null ? this.fooStruct()!.unpack() : null)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
unpackTo(_o: TableInFirstNST): void {
|
|
|
|
_o.fooTable = (this.fooTable() !== null ? this.fooTable()!.unpack() : null);
|
|
|
|
_o.fooEnum = this.fooEnum();
|
|
|
|
_o.fooUnionType = this.fooUnionType();
|
|
|
|
_o.fooUnion = (() => {
|
|
|
|
let temp = unionToUnionInNestedNS(this.fooUnionType(), this.fooUnion.bind(this));
|
|
|
|
if(temp === null) { return null; }
|
|
|
|
return temp.unpack()
|
|
|
|
})();
|
|
|
|
_o.fooStruct = (this.fooStruct() !== null ? this.fooStruct()!.unpack() : null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class TableInFirstNST {
|
|
|
|
constructor(
|
|
|
|
public fooTable: TableInNestedNST|null = null,
|
|
|
|
public fooEnum: EnumInNestedNS = EnumInNestedNS.A,
|
|
|
|
public fooUnionType: UnionInNestedNS = UnionInNestedNS.NONE,
|
|
|
|
public fooUnion: TableInNestedNST|null = null,
|
|
|
|
public fooStruct: StructInNestedNST|null = null
|
|
|
|
){}
|
|
|
|
|
|
|
|
|
|
|
|
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
2021-03-11 19:14:23 +00:00
|
|
|
const fooTable = (this.fooTable !== null ? this.fooTable!.pack(builder) : 0);
|
2021-03-04 20:12:44 +00:00
|
|
|
const fooUnion = builder.createObjectOffset(this.fooUnion);
|
|
|
|
|
|
|
|
TableInFirstNS.startTableInFirstNS(builder);
|
2021-03-11 19:14:23 +00:00
|
|
|
TableInFirstNS.addFooTable(builder, fooTable);
|
2021-03-04 20:12:44 +00:00
|
|
|
TableInFirstNS.addFooEnum(builder, this.fooEnum);
|
|
|
|
TableInFirstNS.addFooUnionType(builder, this.fooUnionType);
|
|
|
|
TableInFirstNS.addFooUnion(builder, fooUnion);
|
2021-03-25 17:25:00 +00:00
|
|
|
TableInFirstNS.addFooStruct(builder, (this.fooStruct !== null ? this.fooStruct!.pack(builder) : 0));
|
2021-03-04 20:12:44 +00:00
|
|
|
|
|
|
|
return TableInFirstNS.endTableInFirstNS(builder);
|
|
|
|
}
|
|
|
|
}
|