-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathframe-data-index.ts
66 lines (52 loc) · 2.18 KB
/
frame-data-index.ts
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
64
65
66
// automatically generated by the FlatBuffers compiler, do not modify
import * as flatbuffers from 'flatbuffers';
import { partState } from '../../ss/ssfb/part-state.js';
export class frameDataIndex {
bb: flatbuffers.ByteBuffer|null = null;
bb_pos = 0;
__init(i:number, bb:flatbuffers.ByteBuffer):frameDataIndex {
this.bb_pos = i;
this.bb = bb;
return this;
}
static getRootAsframeDataIndex(bb:flatbuffers.ByteBuffer, obj?:frameDataIndex):frameDataIndex {
return (obj || new frameDataIndex()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}
static getSizePrefixedRootAsframeDataIndex(bb:flatbuffers.ByteBuffer, obj?:frameDataIndex):frameDataIndex {
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
return (obj || new frameDataIndex()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}
states(index: number, obj?:partState):partState|null {
const offset = this.bb!.__offset(this.bb_pos, 4);
return offset ? (obj || new partState()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
}
statesLength():number {
const offset = this.bb!.__offset(this.bb_pos, 4);
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}
static startframeDataIndex(builder:flatbuffers.Builder) {
builder.startObject(1);
}
static addStates(builder:flatbuffers.Builder, statesOffset:flatbuffers.Offset) {
builder.addFieldOffset(0, statesOffset, 0);
}
static createStatesVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
builder.startVector(4, data.length, 4);
for (let i = data.length - 1; i >= 0; i--) {
builder.addOffset(data[i]!);
}
return builder.endVector();
}
static startStatesVector(builder:flatbuffers.Builder, numElems:number) {
builder.startVector(4, numElems, 4);
}
static endframeDataIndex(builder:flatbuffers.Builder):flatbuffers.Offset {
const offset = builder.endObject();
return offset;
}
static createframeDataIndex(builder:flatbuffers.Builder, statesOffset:flatbuffers.Offset):flatbuffers.Offset {
frameDataIndex.startframeDataIndex(builder);
frameDataIndex.addStates(builder, statesOffset);
return frameDataIndex.endframeDataIndex(builder);
}
}