...

Text file src/github.com/google/flatbuffers/tests/ts/union_vector/rapunzel.ts

Documentation: github.com/google/flatbuffers/tests/ts/union_vector

     1// automatically generated by the FlatBuffers compiler, do not modify
     2
     3import * as flatbuffers from 'flatbuffers';
     4
     5
     6
     7export class Rapunzel implements flatbuffers.IUnpackableObject<RapunzelT> {
     8  bb: flatbuffers.ByteBuffer|null = null;
     9  bb_pos = 0;
    10  __init(i:number, bb:flatbuffers.ByteBuffer):Rapunzel {
    11  this.bb_pos = i;
    12  this.bb = bb;
    13  return this;
    14}
    15
    16hairLength():number {
    17  return this.bb!.readInt32(this.bb_pos);
    18}
    19
    20mutate_hair_length(value:number):boolean {
    21  this.bb!.writeInt32(this.bb_pos + 0, value);
    22  return true;
    23}
    24
    25static getFullyQualifiedName():string {
    26  return 'Rapunzel';
    27}
    28
    29static sizeOf():number {
    30  return 4;
    31}
    32
    33static createRapunzel(builder:flatbuffers.Builder, hair_length: number):flatbuffers.Offset {
    34  builder.prep(4, 4);
    35  builder.writeInt32(hair_length);
    36  return builder.offset();
    37}
    38
    39
    40unpack(): RapunzelT {
    41  return new RapunzelT(
    42    this.hairLength()
    43  );
    44}
    45
    46
    47unpackTo(_o: RapunzelT): void {
    48  _o.hairLength = this.hairLength();
    49}
    50}
    51
    52export class RapunzelT implements flatbuffers.IGeneratedObject {
    53constructor(
    54  public hairLength: number = 0
    55){}
    56
    57
    58pack(builder:flatbuffers.Builder): flatbuffers.Offset {
    59  return Rapunzel.createRapunzel(builder,
    60    this.hairLength
    61  );
    62}
    63}

View as plain text