• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// automatically generated by the FlatBuffers compiler, do not modify
2
3import * as flatbuffers from 'flatbuffers';
4
5
6
7export class HelloRequest {
8  bb: flatbuffers.ByteBuffer|null = null;
9  bb_pos = 0;
10__init(i:number, bb:flatbuffers.ByteBuffer):HelloRequest {
11  this.bb_pos = i;
12  this.bb = bb;
13  return this;
14}
15
16static getRootAsHelloRequest(bb:flatbuffers.ByteBuffer, obj?:HelloRequest):HelloRequest {
17  return (obj || new HelloRequest()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
18}
19
20static getSizePrefixedRootAsHelloRequest(bb:flatbuffers.ByteBuffer, obj?:HelloRequest):HelloRequest {
21  bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
22  return (obj || new HelloRequest()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
23}
24
25name():string|null
26name(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
27name(optionalEncoding?:any):string|Uint8Array|null {
28  const offset = this.bb!.__offset(this.bb_pos, 4);
29  return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
30}
31
32static startHelloRequest(builder:flatbuffers.Builder) {
33  builder.startObject(1);
34}
35
36static addName(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset) {
37  builder.addFieldOffset(0, nameOffset, 0);
38}
39
40static endHelloRequest(builder:flatbuffers.Builder):flatbuffers.Offset {
41  const offset = builder.endObject();
42  return offset;
43}
44
45static createHelloRequest(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset):flatbuffers.Offset {
46  HelloRequest.startHelloRequest(builder);
47  HelloRequest.addName(builder, nameOffset);
48  return HelloRequest.endHelloRequest(builder);
49}
50
51serialize():Uint8Array {
52  return this.bb!.bytes();
53}
54
55static deserialize(buffer: Uint8Array):HelloRequest {
56  return HelloRequest.getRootAsHelloRequest(new flatbuffers.ByteBuffer(buffer))
57}
58}
59