James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 1 | // automatically generated by the FlatBuffers compiler, do not modify |
| 2 | import * as flatbuffers from 'flatbuffers'; |
| 3 | import { SecondTableInA } from '../namespace-a/second-table-in-a'; |
| 4 | import { TableInFirstNS } from '../namespace-a/table-in-first-n-s'; |
| 5 | export class TableInC { |
| 6 | constructor() { |
| 7 | this.bb = null; |
| 8 | this.bb_pos = 0; |
| 9 | } |
| 10 | __init(i, bb) { |
| 11 | this.bb_pos = i; |
| 12 | this.bb = bb; |
| 13 | return this; |
| 14 | } |
| 15 | static getRootAsTableInC(bb, obj) { |
| 16 | return (obj || new TableInC()).__init(bb.readInt32(bb.position()) + bb.position(), bb); |
| 17 | } |
| 18 | static getSizePrefixedRootAsTableInC(bb, obj) { |
| 19 | bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); |
| 20 | return (obj || new TableInC()).__init(bb.readInt32(bb.position()) + bb.position(), bb); |
| 21 | } |
| 22 | referToA1(obj) { |
| 23 | const offset = this.bb.__offset(this.bb_pos, 4); |
| 24 | return offset ? (obj || new TableInFirstNS()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null; |
| 25 | } |
| 26 | referToA2(obj) { |
| 27 | const offset = this.bb.__offset(this.bb_pos, 6); |
| 28 | return offset ? (obj || new SecondTableInA()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null; |
| 29 | } |
| 30 | static getFullyQualifiedName() { |
| 31 | return 'NamespaceC.TableInC'; |
| 32 | } |
| 33 | static startTableInC(builder) { |
| 34 | builder.startObject(2); |
| 35 | } |
| 36 | static addReferToA1(builder, referToA1Offset) { |
| 37 | builder.addFieldOffset(0, referToA1Offset, 0); |
| 38 | } |
| 39 | static addReferToA2(builder, referToA2Offset) { |
| 40 | builder.addFieldOffset(1, referToA2Offset, 0); |
| 41 | } |
| 42 | static endTableInC(builder) { |
| 43 | const offset = builder.endObject(); |
| 44 | return offset; |
| 45 | } |
| 46 | unpack() { |
| 47 | return new TableInCT((this.referToA1() !== null ? this.referToA1().unpack() : null), (this.referToA2() !== null ? this.referToA2().unpack() : null)); |
| 48 | } |
| 49 | unpackTo(_o) { |
| 50 | _o.referToA1 = (this.referToA1() !== null ? this.referToA1().unpack() : null); |
| 51 | _o.referToA2 = (this.referToA2() !== null ? this.referToA2().unpack() : null); |
| 52 | } |
| 53 | } |
| 54 | export class TableInCT { |
| 55 | constructor(referToA1 = null, referToA2 = null) { |
| 56 | this.referToA1 = referToA1; |
| 57 | this.referToA2 = referToA2; |
| 58 | } |
| 59 | pack(builder) { |
| 60 | const referToA1 = (this.referToA1 !== null ? this.referToA1.pack(builder) : 0); |
| 61 | const referToA2 = (this.referToA2 !== null ? this.referToA2.pack(builder) : 0); |
| 62 | TableInC.startTableInC(builder); |
| 63 | TableInC.addReferToA1(builder, referToA1); |
| 64 | TableInC.addReferToA2(builder, referToA2); |
| 65 | return TableInC.endTableInC(builder); |
| 66 | } |
| 67 | } |