1// automatically generated by the FlatBuffers compiler, do not modify 2 3import * as flatbuffers from 'flatbuffers'; 4 5import { SecondTableInA, SecondTableInAT } from '../namespace-a/second-table-in-a'; 6import { TableInFirstNS, TableInFirstNST } from '../namespace-a/table-in-first-n-s'; 7 8 9export class TableInC { 10 bb: flatbuffers.ByteBuffer|null = null; 11 bb_pos = 0; 12__init(i:number, bb:flatbuffers.ByteBuffer):TableInC { 13 this.bb_pos = i; 14 this.bb = bb; 15 return this; 16} 17 18static getRootAsTableInC(bb:flatbuffers.ByteBuffer, obj?:TableInC):TableInC { 19 return (obj || new TableInC()).__init(bb.readInt32(bb.position()) + bb.position(), bb); 20} 21 22static getSizePrefixedRootAsTableInC(bb:flatbuffers.ByteBuffer, obj?:TableInC):TableInC { 23 bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); 24 return (obj || new TableInC()).__init(bb.readInt32(bb.position()) + bb.position(), bb); 25} 26 27referToA1(obj?:TableInFirstNS):TableInFirstNS|null { 28 const offset = this.bb!.__offset(this.bb_pos, 4); 29 return offset ? (obj || new TableInFirstNS()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null; 30} 31 32referToA2(obj?:SecondTableInA):SecondTableInA|null { 33 const offset = this.bb!.__offset(this.bb_pos, 6); 34 return offset ? (obj || new SecondTableInA()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null; 35} 36 37static getFullyQualifiedName():string { 38 return 'NamespaceC.TableInC'; 39} 40 41static startTableInC(builder:flatbuffers.Builder) { 42 builder.startObject(2); 43} 44 45static addReferToA1(builder:flatbuffers.Builder, referToA1Offset:flatbuffers.Offset) { 46 builder.addFieldOffset(0, referToA1Offset, 0); 47} 48 49static addReferToA2(builder:flatbuffers.Builder, referToA2Offset:flatbuffers.Offset) { 50 builder.addFieldOffset(1, referToA2Offset, 0); 51} 52 53static endTableInC(builder:flatbuffers.Builder):flatbuffers.Offset { 54 const offset = builder.endObject(); 55 return offset; 56} 57 58 59unpack(): TableInCT { 60 return new TableInCT( 61 (this.referToA1() !== null ? this.referToA1()!.unpack() : null), 62 (this.referToA2() !== null ? this.referToA2()!.unpack() : null) 63 ); 64} 65 66 67unpackTo(_o: TableInCT): void { 68 _o.referToA1 = (this.referToA1() !== null ? this.referToA1()!.unpack() : null); 69 _o.referToA2 = (this.referToA2() !== null ? this.referToA2()!.unpack() : null); 70} 71} 72 73export class TableInCT { 74constructor( 75 public referToA1: TableInFirstNST|null = null, 76 public referToA2: SecondTableInAT|null = null 77){} 78 79 80pack(builder:flatbuffers.Builder): flatbuffers.Offset { 81 const referToA1 = (this.referToA1 !== null ? this.referToA1!.pack(builder) : 0); 82 const referToA2 = (this.referToA2 !== null ? this.referToA2!.pack(builder) : 0); 83 84 TableInC.startTableInC(builder); 85 TableInC.addReferToA1(builder, referToA1); 86 TableInC.addReferToA2(builder, referToA2); 87 88 return TableInC.endTableInC(builder); 89} 90} 91