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 { TableInC } from '../namespace-c/table-in-c'; |
| 4 | export class SecondTableInA { |
| 5 | constructor() { |
| 6 | this.bb = null; |
| 7 | this.bb_pos = 0; |
| 8 | } |
| 9 | __init(i, bb) { |
| 10 | this.bb_pos = i; |
| 11 | this.bb = bb; |
| 12 | return this; |
| 13 | } |
| 14 | static getRootAsSecondTableInA(bb, obj) { |
| 15 | return (obj || new SecondTableInA()).__init(bb.readInt32(bb.position()) + bb.position(), bb); |
| 16 | } |
| 17 | static getSizePrefixedRootAsSecondTableInA(bb, obj) { |
| 18 | bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); |
| 19 | return (obj || new SecondTableInA()).__init(bb.readInt32(bb.position()) + bb.position(), bb); |
| 20 | } |
| 21 | referToC(obj) { |
| 22 | const offset = this.bb.__offset(this.bb_pos, 4); |
| 23 | return offset ? (obj || new TableInC()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null; |
| 24 | } |
| 25 | static getFullyQualifiedName() { |
| 26 | return 'NamespaceA.SecondTableInA'; |
| 27 | } |
| 28 | static startSecondTableInA(builder) { |
| 29 | builder.startObject(1); |
| 30 | } |
| 31 | static addReferToC(builder, referToCOffset) { |
| 32 | builder.addFieldOffset(0, referToCOffset, 0); |
| 33 | } |
| 34 | static endSecondTableInA(builder) { |
| 35 | const offset = builder.endObject(); |
| 36 | return offset; |
| 37 | } |
| 38 | static createSecondTableInA(builder, referToCOffset) { |
| 39 | SecondTableInA.startSecondTableInA(builder); |
| 40 | SecondTableInA.addReferToC(builder, referToCOffset); |
| 41 | return SecondTableInA.endSecondTableInA(builder); |
| 42 | } |
| 43 | unpack() { |
| 44 | return new SecondTableInAT((this.referToC() !== null ? this.referToC().unpack() : null)); |
| 45 | } |
| 46 | unpackTo(_o) { |
| 47 | _o.referToC = (this.referToC() !== null ? this.referToC().unpack() : null); |
| 48 | } |
| 49 | } |
| 50 | export class SecondTableInAT { |
| 51 | constructor(referToC = null) { |
| 52 | this.referToC = referToC; |
| 53 | } |
| 54 | pack(builder) { |
| 55 | const referToC = (this.referToC !== null ? this.referToC.pack(builder) : 0); |
| 56 | return SecondTableInA.createSecondTableInA(builder, referToC); |
| 57 | } |
| 58 | } |