summaryrefslogtreecommitdiff
path: root/tests/union_vector/book-reader.ts
blob: 231060061b09c71803a917c8644ad8460c2f81f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// automatically generated by the FlatBuffers compiler, do not modify

import * as flatbuffers from 'flatbuffers';



export class BookReader {
  bb: flatbuffers.ByteBuffer|null = null;
  bb_pos = 0;
__init(i:number, bb:flatbuffers.ByteBuffer):BookReader {
  this.bb_pos = i;
  this.bb = bb;
  return this;
}

booksRead():number {
  return this.bb!.readInt32(this.bb_pos);
}

mutate_books_read(value:number):boolean {
  this.bb!.writeInt32(this.bb_pos + 0, value);
  return true;
}

static getFullyQualifiedName():string {
  return 'BookReader';
}

static sizeOf():number {
  return 4;
}

static createBookReader(builder:flatbuffers.Builder, books_read: number):flatbuffers.Offset {
  builder.prep(4, 4);
  builder.writeInt32(books_read);
  return builder.offset();
}


unpack(): BookReaderT {
  return new BookReaderT(
    this.booksRead()
  );
}


unpackTo(_o: BookReaderT): void {
  _o.booksRead = this.booksRead();
}
}

export class BookReaderT {
constructor(
  public booksRead: number = 0
){}


pack(builder:flatbuffers.Builder): flatbuffers.Offset {
  return BookReader.createBookReader(builder,
    this.booksRead
  );
}
}