]>
Commit | Line | Data |
---|---|---|
1d09f67e TL |
1 | // automatically generated by the FlatBuffers compiler, do not modify |
2 | ||
3 | import { flatbuffers } from 'flatbuffers'; | |
4 | /** | |
5 | * Logical types, vector layouts, and schemas | |
6 | * | |
7 | * @enum {number} | |
8 | */ | |
9 | export enum MetadataVersion { | |
10 | /** | |
11 | * 0.1.0 (October 2016). | |
12 | */ | |
13 | V1 = 0, | |
14 | ||
15 | /** | |
16 | * 0.2.0 (February 2017). Non-backwards compatible with V1. | |
17 | */ | |
18 | V2 = 1, | |
19 | ||
20 | /** | |
21 | * 0.3.0 -> 0.7.1 (May - December 2017). Non-backwards compatible with V2. | |
22 | */ | |
23 | V3 = 2, | |
24 | ||
25 | /** | |
26 | * >= 0.8.0 (December 2017). Non-backwards compatible with V3. | |
27 | */ | |
28 | V4 = 3, | |
29 | ||
30 | /** | |
31 | * >= 1.0.0 (July 2020. Backwards compatible with V4 (V5 readers can read V4 | |
32 | * metadata and IPC messages). Implementations are recommended to provide a | |
33 | * V4 compatibility mode with V5 format changes disabled. | |
34 | * | |
35 | * Incompatible changes between V4 and V5: | |
36 | * - Union buffer layout has changed. In V5, Unions don't have a validity | |
37 | * bitmap buffer. | |
38 | */ | |
39 | V5 = 4 | |
40 | } | |
41 | ||
42 | /** | |
43 | * Represents Arrow Features that might not have full support | |
44 | * within implementations. This is intended to be used in | |
45 | * two scenarios: | |
46 | * 1. A mechanism for readers of Arrow Streams | |
47 | * and files to understand that the stream or file makes | |
48 | * use of a feature that isn't supported or unknown to | |
49 | * the implementation (and therefore can meet the Arrow | |
50 | * forward compatibility guarantees). | |
51 | * 2. A means of negotiating between a client and server | |
52 | * what features a stream is allowed to use. The enums | |
53 | * values here are intented to represent higher level | |
54 | * features, additional details maybe negotiated | |
55 | * with key-value pairs specific to the protocol. | |
56 | * | |
57 | * Enums added to this list should be assigned power-of-two values | |
58 | * to facilitate exchanging and comparing bitmaps for supported | |
59 | * features. | |
60 | * | |
61 | * @enum {number} | |
62 | */ | |
63 | export enum Feature { | |
64 | /** | |
65 | * Needed to make flatbuffers happy. | |
66 | */ | |
67 | UNUSED = 0, | |
68 | ||
69 | /** | |
70 | * The stream makes use of multiple full dictionaries with the | |
71 | * same ID and assumes clients implement dictionary replacement | |
72 | * correctly. | |
73 | */ | |
74 | DICTIONARY_REPLACEMENT = 1, | |
75 | ||
76 | /** | |
77 | * The stream makes use of compressed bodies as described | |
78 | * in Message.fbs. | |
79 | */ | |
80 | COMPRESSED_BODY = 2 | |
81 | } | |
82 | ||
83 | /** | |
84 | * @enum {number} | |
85 | */ | |
86 | export enum UnionMode { | |
87 | Sparse = 0, | |
88 | Dense = 1 | |
89 | } | |
90 | ||
91 | /** | |
92 | * @enum {number} | |
93 | */ | |
94 | export enum Precision { | |
95 | HALF = 0, | |
96 | SINGLE = 1, | |
97 | DOUBLE = 2 | |
98 | } | |
99 | ||
100 | /** | |
101 | * @enum {number} | |
102 | */ | |
103 | export enum DateUnit { | |
104 | DAY = 0, | |
105 | MILLISECOND = 1 | |
106 | } | |
107 | ||
108 | /** | |
109 | * @enum {number} | |
110 | */ | |
111 | export enum TimeUnit { | |
112 | SECOND = 0, | |
113 | MILLISECOND = 1, | |
114 | MICROSECOND = 2, | |
115 | NANOSECOND = 3 | |
116 | } | |
117 | ||
118 | /** | |
119 | * @enum {number} | |
120 | */ | |
121 | export enum IntervalUnit { | |
122 | YEAR_MONTH = 0, | |
123 | DAY_TIME = 1 | |
124 | } | |
125 | ||
126 | /** | |
127 | * ---------------------------------------------------------------------- | |
128 | * Top-level Type value, enabling extensible type-specific metadata. We can | |
129 | * add new logical types to Type without breaking backwards compatibility | |
130 | * | |
131 | * @enum {number} | |
132 | */ | |
133 | export enum Type { | |
134 | NONE = 0, | |
135 | Null = 1, | |
136 | Int = 2, | |
137 | FloatingPoint = 3, | |
138 | Binary = 4, | |
139 | Utf8 = 5, | |
140 | Bool = 6, | |
141 | Decimal = 7, | |
142 | Date = 8, | |
143 | Time = 9, | |
144 | Timestamp = 10, | |
145 | Interval = 11, | |
146 | List = 12, | |
147 | Struct_ = 13, | |
148 | Union = 14, | |
149 | FixedSizeBinary = 15, | |
150 | FixedSizeList = 16, | |
151 | Map = 17, | |
152 | Duration = 18, | |
153 | LargeBinary = 19, | |
154 | LargeUtf8 = 20, | |
155 | LargeList = 21 | |
156 | } | |
157 | ||
158 | /** | |
159 | * ---------------------------------------------------------------------- | |
160 | * Dictionary encoding metadata | |
161 | * Maintained for forwards compatibility, in the future | |
162 | * Dictionaries might be explicit maps between integers and values | |
163 | * allowing for non-contiguous index values | |
164 | * | |
165 | * @enum {number} | |
166 | */ | |
167 | export enum DictionaryKind { | |
168 | DenseArray = 0 | |
169 | } | |
170 | ||
171 | /** | |
172 | * ---------------------------------------------------------------------- | |
173 | * Endianness of the platform producing the data | |
174 | * | |
175 | * @enum {number} | |
176 | */ | |
177 | export enum Endianness { | |
178 | Little = 0, | |
179 | Big = 1 | |
180 | } | |
181 | ||
182 | /** | |
183 | * These are stored in the flatbuffer in the Type union below | |
184 | * | |
185 | * @constructor | |
186 | */ | |
187 | export class Null { | |
188 | bb: flatbuffers.ByteBuffer | null = null; | |
189 | ||
190 | bb_pos: number = 0; | |
191 | /** | |
192 | * @param number i | |
193 | * @param flatbuffers.ByteBuffer bb | |
194 | * @returns Null | |
195 | */ | |
196 | __init(i: number, bb: flatbuffers.ByteBuffer): Null { | |
197 | this.bb_pos = i; | |
198 | this.bb = bb; | |
199 | return this; | |
200 | } | |
201 | ||
202 | /** | |
203 | * @param flatbuffers.ByteBuffer bb | |
204 | * @param Null= obj | |
205 | * @returns Null | |
206 | */ | |
207 | static getRootAsNull(bb: flatbuffers.ByteBuffer, obj?: Null): Null { | |
208 | return (obj || new Null()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
209 | } | |
210 | ||
211 | /** | |
212 | * @param flatbuffers.ByteBuffer bb | |
213 | * @param Null= obj | |
214 | * @returns Null | |
215 | */ | |
216 | static getSizePrefixedRootAsNull(bb: flatbuffers.ByteBuffer, obj?: Null): Null { | |
217 | bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); | |
218 | return (obj || new Null()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
219 | } | |
220 | ||
221 | /** | |
222 | * @param flatbuffers.Builder builder | |
223 | */ | |
224 | static startNull(builder: flatbuffers.Builder) { | |
225 | builder.startObject(0); | |
226 | } | |
227 | ||
228 | /** | |
229 | * @param flatbuffers.Builder builder | |
230 | * @returns flatbuffers.Offset | |
231 | */ | |
232 | static endNull(builder: flatbuffers.Builder): flatbuffers.Offset { | |
233 | const offset = builder.endObject(); | |
234 | return offset; | |
235 | } | |
236 | ||
237 | static createNull(builder: flatbuffers.Builder): flatbuffers.Offset { | |
238 | Null.startNull(builder); | |
239 | return Null.endNull(builder); | |
240 | } | |
241 | } | |
242 | /** | |
243 | * A Struct_ in the flatbuffer metadata is the same as an Arrow Struct | |
244 | * (according to the physical memory layout). We used Struct_ here as | |
245 | * Struct is a reserved word in Flatbuffers | |
246 | * | |
247 | * @constructor | |
248 | */ | |
249 | export class Struct_ { | |
250 | bb: flatbuffers.ByteBuffer | null = null; | |
251 | ||
252 | bb_pos: number = 0; | |
253 | /** | |
254 | * @param number i | |
255 | * @param flatbuffers.ByteBuffer bb | |
256 | * @returns Struct_ | |
257 | */ | |
258 | __init(i: number, bb: flatbuffers.ByteBuffer): Struct_ { | |
259 | this.bb_pos = i; | |
260 | this.bb = bb; | |
261 | return this; | |
262 | } | |
263 | ||
264 | /** | |
265 | * @param flatbuffers.ByteBuffer bb | |
266 | * @param Struct_= obj | |
267 | * @returns Struct_ | |
268 | */ | |
269 | static getRootAsStruct_(bb: flatbuffers.ByteBuffer, obj?: Struct_): Struct_ { | |
270 | return (obj || new Struct_()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
271 | } | |
272 | ||
273 | /** | |
274 | * @param flatbuffers.ByteBuffer bb | |
275 | * @param Struct_= obj | |
276 | * @returns Struct_ | |
277 | */ | |
278 | static getSizePrefixedRootAsStruct_(bb: flatbuffers.ByteBuffer, obj?: Struct_): Struct_ { | |
279 | bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); | |
280 | return (obj || new Struct_()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
281 | } | |
282 | ||
283 | /** | |
284 | * @param flatbuffers.Builder builder | |
285 | */ | |
286 | static startStruct_(builder: flatbuffers.Builder) { | |
287 | builder.startObject(0); | |
288 | } | |
289 | ||
290 | /** | |
291 | * @param flatbuffers.Builder builder | |
292 | * @returns flatbuffers.Offset | |
293 | */ | |
294 | static endStruct_(builder: flatbuffers.Builder): flatbuffers.Offset { | |
295 | const offset = builder.endObject(); | |
296 | return offset; | |
297 | } | |
298 | ||
299 | static createStruct_(builder: flatbuffers.Builder): flatbuffers.Offset { | |
300 | Struct_.startStruct_(builder); | |
301 | return Struct_.endStruct_(builder); | |
302 | } | |
303 | } | |
304 | /** | |
305 | * @constructor | |
306 | */ | |
307 | export class List { | |
308 | bb: flatbuffers.ByteBuffer | null = null; | |
309 | ||
310 | bb_pos: number = 0; | |
311 | /** | |
312 | * @param number i | |
313 | * @param flatbuffers.ByteBuffer bb | |
314 | * @returns List | |
315 | */ | |
316 | __init(i: number, bb: flatbuffers.ByteBuffer): List { | |
317 | this.bb_pos = i; | |
318 | this.bb = bb; | |
319 | return this; | |
320 | } | |
321 | ||
322 | /** | |
323 | * @param flatbuffers.ByteBuffer bb | |
324 | * @param List= obj | |
325 | * @returns List | |
326 | */ | |
327 | static getRootAsList(bb: flatbuffers.ByteBuffer, obj?: List): List { | |
328 | return (obj || new List()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
329 | } | |
330 | ||
331 | /** | |
332 | * @param flatbuffers.ByteBuffer bb | |
333 | * @param List= obj | |
334 | * @returns List | |
335 | */ | |
336 | static getSizePrefixedRootAsList(bb: flatbuffers.ByteBuffer, obj?: List): List { | |
337 | bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); | |
338 | return (obj || new List()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
339 | } | |
340 | ||
341 | /** | |
342 | * @param flatbuffers.Builder builder | |
343 | */ | |
344 | static startList(builder: flatbuffers.Builder) { | |
345 | builder.startObject(0); | |
346 | } | |
347 | ||
348 | /** | |
349 | * @param flatbuffers.Builder builder | |
350 | * @returns flatbuffers.Offset | |
351 | */ | |
352 | static endList(builder: flatbuffers.Builder): flatbuffers.Offset { | |
353 | const offset = builder.endObject(); | |
354 | return offset; | |
355 | } | |
356 | ||
357 | static createList(builder: flatbuffers.Builder): flatbuffers.Offset { | |
358 | List.startList(builder); | |
359 | return List.endList(builder); | |
360 | } | |
361 | } | |
362 | /** | |
363 | * Same as List, but with 64-bit offsets, allowing to represent | |
364 | * extremely large data values. | |
365 | * | |
366 | * @constructor | |
367 | */ | |
368 | export class LargeList { | |
369 | bb: flatbuffers.ByteBuffer | null = null; | |
370 | ||
371 | bb_pos: number = 0; | |
372 | /** | |
373 | * @param number i | |
374 | * @param flatbuffers.ByteBuffer bb | |
375 | * @returns LargeList | |
376 | */ | |
377 | __init(i: number, bb: flatbuffers.ByteBuffer): LargeList { | |
378 | this.bb_pos = i; | |
379 | this.bb = bb; | |
380 | return this; | |
381 | } | |
382 | ||
383 | /** | |
384 | * @param flatbuffers.ByteBuffer bb | |
385 | * @param LargeList= obj | |
386 | * @returns LargeList | |
387 | */ | |
388 | static getRootAsLargeList(bb: flatbuffers.ByteBuffer, obj?: LargeList): LargeList { | |
389 | return (obj || new LargeList()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
390 | } | |
391 | ||
392 | /** | |
393 | * @param flatbuffers.ByteBuffer bb | |
394 | * @param LargeList= obj | |
395 | * @returns LargeList | |
396 | */ | |
397 | static getSizePrefixedRootAsLargeList(bb: flatbuffers.ByteBuffer, obj?: LargeList): LargeList { | |
398 | bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); | |
399 | return (obj || new LargeList()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
400 | } | |
401 | ||
402 | /** | |
403 | * @param flatbuffers.Builder builder | |
404 | */ | |
405 | static startLargeList(builder: flatbuffers.Builder) { | |
406 | builder.startObject(0); | |
407 | } | |
408 | ||
409 | /** | |
410 | * @param flatbuffers.Builder builder | |
411 | * @returns flatbuffers.Offset | |
412 | */ | |
413 | static endLargeList(builder: flatbuffers.Builder): flatbuffers.Offset { | |
414 | const offset = builder.endObject(); | |
415 | return offset; | |
416 | } | |
417 | ||
418 | static createLargeList(builder: flatbuffers.Builder): flatbuffers.Offset { | |
419 | LargeList.startLargeList(builder); | |
420 | return LargeList.endLargeList(builder); | |
421 | } | |
422 | } | |
423 | /** | |
424 | * @constructor | |
425 | */ | |
426 | export class FixedSizeList { | |
427 | bb: flatbuffers.ByteBuffer | null = null; | |
428 | ||
429 | bb_pos: number = 0; | |
430 | /** | |
431 | * @param number i | |
432 | * @param flatbuffers.ByteBuffer bb | |
433 | * @returns FixedSizeList | |
434 | */ | |
435 | __init(i: number, bb: flatbuffers.ByteBuffer): FixedSizeList { | |
436 | this.bb_pos = i; | |
437 | this.bb = bb; | |
438 | return this; | |
439 | } | |
440 | ||
441 | /** | |
442 | * @param flatbuffers.ByteBuffer bb | |
443 | * @param FixedSizeList= obj | |
444 | * @returns FixedSizeList | |
445 | */ | |
446 | static getRootAsFixedSizeList(bb: flatbuffers.ByteBuffer, obj?: FixedSizeList): FixedSizeList { | |
447 | return (obj || new FixedSizeList()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
448 | } | |
449 | ||
450 | /** | |
451 | * @param flatbuffers.ByteBuffer bb | |
452 | * @param FixedSizeList= obj | |
453 | * @returns FixedSizeList | |
454 | */ | |
455 | static getSizePrefixedRootAsFixedSizeList(bb: flatbuffers.ByteBuffer, obj?: FixedSizeList): FixedSizeList { | |
456 | bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); | |
457 | return (obj || new FixedSizeList()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
458 | } | |
459 | ||
460 | /** | |
461 | * Number of list items per value | |
462 | * | |
463 | * @returns number | |
464 | */ | |
465 | listSize(): number { | |
466 | const offset = this.bb!.__offset(this.bb_pos, 4); | |
467 | return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0; | |
468 | } | |
469 | ||
470 | /** | |
471 | * @param flatbuffers.Builder builder | |
472 | */ | |
473 | static startFixedSizeList(builder: flatbuffers.Builder) { | |
474 | builder.startObject(1); | |
475 | } | |
476 | ||
477 | /** | |
478 | * @param flatbuffers.Builder builder | |
479 | * @param number listSize | |
480 | */ | |
481 | static addListSize(builder: flatbuffers.Builder, listSize: number) { | |
482 | builder.addFieldInt32(0, listSize, 0); | |
483 | } | |
484 | ||
485 | /** | |
486 | * @param flatbuffers.Builder builder | |
487 | * @returns flatbuffers.Offset | |
488 | */ | |
489 | static endFixedSizeList(builder: flatbuffers.Builder): flatbuffers.Offset { | |
490 | const offset = builder.endObject(); | |
491 | return offset; | |
492 | } | |
493 | ||
494 | static createFixedSizeList(builder: flatbuffers.Builder, listSize: number): flatbuffers.Offset { | |
495 | FixedSizeList.startFixedSizeList(builder); | |
496 | FixedSizeList.addListSize(builder, listSize); | |
497 | return FixedSizeList.endFixedSizeList(builder); | |
498 | } | |
499 | } | |
500 | /** | |
501 | * A Map is a logical nested type that is represented as | |
502 | * | |
503 | * List<entries: Struct<key: K, value: V>> | |
504 | * | |
505 | * In this layout, the keys and values are each respectively contiguous. We do | |
506 | * not constrain the key and value types, so the application is responsible | |
507 | * for ensuring that the keys are hashable and unique. Whether the keys are sorted | |
508 | * may be set in the metadata for this field. | |
509 | * | |
510 | * In a field with Map type, the field has a child Struct field, which then | |
511 | * has two children: key type and the second the value type. The names of the | |
512 | * child fields may be respectively "entries", "key", and "value", but this is | |
513 | * not enforced. | |
514 | * | |
515 | * Map | |
516 | * - child[0] entries: Struct | |
517 | * - child[0] key: K | |
518 | * - child[1] value: V | |
519 | * | |
520 | * Neither the "entries" field nor the "key" field may be nullable. | |
521 | * | |
522 | * The metadata is structured so that Arrow systems without special handling | |
523 | * for Map can make Map an alias for List. The "layout" attribute for the Map | |
524 | * field must have the same contents as a List. | |
525 | * | |
526 | * @constructor | |
527 | */ | |
528 | export class Map { | |
529 | bb: flatbuffers.ByteBuffer | null = null; | |
530 | ||
531 | bb_pos: number = 0; | |
532 | /** | |
533 | * @param number i | |
534 | * @param flatbuffers.ByteBuffer bb | |
535 | * @returns Map | |
536 | */ | |
537 | __init(i: number, bb: flatbuffers.ByteBuffer): Map { | |
538 | this.bb_pos = i; | |
539 | this.bb = bb; | |
540 | return this; | |
541 | } | |
542 | ||
543 | /** | |
544 | * @param flatbuffers.ByteBuffer bb | |
545 | * @param Map= obj | |
546 | * @returns Map | |
547 | */ | |
548 | static getRootAsMap(bb: flatbuffers.ByteBuffer, obj?: Map): Map { | |
549 | return (obj || new Map()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
550 | } | |
551 | ||
552 | /** | |
553 | * @param flatbuffers.ByteBuffer bb | |
554 | * @param Map= obj | |
555 | * @returns Map | |
556 | */ | |
557 | static getSizePrefixedRootAsMap(bb: flatbuffers.ByteBuffer, obj?: Map): Map { | |
558 | bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); | |
559 | return (obj || new Map()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
560 | } | |
561 | ||
562 | /** | |
563 | * Set to true if the keys within each value are sorted | |
564 | * | |
565 | * @returns boolean | |
566 | */ | |
567 | keysSorted(): boolean { | |
568 | const offset = this.bb!.__offset(this.bb_pos, 4); | |
569 | return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false; | |
570 | } | |
571 | ||
572 | /** | |
573 | * @param flatbuffers.Builder builder | |
574 | */ | |
575 | static startMap(builder: flatbuffers.Builder) { | |
576 | builder.startObject(1); | |
577 | } | |
578 | ||
579 | /** | |
580 | * @param flatbuffers.Builder builder | |
581 | * @param boolean keysSorted | |
582 | */ | |
583 | static addKeysSorted(builder: flatbuffers.Builder, keysSorted: boolean) { | |
584 | builder.addFieldInt8(0, +keysSorted, +false); | |
585 | } | |
586 | ||
587 | /** | |
588 | * @param flatbuffers.Builder builder | |
589 | * @returns flatbuffers.Offset | |
590 | */ | |
591 | static endMap(builder: flatbuffers.Builder): flatbuffers.Offset { | |
592 | const offset = builder.endObject(); | |
593 | return offset; | |
594 | } | |
595 | ||
596 | static createMap(builder: flatbuffers.Builder, keysSorted: boolean): flatbuffers.Offset { | |
597 | Map.startMap(builder); | |
598 | Map.addKeysSorted(builder, keysSorted); | |
599 | return Map.endMap(builder); | |
600 | } | |
601 | } | |
602 | /** | |
603 | * A union is a complex type with children in Field | |
604 | * By default ids in the type vector refer to the offsets in the children | |
605 | * optionally typeIds provides an indirection between the child offset and the type id | |
606 | * for each child typeIds[offset] is the id used in the type vector | |
607 | * | |
608 | * @constructor | |
609 | */ | |
610 | export class Union { | |
611 | bb: flatbuffers.ByteBuffer | null = null; | |
612 | ||
613 | bb_pos: number = 0; | |
614 | /** | |
615 | * @param number i | |
616 | * @param flatbuffers.ByteBuffer bb | |
617 | * @returns Union | |
618 | */ | |
619 | __init(i: number, bb: flatbuffers.ByteBuffer): Union { | |
620 | this.bb_pos = i; | |
621 | this.bb = bb; | |
622 | return this; | |
623 | } | |
624 | ||
625 | /** | |
626 | * @param flatbuffers.ByteBuffer bb | |
627 | * @param Union= obj | |
628 | * @returns Union | |
629 | */ | |
630 | static getRootAsUnion(bb: flatbuffers.ByteBuffer, obj?: Union): Union { | |
631 | return (obj || new Union()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
632 | } | |
633 | ||
634 | /** | |
635 | * @param flatbuffers.ByteBuffer bb | |
636 | * @param Union= obj | |
637 | * @returns Union | |
638 | */ | |
639 | static getSizePrefixedRootAsUnion(bb: flatbuffers.ByteBuffer, obj?: Union): Union { | |
640 | bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); | |
641 | return (obj || new Union()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
642 | } | |
643 | ||
644 | /** | |
645 | * @returns UnionMode | |
646 | */ | |
647 | mode(): UnionMode { | |
648 | const offset = this.bb!.__offset(this.bb_pos, 4); | |
649 | return offset ? /** */ (this.bb!.readInt16(this.bb_pos + offset)) : UnionMode.Sparse; | |
650 | } | |
651 | ||
652 | /** | |
653 | * @param number index | |
654 | * @returns number | |
655 | */ | |
656 | typeIds(index: number): number | null { | |
657 | const offset = this.bb!.__offset(this.bb_pos, 6); | |
658 | return offset ? this.bb!.readInt32(this.bb!.__vector(this.bb_pos + offset) + index * 4) : 0; | |
659 | } | |
660 | ||
661 | /** | |
662 | * @returns number | |
663 | */ | |
664 | typeIdsLength(): number { | |
665 | const offset = this.bb!.__offset(this.bb_pos, 6); | |
666 | return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; | |
667 | } | |
668 | ||
669 | /** | |
670 | * @returns Int32Array | |
671 | */ | |
672 | typeIdsArray(): Int32Array | null { | |
673 | const offset = this.bb!.__offset(this.bb_pos, 6); | |
674 | return offset ? new Int32Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null; | |
675 | } | |
676 | ||
677 | /** | |
678 | * @param flatbuffers.Builder builder | |
679 | */ | |
680 | static startUnion(builder: flatbuffers.Builder) { | |
681 | builder.startObject(2); | |
682 | } | |
683 | ||
684 | /** | |
685 | * @param flatbuffers.Builder builder | |
686 | * @param UnionMode mode | |
687 | */ | |
688 | static addMode(builder: flatbuffers.Builder, mode: UnionMode) { | |
689 | builder.addFieldInt16(0, mode, UnionMode.Sparse); | |
690 | } | |
691 | ||
692 | /** | |
693 | * @param flatbuffers.Builder builder | |
694 | * @param flatbuffers.Offset typeIdsOffset | |
695 | */ | |
696 | static addTypeIds(builder: flatbuffers.Builder, typeIdsOffset: flatbuffers.Offset) { | |
697 | builder.addFieldOffset(1, typeIdsOffset, 0); | |
698 | } | |
699 | ||
700 | /** | |
701 | * @param flatbuffers.Builder builder | |
702 | * @param Array.<number> data | |
703 | * @returns flatbuffers.Offset | |
704 | */ | |
705 | static createTypeIdsVector(builder: flatbuffers.Builder, data: number[] | Int32Array): flatbuffers.Offset { | |
706 | builder.startVector(4, data.length, 4); | |
707 | for (let i = data.length - 1; i >= 0; i--) { | |
708 | builder.addInt32(data[i]); | |
709 | } | |
710 | return builder.endVector(); | |
711 | } | |
712 | ||
713 | /** | |
714 | * @param flatbuffers.Builder builder | |
715 | * @param number numElems | |
716 | */ | |
717 | static startTypeIdsVector(builder: flatbuffers.Builder, numElems: number) { | |
718 | builder.startVector(4, numElems, 4); | |
719 | } | |
720 | ||
721 | /** | |
722 | * @param flatbuffers.Builder builder | |
723 | * @returns flatbuffers.Offset | |
724 | */ | |
725 | static endUnion(builder: flatbuffers.Builder): flatbuffers.Offset { | |
726 | const offset = builder.endObject(); | |
727 | return offset; | |
728 | } | |
729 | ||
730 | static createUnion(builder: flatbuffers.Builder, mode: UnionMode, typeIdsOffset: flatbuffers.Offset): flatbuffers.Offset { | |
731 | Union.startUnion(builder); | |
732 | Union.addMode(builder, mode); | |
733 | Union.addTypeIds(builder, typeIdsOffset); | |
734 | return Union.endUnion(builder); | |
735 | } | |
736 | } | |
737 | /** | |
738 | * @constructor | |
739 | */ | |
740 | export class Int { | |
741 | bb: flatbuffers.ByteBuffer | null = null; | |
742 | ||
743 | bb_pos: number = 0; | |
744 | /** | |
745 | * @param number i | |
746 | * @param flatbuffers.ByteBuffer bb | |
747 | * @returns Int | |
748 | */ | |
749 | __init(i: number, bb: flatbuffers.ByteBuffer): Int { | |
750 | this.bb_pos = i; | |
751 | this.bb = bb; | |
752 | return this; | |
753 | } | |
754 | ||
755 | /** | |
756 | * @param flatbuffers.ByteBuffer bb | |
757 | * @param Int= obj | |
758 | * @returns Int | |
759 | */ | |
760 | static getRootAsInt(bb: flatbuffers.ByteBuffer, obj?: Int): Int { | |
761 | return (obj || new Int()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
762 | } | |
763 | ||
764 | /** | |
765 | * @param flatbuffers.ByteBuffer bb | |
766 | * @param Int= obj | |
767 | * @returns Int | |
768 | */ | |
769 | static getSizePrefixedRootAsInt(bb: flatbuffers.ByteBuffer, obj?: Int): Int { | |
770 | bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); | |
771 | return (obj || new Int()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
772 | } | |
773 | ||
774 | /** | |
775 | * @returns number | |
776 | */ | |
777 | bitWidth(): number { | |
778 | const offset = this.bb!.__offset(this.bb_pos, 4); | |
779 | return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0; | |
780 | } | |
781 | ||
782 | /** | |
783 | * @returns boolean | |
784 | */ | |
785 | isSigned(): boolean { | |
786 | const offset = this.bb!.__offset(this.bb_pos, 6); | |
787 | return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false; | |
788 | } | |
789 | ||
790 | /** | |
791 | * @param flatbuffers.Builder builder | |
792 | */ | |
793 | static startInt(builder: flatbuffers.Builder) { | |
794 | builder.startObject(2); | |
795 | } | |
796 | ||
797 | /** | |
798 | * @param flatbuffers.Builder builder | |
799 | * @param number bitWidth | |
800 | */ | |
801 | static addBitWidth(builder: flatbuffers.Builder, bitWidth: number) { | |
802 | builder.addFieldInt32(0, bitWidth, 0); | |
803 | } | |
804 | ||
805 | /** | |
806 | * @param flatbuffers.Builder builder | |
807 | * @param boolean isSigned | |
808 | */ | |
809 | static addIsSigned(builder: flatbuffers.Builder, isSigned: boolean) { | |
810 | builder.addFieldInt8(1, +isSigned, +false); | |
811 | } | |
812 | ||
813 | /** | |
814 | * @param flatbuffers.Builder builder | |
815 | * @returns flatbuffers.Offset | |
816 | */ | |
817 | static endInt(builder: flatbuffers.Builder): flatbuffers.Offset { | |
818 | const offset = builder.endObject(); | |
819 | return offset; | |
820 | } | |
821 | ||
822 | static createInt(builder: flatbuffers.Builder, bitWidth: number, isSigned: boolean): flatbuffers.Offset { | |
823 | Int.startInt(builder); | |
824 | Int.addBitWidth(builder, bitWidth); | |
825 | Int.addIsSigned(builder, isSigned); | |
826 | return Int.endInt(builder); | |
827 | } | |
828 | } | |
829 | /** | |
830 | * @constructor | |
831 | */ | |
832 | export class FloatingPoint { | |
833 | bb: flatbuffers.ByteBuffer | null = null; | |
834 | ||
835 | bb_pos: number = 0; | |
836 | /** | |
837 | * @param number i | |
838 | * @param flatbuffers.ByteBuffer bb | |
839 | * @returns FloatingPoint | |
840 | */ | |
841 | __init(i: number, bb: flatbuffers.ByteBuffer): FloatingPoint { | |
842 | this.bb_pos = i; | |
843 | this.bb = bb; | |
844 | return this; | |
845 | } | |
846 | ||
847 | /** | |
848 | * @param flatbuffers.ByteBuffer bb | |
849 | * @param FloatingPoint= obj | |
850 | * @returns FloatingPoint | |
851 | */ | |
852 | static getRootAsFloatingPoint(bb: flatbuffers.ByteBuffer, obj?: FloatingPoint): FloatingPoint { | |
853 | return (obj || new FloatingPoint()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
854 | } | |
855 | ||
856 | /** | |
857 | * @param flatbuffers.ByteBuffer bb | |
858 | * @param FloatingPoint= obj | |
859 | * @returns FloatingPoint | |
860 | */ | |
861 | static getSizePrefixedRootAsFloatingPoint(bb: flatbuffers.ByteBuffer, obj?: FloatingPoint): FloatingPoint { | |
862 | bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); | |
863 | return (obj || new FloatingPoint()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
864 | } | |
865 | ||
866 | /** | |
867 | * @returns Precision | |
868 | */ | |
869 | precision(): Precision { | |
870 | const offset = this.bb!.__offset(this.bb_pos, 4); | |
871 | return offset ? /** */ (this.bb!.readInt16(this.bb_pos + offset)) : Precision.HALF; | |
872 | } | |
873 | ||
874 | /** | |
875 | * @param flatbuffers.Builder builder | |
876 | */ | |
877 | static startFloatingPoint(builder: flatbuffers.Builder) { | |
878 | builder.startObject(1); | |
879 | } | |
880 | ||
881 | /** | |
882 | * @param flatbuffers.Builder builder | |
883 | * @param Precision precision | |
884 | */ | |
885 | static addPrecision(builder: flatbuffers.Builder, precision: Precision) { | |
886 | builder.addFieldInt16(0, precision, Precision.HALF); | |
887 | } | |
888 | ||
889 | /** | |
890 | * @param flatbuffers.Builder builder | |
891 | * @returns flatbuffers.Offset | |
892 | */ | |
893 | static endFloatingPoint(builder: flatbuffers.Builder): flatbuffers.Offset { | |
894 | const offset = builder.endObject(); | |
895 | return offset; | |
896 | } | |
897 | ||
898 | static createFloatingPoint(builder: flatbuffers.Builder, precision: Precision): flatbuffers.Offset { | |
899 | FloatingPoint.startFloatingPoint(builder); | |
900 | FloatingPoint.addPrecision(builder, precision); | |
901 | return FloatingPoint.endFloatingPoint(builder); | |
902 | } | |
903 | } | |
904 | /** | |
905 | * Unicode with UTF-8 encoding | |
906 | * | |
907 | * @constructor | |
908 | */ | |
909 | export class Utf8 { | |
910 | bb: flatbuffers.ByteBuffer | null = null; | |
911 | ||
912 | bb_pos: number = 0; | |
913 | /** | |
914 | * @param number i | |
915 | * @param flatbuffers.ByteBuffer bb | |
916 | * @returns Utf8 | |
917 | */ | |
918 | __init(i: number, bb: flatbuffers.ByteBuffer): Utf8 { | |
919 | this.bb_pos = i; | |
920 | this.bb = bb; | |
921 | return this; | |
922 | } | |
923 | ||
924 | /** | |
925 | * @param flatbuffers.ByteBuffer bb | |
926 | * @param Utf8= obj | |
927 | * @returns Utf8 | |
928 | */ | |
929 | static getRootAsUtf8(bb: flatbuffers.ByteBuffer, obj?: Utf8): Utf8 { | |
930 | return (obj || new Utf8()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
931 | } | |
932 | ||
933 | /** | |
934 | * @param flatbuffers.ByteBuffer bb | |
935 | * @param Utf8= obj | |
936 | * @returns Utf8 | |
937 | */ | |
938 | static getSizePrefixedRootAsUtf8(bb: flatbuffers.ByteBuffer, obj?: Utf8): Utf8 { | |
939 | bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); | |
940 | return (obj || new Utf8()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
941 | } | |
942 | ||
943 | /** | |
944 | * @param flatbuffers.Builder builder | |
945 | */ | |
946 | static startUtf8(builder: flatbuffers.Builder) { | |
947 | builder.startObject(0); | |
948 | } | |
949 | ||
950 | /** | |
951 | * @param flatbuffers.Builder builder | |
952 | * @returns flatbuffers.Offset | |
953 | */ | |
954 | static endUtf8(builder: flatbuffers.Builder): flatbuffers.Offset { | |
955 | const offset = builder.endObject(); | |
956 | return offset; | |
957 | } | |
958 | ||
959 | static createUtf8(builder: flatbuffers.Builder): flatbuffers.Offset { | |
960 | Utf8.startUtf8(builder); | |
961 | return Utf8.endUtf8(builder); | |
962 | } | |
963 | } | |
964 | /** | |
965 | * Opaque binary data | |
966 | * | |
967 | * @constructor | |
968 | */ | |
969 | export class Binary { | |
970 | bb: flatbuffers.ByteBuffer | null = null; | |
971 | ||
972 | bb_pos: number = 0; | |
973 | /** | |
974 | * @param number i | |
975 | * @param flatbuffers.ByteBuffer bb | |
976 | * @returns Binary | |
977 | */ | |
978 | __init(i: number, bb: flatbuffers.ByteBuffer): Binary { | |
979 | this.bb_pos = i; | |
980 | this.bb = bb; | |
981 | return this; | |
982 | } | |
983 | ||
984 | /** | |
985 | * @param flatbuffers.ByteBuffer bb | |
986 | * @param Binary= obj | |
987 | * @returns Binary | |
988 | */ | |
989 | static getRootAsBinary(bb: flatbuffers.ByteBuffer, obj?: Binary): Binary { | |
990 | return (obj || new Binary()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
991 | } | |
992 | ||
993 | /** | |
994 | * @param flatbuffers.ByteBuffer bb | |
995 | * @param Binary= obj | |
996 | * @returns Binary | |
997 | */ | |
998 | static getSizePrefixedRootAsBinary(bb: flatbuffers.ByteBuffer, obj?: Binary): Binary { | |
999 | bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); | |
1000 | return (obj || new Binary()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
1001 | } | |
1002 | ||
1003 | /** | |
1004 | * @param flatbuffers.Builder builder | |
1005 | */ | |
1006 | static startBinary(builder: flatbuffers.Builder) { | |
1007 | builder.startObject(0); | |
1008 | } | |
1009 | ||
1010 | /** | |
1011 | * @param flatbuffers.Builder builder | |
1012 | * @returns flatbuffers.Offset | |
1013 | */ | |
1014 | static endBinary(builder: flatbuffers.Builder): flatbuffers.Offset { | |
1015 | const offset = builder.endObject(); | |
1016 | return offset; | |
1017 | } | |
1018 | ||
1019 | static createBinary(builder: flatbuffers.Builder): flatbuffers.Offset { | |
1020 | Binary.startBinary(builder); | |
1021 | return Binary.endBinary(builder); | |
1022 | } | |
1023 | } | |
1024 | /** | |
1025 | * Same as Utf8, but with 64-bit offsets, allowing to represent | |
1026 | * extremely large data values. | |
1027 | * | |
1028 | * @constructor | |
1029 | */ | |
1030 | export class LargeUtf8 { | |
1031 | bb: flatbuffers.ByteBuffer | null = null; | |
1032 | ||
1033 | bb_pos: number = 0; | |
1034 | /** | |
1035 | * @param number i | |
1036 | * @param flatbuffers.ByteBuffer bb | |
1037 | * @returns LargeUtf8 | |
1038 | */ | |
1039 | __init(i: number, bb: flatbuffers.ByteBuffer): LargeUtf8 { | |
1040 | this.bb_pos = i; | |
1041 | this.bb = bb; | |
1042 | return this; | |
1043 | } | |
1044 | ||
1045 | /** | |
1046 | * @param flatbuffers.ByteBuffer bb | |
1047 | * @param LargeUtf8= obj | |
1048 | * @returns LargeUtf8 | |
1049 | */ | |
1050 | static getRootAsLargeUtf8(bb: flatbuffers.ByteBuffer, obj?: LargeUtf8): LargeUtf8 { | |
1051 | return (obj || new LargeUtf8()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
1052 | } | |
1053 | ||
1054 | /** | |
1055 | * @param flatbuffers.ByteBuffer bb | |
1056 | * @param LargeUtf8= obj | |
1057 | * @returns LargeUtf8 | |
1058 | */ | |
1059 | static getSizePrefixedRootAsLargeUtf8(bb: flatbuffers.ByteBuffer, obj?: LargeUtf8): LargeUtf8 { | |
1060 | bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); | |
1061 | return (obj || new LargeUtf8()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
1062 | } | |
1063 | ||
1064 | /** | |
1065 | * @param flatbuffers.Builder builder | |
1066 | */ | |
1067 | static startLargeUtf8(builder: flatbuffers.Builder) { | |
1068 | builder.startObject(0); | |
1069 | } | |
1070 | ||
1071 | /** | |
1072 | * @param flatbuffers.Builder builder | |
1073 | * @returns flatbuffers.Offset | |
1074 | */ | |
1075 | static endLargeUtf8(builder: flatbuffers.Builder): flatbuffers.Offset { | |
1076 | const offset = builder.endObject(); | |
1077 | return offset; | |
1078 | } | |
1079 | ||
1080 | static createLargeUtf8(builder: flatbuffers.Builder): flatbuffers.Offset { | |
1081 | LargeUtf8.startLargeUtf8(builder); | |
1082 | return LargeUtf8.endLargeUtf8(builder); | |
1083 | } | |
1084 | } | |
1085 | /** | |
1086 | * Same as Binary, but with 64-bit offsets, allowing to represent | |
1087 | * extremely large data values. | |
1088 | * | |
1089 | * @constructor | |
1090 | */ | |
1091 | export class LargeBinary { | |
1092 | bb: flatbuffers.ByteBuffer | null = null; | |
1093 | ||
1094 | bb_pos: number = 0; | |
1095 | /** | |
1096 | * @param number i | |
1097 | * @param flatbuffers.ByteBuffer bb | |
1098 | * @returns LargeBinary | |
1099 | */ | |
1100 | __init(i: number, bb: flatbuffers.ByteBuffer): LargeBinary { | |
1101 | this.bb_pos = i; | |
1102 | this.bb = bb; | |
1103 | return this; | |
1104 | } | |
1105 | ||
1106 | /** | |
1107 | * @param flatbuffers.ByteBuffer bb | |
1108 | * @param LargeBinary= obj | |
1109 | * @returns LargeBinary | |
1110 | */ | |
1111 | static getRootAsLargeBinary(bb: flatbuffers.ByteBuffer, obj?: LargeBinary): LargeBinary { | |
1112 | return (obj || new LargeBinary()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
1113 | } | |
1114 | ||
1115 | /** | |
1116 | * @param flatbuffers.ByteBuffer bb | |
1117 | * @param LargeBinary= obj | |
1118 | * @returns LargeBinary | |
1119 | */ | |
1120 | static getSizePrefixedRootAsLargeBinary(bb: flatbuffers.ByteBuffer, obj?: LargeBinary): LargeBinary { | |
1121 | bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); | |
1122 | return (obj || new LargeBinary()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
1123 | } | |
1124 | ||
1125 | /** | |
1126 | * @param flatbuffers.Builder builder | |
1127 | */ | |
1128 | static startLargeBinary(builder: flatbuffers.Builder) { | |
1129 | builder.startObject(0); | |
1130 | } | |
1131 | ||
1132 | /** | |
1133 | * @param flatbuffers.Builder builder | |
1134 | * @returns flatbuffers.Offset | |
1135 | */ | |
1136 | static endLargeBinary(builder: flatbuffers.Builder): flatbuffers.Offset { | |
1137 | const offset = builder.endObject(); | |
1138 | return offset; | |
1139 | } | |
1140 | ||
1141 | static createLargeBinary(builder: flatbuffers.Builder): flatbuffers.Offset { | |
1142 | LargeBinary.startLargeBinary(builder); | |
1143 | return LargeBinary.endLargeBinary(builder); | |
1144 | } | |
1145 | } | |
1146 | /** | |
1147 | * @constructor | |
1148 | */ | |
1149 | export class FixedSizeBinary { | |
1150 | bb: flatbuffers.ByteBuffer | null = null; | |
1151 | ||
1152 | bb_pos: number = 0; | |
1153 | /** | |
1154 | * @param number i | |
1155 | * @param flatbuffers.ByteBuffer bb | |
1156 | * @returns FixedSizeBinary | |
1157 | */ | |
1158 | __init(i: number, bb: flatbuffers.ByteBuffer): FixedSizeBinary { | |
1159 | this.bb_pos = i; | |
1160 | this.bb = bb; | |
1161 | return this; | |
1162 | } | |
1163 | ||
1164 | /** | |
1165 | * @param flatbuffers.ByteBuffer bb | |
1166 | * @param FixedSizeBinary= obj | |
1167 | * @returns FixedSizeBinary | |
1168 | */ | |
1169 | static getRootAsFixedSizeBinary(bb: flatbuffers.ByteBuffer, obj?: FixedSizeBinary): FixedSizeBinary { | |
1170 | return (obj || new FixedSizeBinary()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
1171 | } | |
1172 | ||
1173 | /** | |
1174 | * @param flatbuffers.ByteBuffer bb | |
1175 | * @param FixedSizeBinary= obj | |
1176 | * @returns FixedSizeBinary | |
1177 | */ | |
1178 | static getSizePrefixedRootAsFixedSizeBinary(bb: flatbuffers.ByteBuffer, obj?: FixedSizeBinary): FixedSizeBinary { | |
1179 | bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); | |
1180 | return (obj || new FixedSizeBinary()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
1181 | } | |
1182 | ||
1183 | /** | |
1184 | * Number of bytes per value | |
1185 | * | |
1186 | * @returns number | |
1187 | */ | |
1188 | byteWidth(): number { | |
1189 | const offset = this.bb!.__offset(this.bb_pos, 4); | |
1190 | return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0; | |
1191 | } | |
1192 | ||
1193 | /** | |
1194 | * @param flatbuffers.Builder builder | |
1195 | */ | |
1196 | static startFixedSizeBinary(builder: flatbuffers.Builder) { | |
1197 | builder.startObject(1); | |
1198 | } | |
1199 | ||
1200 | /** | |
1201 | * @param flatbuffers.Builder builder | |
1202 | * @param number byteWidth | |
1203 | */ | |
1204 | static addByteWidth(builder: flatbuffers.Builder, byteWidth: number) { | |
1205 | builder.addFieldInt32(0, byteWidth, 0); | |
1206 | } | |
1207 | ||
1208 | /** | |
1209 | * @param flatbuffers.Builder builder | |
1210 | * @returns flatbuffers.Offset | |
1211 | */ | |
1212 | static endFixedSizeBinary(builder: flatbuffers.Builder): flatbuffers.Offset { | |
1213 | const offset = builder.endObject(); | |
1214 | return offset; | |
1215 | } | |
1216 | ||
1217 | static createFixedSizeBinary(builder: flatbuffers.Builder, byteWidth: number): flatbuffers.Offset { | |
1218 | FixedSizeBinary.startFixedSizeBinary(builder); | |
1219 | FixedSizeBinary.addByteWidth(builder, byteWidth); | |
1220 | return FixedSizeBinary.endFixedSizeBinary(builder); | |
1221 | } | |
1222 | } | |
1223 | /** | |
1224 | * @constructor | |
1225 | */ | |
1226 | export class Bool { | |
1227 | bb: flatbuffers.ByteBuffer | null = null; | |
1228 | ||
1229 | bb_pos: number = 0; | |
1230 | /** | |
1231 | * @param number i | |
1232 | * @param flatbuffers.ByteBuffer bb | |
1233 | * @returns Bool | |
1234 | */ | |
1235 | __init(i: number, bb: flatbuffers.ByteBuffer): Bool { | |
1236 | this.bb_pos = i; | |
1237 | this.bb = bb; | |
1238 | return this; | |
1239 | } | |
1240 | ||
1241 | /** | |
1242 | * @param flatbuffers.ByteBuffer bb | |
1243 | * @param Bool= obj | |
1244 | * @returns Bool | |
1245 | */ | |
1246 | static getRootAsBool(bb: flatbuffers.ByteBuffer, obj?: Bool): Bool { | |
1247 | return (obj || new Bool()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
1248 | } | |
1249 | ||
1250 | /** | |
1251 | * @param flatbuffers.ByteBuffer bb | |
1252 | * @param Bool= obj | |
1253 | * @returns Bool | |
1254 | */ | |
1255 | static getSizePrefixedRootAsBool(bb: flatbuffers.ByteBuffer, obj?: Bool): Bool { | |
1256 | bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); | |
1257 | return (obj || new Bool()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
1258 | } | |
1259 | ||
1260 | /** | |
1261 | * @param flatbuffers.Builder builder | |
1262 | */ | |
1263 | static startBool(builder: flatbuffers.Builder) { | |
1264 | builder.startObject(0); | |
1265 | } | |
1266 | ||
1267 | /** | |
1268 | * @param flatbuffers.Builder builder | |
1269 | * @returns flatbuffers.Offset | |
1270 | */ | |
1271 | static endBool(builder: flatbuffers.Builder): flatbuffers.Offset { | |
1272 | const offset = builder.endObject(); | |
1273 | return offset; | |
1274 | } | |
1275 | ||
1276 | static createBool(builder: flatbuffers.Builder): flatbuffers.Offset { | |
1277 | Bool.startBool(builder); | |
1278 | return Bool.endBool(builder); | |
1279 | } | |
1280 | } | |
1281 | /** | |
1282 | * Exact decimal value represented as an integer value in two's | |
1283 | * complement. Currently only 128-bit (16-byte) and 256-bit (32-byte) integers | |
1284 | * are used. The representation uses the endianness indicated | |
1285 | * in the Schema. | |
1286 | * | |
1287 | * @constructor | |
1288 | */ | |
1289 | export class Decimal { | |
1290 | bb: flatbuffers.ByteBuffer | null = null; | |
1291 | ||
1292 | bb_pos: number = 0; | |
1293 | /** | |
1294 | * @param number i | |
1295 | * @param flatbuffers.ByteBuffer bb | |
1296 | * @returns Decimal | |
1297 | */ | |
1298 | __init(i: number, bb: flatbuffers.ByteBuffer): Decimal { | |
1299 | this.bb_pos = i; | |
1300 | this.bb = bb; | |
1301 | return this; | |
1302 | } | |
1303 | ||
1304 | /** | |
1305 | * @param flatbuffers.ByteBuffer bb | |
1306 | * @param Decimal= obj | |
1307 | * @returns Decimal | |
1308 | */ | |
1309 | static getRootAsDecimal(bb: flatbuffers.ByteBuffer, obj?: Decimal): Decimal { | |
1310 | return (obj || new Decimal()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
1311 | } | |
1312 | ||
1313 | /** | |
1314 | * @param flatbuffers.ByteBuffer bb | |
1315 | * @param Decimal= obj | |
1316 | * @returns Decimal | |
1317 | */ | |
1318 | static getSizePrefixedRootAsDecimal(bb: flatbuffers.ByteBuffer, obj?: Decimal): Decimal { | |
1319 | bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); | |
1320 | return (obj || new Decimal()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
1321 | } | |
1322 | ||
1323 | /** | |
1324 | * Total number of decimal digits | |
1325 | * | |
1326 | * @returns number | |
1327 | */ | |
1328 | precision(): number { | |
1329 | const offset = this.bb!.__offset(this.bb_pos, 4); | |
1330 | return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0; | |
1331 | } | |
1332 | ||
1333 | /** | |
1334 | * Number of digits after the decimal point "." | |
1335 | * | |
1336 | * @returns number | |
1337 | */ | |
1338 | scale(): number { | |
1339 | const offset = this.bb!.__offset(this.bb_pos, 6); | |
1340 | return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0; | |
1341 | } | |
1342 | ||
1343 | /** | |
1344 | * Number of bits per value. The only accepted widths are 128 and 256. | |
1345 | * We use bitWidth for consistency with Int::bitWidth. | |
1346 | * | |
1347 | * @returns number | |
1348 | */ | |
1349 | bitWidth(): number { | |
1350 | const offset = this.bb!.__offset(this.bb_pos, 8); | |
1351 | return offset ? this.bb!.readInt32(this.bb_pos + offset) : 128; | |
1352 | } | |
1353 | ||
1354 | /** | |
1355 | * @param flatbuffers.Builder builder | |
1356 | */ | |
1357 | static startDecimal(builder: flatbuffers.Builder) { | |
1358 | builder.startObject(3); | |
1359 | } | |
1360 | ||
1361 | /** | |
1362 | * @param flatbuffers.Builder builder | |
1363 | * @param number precision | |
1364 | */ | |
1365 | static addPrecision(builder: flatbuffers.Builder, precision: number) { | |
1366 | builder.addFieldInt32(0, precision, 0); | |
1367 | } | |
1368 | ||
1369 | /** | |
1370 | * @param flatbuffers.Builder builder | |
1371 | * @param number scale | |
1372 | */ | |
1373 | static addScale(builder: flatbuffers.Builder, scale: number) { | |
1374 | builder.addFieldInt32(1, scale, 0); | |
1375 | } | |
1376 | ||
1377 | /** | |
1378 | * @param flatbuffers.Builder builder | |
1379 | * @param number bitWidth | |
1380 | */ | |
1381 | static addBitWidth(builder: flatbuffers.Builder, bitWidth: number) { | |
1382 | builder.addFieldInt32(2, bitWidth, 128); | |
1383 | } | |
1384 | ||
1385 | /** | |
1386 | * @param flatbuffers.Builder builder | |
1387 | * @returns flatbuffers.Offset | |
1388 | */ | |
1389 | static endDecimal(builder: flatbuffers.Builder): flatbuffers.Offset { | |
1390 | const offset = builder.endObject(); | |
1391 | return offset; | |
1392 | } | |
1393 | ||
1394 | static createDecimal(builder: flatbuffers.Builder, precision: number, scale: number, bitWidth: number): flatbuffers.Offset { | |
1395 | Decimal.startDecimal(builder); | |
1396 | Decimal.addPrecision(builder, precision); | |
1397 | Decimal.addScale(builder, scale); | |
1398 | Decimal.addBitWidth(builder, bitWidth); | |
1399 | return Decimal.endDecimal(builder); | |
1400 | } | |
1401 | } | |
1402 | /** | |
1403 | * Date is either a 32-bit or 64-bit type representing elapsed time since UNIX | |
1404 | * epoch (1970-01-01), stored in either of two units: | |
1405 | * | |
1406 | * * Milliseconds (64 bits) indicating UNIX time elapsed since the epoch (no | |
1407 | * leap seconds), where the values are evenly divisible by 86400000 | |
1408 | * * Days (32 bits) since the UNIX epoch | |
1409 | * | |
1410 | * @constructor | |
1411 | */ | |
1412 | export class Date { | |
1413 | bb: flatbuffers.ByteBuffer | null = null; | |
1414 | ||
1415 | bb_pos: number = 0; | |
1416 | /** | |
1417 | * @param number i | |
1418 | * @param flatbuffers.ByteBuffer bb | |
1419 | * @returns Date | |
1420 | */ | |
1421 | __init(i: number, bb: flatbuffers.ByteBuffer): Date { | |
1422 | this.bb_pos = i; | |
1423 | this.bb = bb; | |
1424 | return this; | |
1425 | } | |
1426 | ||
1427 | /** | |
1428 | * @param flatbuffers.ByteBuffer bb | |
1429 | * @param Date= obj | |
1430 | * @returns Date | |
1431 | */ | |
1432 | static getRootAsDate(bb: flatbuffers.ByteBuffer, obj?: Date): Date { | |
1433 | return (obj || new Date()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
1434 | } | |
1435 | ||
1436 | /** | |
1437 | * @param flatbuffers.ByteBuffer bb | |
1438 | * @param Date= obj | |
1439 | * @returns Date | |
1440 | */ | |
1441 | static getSizePrefixedRootAsDate(bb: flatbuffers.ByteBuffer, obj?: Date): Date { | |
1442 | bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); | |
1443 | return (obj || new Date()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
1444 | } | |
1445 | ||
1446 | /** | |
1447 | * @returns DateUnit | |
1448 | */ | |
1449 | unit(): DateUnit { | |
1450 | const offset = this.bb!.__offset(this.bb_pos, 4); | |
1451 | return offset ? /** */ (this.bb!.readInt16(this.bb_pos + offset)) : DateUnit.MILLISECOND; | |
1452 | } | |
1453 | ||
1454 | /** | |
1455 | * @param flatbuffers.Builder builder | |
1456 | */ | |
1457 | static startDate(builder: flatbuffers.Builder) { | |
1458 | builder.startObject(1); | |
1459 | } | |
1460 | ||
1461 | /** | |
1462 | * @param flatbuffers.Builder builder | |
1463 | * @param DateUnit unit | |
1464 | */ | |
1465 | static addUnit(builder: flatbuffers.Builder, unit: DateUnit) { | |
1466 | builder.addFieldInt16(0, unit, DateUnit.MILLISECOND); | |
1467 | } | |
1468 | ||
1469 | /** | |
1470 | * @param flatbuffers.Builder builder | |
1471 | * @returns flatbuffers.Offset | |
1472 | */ | |
1473 | static endDate(builder: flatbuffers.Builder): flatbuffers.Offset { | |
1474 | const offset = builder.endObject(); | |
1475 | return offset; | |
1476 | } | |
1477 | ||
1478 | static createDate(builder: flatbuffers.Builder, unit: DateUnit): flatbuffers.Offset { | |
1479 | Date.startDate(builder); | |
1480 | Date.addUnit(builder, unit); | |
1481 | return Date.endDate(builder); | |
1482 | } | |
1483 | } | |
1484 | /** | |
1485 | * Time type. The physical storage type depends on the unit | |
1486 | * - SECOND and MILLISECOND: 32 bits | |
1487 | * - MICROSECOND and NANOSECOND: 64 bits | |
1488 | * | |
1489 | * @constructor | |
1490 | */ | |
1491 | export class Time { | |
1492 | bb: flatbuffers.ByteBuffer | null = null; | |
1493 | ||
1494 | bb_pos: number = 0; | |
1495 | /** | |
1496 | * @param number i | |
1497 | * @param flatbuffers.ByteBuffer bb | |
1498 | * @returns Time | |
1499 | */ | |
1500 | __init(i: number, bb: flatbuffers.ByteBuffer): Time { | |
1501 | this.bb_pos = i; | |
1502 | this.bb = bb; | |
1503 | return this; | |
1504 | } | |
1505 | ||
1506 | /** | |
1507 | * @param flatbuffers.ByteBuffer bb | |
1508 | * @param Time= obj | |
1509 | * @returns Time | |
1510 | */ | |
1511 | static getRootAsTime(bb: flatbuffers.ByteBuffer, obj?: Time): Time { | |
1512 | return (obj || new Time()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
1513 | } | |
1514 | ||
1515 | /** | |
1516 | * @param flatbuffers.ByteBuffer bb | |
1517 | * @param Time= obj | |
1518 | * @returns Time | |
1519 | */ | |
1520 | static getSizePrefixedRootAsTime(bb: flatbuffers.ByteBuffer, obj?: Time): Time { | |
1521 | bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); | |
1522 | return (obj || new Time()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
1523 | } | |
1524 | ||
1525 | /** | |
1526 | * @returns TimeUnit | |
1527 | */ | |
1528 | unit(): TimeUnit { | |
1529 | const offset = this.bb!.__offset(this.bb_pos, 4); | |
1530 | return offset ? /** */ (this.bb!.readInt16(this.bb_pos + offset)) : TimeUnit.MILLISECOND; | |
1531 | } | |
1532 | ||
1533 | /** | |
1534 | * @returns number | |
1535 | */ | |
1536 | bitWidth(): number { | |
1537 | const offset = this.bb!.__offset(this.bb_pos, 6); | |
1538 | return offset ? this.bb!.readInt32(this.bb_pos + offset) : 32; | |
1539 | } | |
1540 | ||
1541 | /** | |
1542 | * @param flatbuffers.Builder builder | |
1543 | */ | |
1544 | static startTime(builder: flatbuffers.Builder) { | |
1545 | builder.startObject(2); | |
1546 | } | |
1547 | ||
1548 | /** | |
1549 | * @param flatbuffers.Builder builder | |
1550 | * @param TimeUnit unit | |
1551 | */ | |
1552 | static addUnit(builder: flatbuffers.Builder, unit: TimeUnit) { | |
1553 | builder.addFieldInt16(0, unit, TimeUnit.MILLISECOND); | |
1554 | } | |
1555 | ||
1556 | /** | |
1557 | * @param flatbuffers.Builder builder | |
1558 | * @param number bitWidth | |
1559 | */ | |
1560 | static addBitWidth(builder: flatbuffers.Builder, bitWidth: number) { | |
1561 | builder.addFieldInt32(1, bitWidth, 32); | |
1562 | } | |
1563 | ||
1564 | /** | |
1565 | * @param flatbuffers.Builder builder | |
1566 | * @returns flatbuffers.Offset | |
1567 | */ | |
1568 | static endTime(builder: flatbuffers.Builder): flatbuffers.Offset { | |
1569 | const offset = builder.endObject(); | |
1570 | return offset; | |
1571 | } | |
1572 | ||
1573 | static createTime(builder: flatbuffers.Builder, unit: TimeUnit, bitWidth: number): flatbuffers.Offset { | |
1574 | Time.startTime(builder); | |
1575 | Time.addUnit(builder, unit); | |
1576 | Time.addBitWidth(builder, bitWidth); | |
1577 | return Time.endTime(builder); | |
1578 | } | |
1579 | } | |
1580 | /** | |
1581 | * Time elapsed from the Unix epoch, 00:00:00.000 on 1 January 1970, excluding | |
1582 | * leap seconds, as a 64-bit integer. Note that UNIX time does not include | |
1583 | * leap seconds. | |
1584 | * | |
1585 | * The Timestamp metadata supports both "time zone naive" and "time zone | |
1586 | * aware" timestamps. Read about the timezone attribute for more detail | |
1587 | * | |
1588 | * @constructor | |
1589 | */ | |
1590 | export class Timestamp { | |
1591 | bb: flatbuffers.ByteBuffer | null = null; | |
1592 | ||
1593 | bb_pos: number = 0; | |
1594 | /** | |
1595 | * @param number i | |
1596 | * @param flatbuffers.ByteBuffer bb | |
1597 | * @returns Timestamp | |
1598 | */ | |
1599 | __init(i: number, bb: flatbuffers.ByteBuffer): Timestamp { | |
1600 | this.bb_pos = i; | |
1601 | this.bb = bb; | |
1602 | return this; | |
1603 | } | |
1604 | ||
1605 | /** | |
1606 | * @param flatbuffers.ByteBuffer bb | |
1607 | * @param Timestamp= obj | |
1608 | * @returns Timestamp | |
1609 | */ | |
1610 | static getRootAsTimestamp(bb: flatbuffers.ByteBuffer, obj?: Timestamp): Timestamp { | |
1611 | return (obj || new Timestamp()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
1612 | } | |
1613 | ||
1614 | /** | |
1615 | * @param flatbuffers.ByteBuffer bb | |
1616 | * @param Timestamp= obj | |
1617 | * @returns Timestamp | |
1618 | */ | |
1619 | static getSizePrefixedRootAsTimestamp(bb: flatbuffers.ByteBuffer, obj?: Timestamp): Timestamp { | |
1620 | bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); | |
1621 | return (obj || new Timestamp()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
1622 | } | |
1623 | ||
1624 | /** | |
1625 | * @returns TimeUnit | |
1626 | */ | |
1627 | unit(): TimeUnit { | |
1628 | const offset = this.bb!.__offset(this.bb_pos, 4); | |
1629 | return offset ? /** */ (this.bb!.readInt16(this.bb_pos + offset)) : TimeUnit.SECOND; | |
1630 | } | |
1631 | ||
1632 | /** | |
1633 | * The time zone is a string indicating the name of a time zone, one of: | |
1634 | * | |
1635 | * * As used in the Olson time zone database (the "tz database" or | |
1636 | * "tzdata"), such as "America/New_York" | |
1637 | * * An absolute time zone offset of the form +XX:XX or -XX:XX, such as +07:30 | |
1638 | * | |
1639 | * Whether a timezone string is present indicates different semantics about | |
1640 | * the data: | |
1641 | * | |
1642 | * * If the time zone is null or equal to an empty string, the data is "time | |
1643 | * zone naive" and shall be displayed *as is* to the user, not localized | |
1644 | * to the locale of the user. This data can be though of as UTC but | |
1645 | * without having "UTC" as the time zone, it is not considered to be | |
1646 | * localized to any time zone | |
1647 | * | |
1648 | * * If the time zone is set to a valid value, values can be displayed as | |
1649 | * "localized" to that time zone, even though the underlying 64-bit | |
1650 | * integers are identical to the same data stored in UTC. Converting | |
1651 | * between time zones is a metadata-only operation and does not change the | |
1652 | * underlying values | |
1653 | * | |
1654 | * @param flatbuffers.Encoding= optionalEncoding | |
1655 | * @returns string|Uint8Array|null | |
1656 | */ | |
1657 | timezone(): string | null; | |
1658 | timezone(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null; | |
1659 | timezone(optionalEncoding?: any): string | Uint8Array | null { | |
1660 | const offset = this.bb!.__offset(this.bb_pos, 6); | |
1661 | return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null; | |
1662 | } | |
1663 | ||
1664 | /** | |
1665 | * @param flatbuffers.Builder builder | |
1666 | */ | |
1667 | static startTimestamp(builder: flatbuffers.Builder) { | |
1668 | builder.startObject(2); | |
1669 | } | |
1670 | ||
1671 | /** | |
1672 | * @param flatbuffers.Builder builder | |
1673 | * @param TimeUnit unit | |
1674 | */ | |
1675 | static addUnit(builder: flatbuffers.Builder, unit: TimeUnit) { | |
1676 | builder.addFieldInt16(0, unit, TimeUnit.SECOND); | |
1677 | } | |
1678 | ||
1679 | /** | |
1680 | * @param flatbuffers.Builder builder | |
1681 | * @param flatbuffers.Offset timezoneOffset | |
1682 | */ | |
1683 | static addTimezone(builder: flatbuffers.Builder, timezoneOffset: flatbuffers.Offset) { | |
1684 | builder.addFieldOffset(1, timezoneOffset, 0); | |
1685 | } | |
1686 | ||
1687 | /** | |
1688 | * @param flatbuffers.Builder builder | |
1689 | * @returns flatbuffers.Offset | |
1690 | */ | |
1691 | static endTimestamp(builder: flatbuffers.Builder): flatbuffers.Offset { | |
1692 | const offset = builder.endObject(); | |
1693 | return offset; | |
1694 | } | |
1695 | ||
1696 | static createTimestamp(builder: flatbuffers.Builder, unit: TimeUnit, timezoneOffset: flatbuffers.Offset): flatbuffers.Offset { | |
1697 | Timestamp.startTimestamp(builder); | |
1698 | Timestamp.addUnit(builder, unit); | |
1699 | Timestamp.addTimezone(builder, timezoneOffset); | |
1700 | return Timestamp.endTimestamp(builder); | |
1701 | } | |
1702 | } | |
1703 | /** | |
1704 | * @constructor | |
1705 | */ | |
1706 | export class Interval { | |
1707 | bb: flatbuffers.ByteBuffer | null = null; | |
1708 | ||
1709 | bb_pos: number = 0; | |
1710 | /** | |
1711 | * @param number i | |
1712 | * @param flatbuffers.ByteBuffer bb | |
1713 | * @returns Interval | |
1714 | */ | |
1715 | __init(i: number, bb: flatbuffers.ByteBuffer): Interval { | |
1716 | this.bb_pos = i; | |
1717 | this.bb = bb; | |
1718 | return this; | |
1719 | } | |
1720 | ||
1721 | /** | |
1722 | * @param flatbuffers.ByteBuffer bb | |
1723 | * @param Interval= obj | |
1724 | * @returns Interval | |
1725 | */ | |
1726 | static getRootAsInterval(bb: flatbuffers.ByteBuffer, obj?: Interval): Interval { | |
1727 | return (obj || new Interval()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
1728 | } | |
1729 | ||
1730 | /** | |
1731 | * @param flatbuffers.ByteBuffer bb | |
1732 | * @param Interval= obj | |
1733 | * @returns Interval | |
1734 | */ | |
1735 | static getSizePrefixedRootAsInterval(bb: flatbuffers.ByteBuffer, obj?: Interval): Interval { | |
1736 | bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); | |
1737 | return (obj || new Interval()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
1738 | } | |
1739 | ||
1740 | /** | |
1741 | * @returns IntervalUnit | |
1742 | */ | |
1743 | unit(): IntervalUnit { | |
1744 | const offset = this.bb!.__offset(this.bb_pos, 4); | |
1745 | return offset ? /** */ (this.bb!.readInt16(this.bb_pos + offset)) : IntervalUnit.YEAR_MONTH; | |
1746 | } | |
1747 | ||
1748 | /** | |
1749 | * @param flatbuffers.Builder builder | |
1750 | */ | |
1751 | static startInterval(builder: flatbuffers.Builder) { | |
1752 | builder.startObject(1); | |
1753 | } | |
1754 | ||
1755 | /** | |
1756 | * @param flatbuffers.Builder builder | |
1757 | * @param IntervalUnit unit | |
1758 | */ | |
1759 | static addUnit(builder: flatbuffers.Builder, unit: IntervalUnit) { | |
1760 | builder.addFieldInt16(0, unit, IntervalUnit.YEAR_MONTH); | |
1761 | } | |
1762 | ||
1763 | /** | |
1764 | * @param flatbuffers.Builder builder | |
1765 | * @returns flatbuffers.Offset | |
1766 | */ | |
1767 | static endInterval(builder: flatbuffers.Builder): flatbuffers.Offset { | |
1768 | const offset = builder.endObject(); | |
1769 | return offset; | |
1770 | } | |
1771 | ||
1772 | static createInterval(builder: flatbuffers.Builder, unit: IntervalUnit): flatbuffers.Offset { | |
1773 | Interval.startInterval(builder); | |
1774 | Interval.addUnit(builder, unit); | |
1775 | return Interval.endInterval(builder); | |
1776 | } | |
1777 | } | |
1778 | /** | |
1779 | * @constructor | |
1780 | */ | |
1781 | export class Duration { | |
1782 | bb: flatbuffers.ByteBuffer | null = null; | |
1783 | ||
1784 | bb_pos: number = 0; | |
1785 | /** | |
1786 | * @param number i | |
1787 | * @param flatbuffers.ByteBuffer bb | |
1788 | * @returns Duration | |
1789 | */ | |
1790 | __init(i: number, bb: flatbuffers.ByteBuffer): Duration { | |
1791 | this.bb_pos = i; | |
1792 | this.bb = bb; | |
1793 | return this; | |
1794 | } | |
1795 | ||
1796 | /** | |
1797 | * @param flatbuffers.ByteBuffer bb | |
1798 | * @param Duration= obj | |
1799 | * @returns Duration | |
1800 | */ | |
1801 | static getRootAsDuration(bb: flatbuffers.ByteBuffer, obj?: Duration): Duration { | |
1802 | return (obj || new Duration()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
1803 | } | |
1804 | ||
1805 | /** | |
1806 | * @param flatbuffers.ByteBuffer bb | |
1807 | * @param Duration= obj | |
1808 | * @returns Duration | |
1809 | */ | |
1810 | static getSizePrefixedRootAsDuration(bb: flatbuffers.ByteBuffer, obj?: Duration): Duration { | |
1811 | bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); | |
1812 | return (obj || new Duration()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
1813 | } | |
1814 | ||
1815 | /** | |
1816 | * @returns TimeUnit | |
1817 | */ | |
1818 | unit(): TimeUnit { | |
1819 | const offset = this.bb!.__offset(this.bb_pos, 4); | |
1820 | return offset ? /** */ (this.bb!.readInt16(this.bb_pos + offset)) : TimeUnit.MILLISECOND; | |
1821 | } | |
1822 | ||
1823 | /** | |
1824 | * @param flatbuffers.Builder builder | |
1825 | */ | |
1826 | static startDuration(builder: flatbuffers.Builder) { | |
1827 | builder.startObject(1); | |
1828 | } | |
1829 | ||
1830 | /** | |
1831 | * @param flatbuffers.Builder builder | |
1832 | * @param TimeUnit unit | |
1833 | */ | |
1834 | static addUnit(builder: flatbuffers.Builder, unit: TimeUnit) { | |
1835 | builder.addFieldInt16(0, unit, TimeUnit.MILLISECOND); | |
1836 | } | |
1837 | ||
1838 | /** | |
1839 | * @param flatbuffers.Builder builder | |
1840 | * @returns flatbuffers.Offset | |
1841 | */ | |
1842 | static endDuration(builder: flatbuffers.Builder): flatbuffers.Offset { | |
1843 | const offset = builder.endObject(); | |
1844 | return offset; | |
1845 | } | |
1846 | ||
1847 | static createDuration(builder: flatbuffers.Builder, unit: TimeUnit): flatbuffers.Offset { | |
1848 | Duration.startDuration(builder); | |
1849 | Duration.addUnit(builder, unit); | |
1850 | return Duration.endDuration(builder); | |
1851 | } | |
1852 | } | |
1853 | /** | |
1854 | * ---------------------------------------------------------------------- | |
1855 | * user defined key value pairs to add custom metadata to arrow | |
1856 | * key namespacing is the responsibility of the user | |
1857 | * | |
1858 | * @constructor | |
1859 | */ | |
1860 | export class KeyValue { | |
1861 | bb: flatbuffers.ByteBuffer | null = null; | |
1862 | ||
1863 | bb_pos: number = 0; | |
1864 | /** | |
1865 | * @param number i | |
1866 | * @param flatbuffers.ByteBuffer bb | |
1867 | * @returns KeyValue | |
1868 | */ | |
1869 | __init(i: number, bb: flatbuffers.ByteBuffer): KeyValue { | |
1870 | this.bb_pos = i; | |
1871 | this.bb = bb; | |
1872 | return this; | |
1873 | } | |
1874 | ||
1875 | /** | |
1876 | * @param flatbuffers.ByteBuffer bb | |
1877 | * @param KeyValue= obj | |
1878 | * @returns KeyValue | |
1879 | */ | |
1880 | static getRootAsKeyValue(bb: flatbuffers.ByteBuffer, obj?: KeyValue): KeyValue { | |
1881 | return (obj || new KeyValue()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
1882 | } | |
1883 | ||
1884 | /** | |
1885 | * @param flatbuffers.ByteBuffer bb | |
1886 | * @param KeyValue= obj | |
1887 | * @returns KeyValue | |
1888 | */ | |
1889 | static getSizePrefixedRootAsKeyValue(bb: flatbuffers.ByteBuffer, obj?: KeyValue): KeyValue { | |
1890 | bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); | |
1891 | return (obj || new KeyValue()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
1892 | } | |
1893 | ||
1894 | /** | |
1895 | * @param flatbuffers.Encoding= optionalEncoding | |
1896 | * @returns string|Uint8Array|null | |
1897 | */ | |
1898 | key(): string | null; | |
1899 | key(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null; | |
1900 | key(optionalEncoding?: any): string | Uint8Array | null { | |
1901 | const offset = this.bb!.__offset(this.bb_pos, 4); | |
1902 | return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null; | |
1903 | } | |
1904 | ||
1905 | /** | |
1906 | * @param flatbuffers.Encoding= optionalEncoding | |
1907 | * @returns string|Uint8Array|null | |
1908 | */ | |
1909 | value(): string | null; | |
1910 | value(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null; | |
1911 | value(optionalEncoding?: any): string | Uint8Array | null { | |
1912 | const offset = this.bb!.__offset(this.bb_pos, 6); | |
1913 | return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null; | |
1914 | } | |
1915 | ||
1916 | /** | |
1917 | * @param flatbuffers.Builder builder | |
1918 | */ | |
1919 | static startKeyValue(builder: flatbuffers.Builder) { | |
1920 | builder.startObject(2); | |
1921 | } | |
1922 | ||
1923 | /** | |
1924 | * @param flatbuffers.Builder builder | |
1925 | * @param flatbuffers.Offset keyOffset | |
1926 | */ | |
1927 | static addKey(builder: flatbuffers.Builder, keyOffset: flatbuffers.Offset) { | |
1928 | builder.addFieldOffset(0, keyOffset, 0); | |
1929 | } | |
1930 | ||
1931 | /** | |
1932 | * @param flatbuffers.Builder builder | |
1933 | * @param flatbuffers.Offset valueOffset | |
1934 | */ | |
1935 | static addValue(builder: flatbuffers.Builder, valueOffset: flatbuffers.Offset) { | |
1936 | builder.addFieldOffset(1, valueOffset, 0); | |
1937 | } | |
1938 | ||
1939 | /** | |
1940 | * @param flatbuffers.Builder builder | |
1941 | * @returns flatbuffers.Offset | |
1942 | */ | |
1943 | static endKeyValue(builder: flatbuffers.Builder): flatbuffers.Offset { | |
1944 | const offset = builder.endObject(); | |
1945 | return offset; | |
1946 | } | |
1947 | ||
1948 | static createKeyValue(builder: flatbuffers.Builder, keyOffset: flatbuffers.Offset, valueOffset: flatbuffers.Offset): flatbuffers.Offset { | |
1949 | KeyValue.startKeyValue(builder); | |
1950 | KeyValue.addKey(builder, keyOffset); | |
1951 | KeyValue.addValue(builder, valueOffset); | |
1952 | return KeyValue.endKeyValue(builder); | |
1953 | } | |
1954 | } | |
1955 | /** | |
1956 | * @constructor | |
1957 | */ | |
1958 | export class DictionaryEncoding { | |
1959 | bb: flatbuffers.ByteBuffer | null = null; | |
1960 | ||
1961 | bb_pos: number = 0; | |
1962 | /** | |
1963 | * @param number i | |
1964 | * @param flatbuffers.ByteBuffer bb | |
1965 | * @returns DictionaryEncoding | |
1966 | */ | |
1967 | __init(i: number, bb: flatbuffers.ByteBuffer): DictionaryEncoding { | |
1968 | this.bb_pos = i; | |
1969 | this.bb = bb; | |
1970 | return this; | |
1971 | } | |
1972 | ||
1973 | /** | |
1974 | * @param flatbuffers.ByteBuffer bb | |
1975 | * @param DictionaryEncoding= obj | |
1976 | * @returns DictionaryEncoding | |
1977 | */ | |
1978 | static getRootAsDictionaryEncoding(bb: flatbuffers.ByteBuffer, obj?: DictionaryEncoding): DictionaryEncoding { | |
1979 | return (obj || new DictionaryEncoding()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
1980 | } | |
1981 | ||
1982 | /** | |
1983 | * @param flatbuffers.ByteBuffer bb | |
1984 | * @param DictionaryEncoding= obj | |
1985 | * @returns DictionaryEncoding | |
1986 | */ | |
1987 | static getSizePrefixedRootAsDictionaryEncoding(bb: flatbuffers.ByteBuffer, obj?: DictionaryEncoding): DictionaryEncoding { | |
1988 | bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); | |
1989 | return (obj || new DictionaryEncoding()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
1990 | } | |
1991 | ||
1992 | /** | |
1993 | * The known dictionary id in the application where this data is used. In | |
1994 | * the file or streaming formats, the dictionary ids are found in the | |
1995 | * DictionaryBatch messages | |
1996 | * | |
1997 | * @returns flatbuffers.Long | |
1998 | */ | |
1999 | id(): flatbuffers.Long { | |
2000 | const offset = this.bb!.__offset(this.bb_pos, 4); | |
2001 | return offset ? this.bb!.readInt64(this.bb_pos + offset) : this.bb!.createLong(0, 0); | |
2002 | } | |
2003 | ||
2004 | /** | |
2005 | * The dictionary indices are constrained to be non-negative integers. If | |
2006 | * this field is null, the indices must be signed int32. To maximize | |
2007 | * cross-language compatibility and performance, implementations are | |
2008 | * recommended to prefer signed integer types over unsigned integer types | |
2009 | * and to avoid uint64 indices unless they are required by an application. | |
2010 | * | |
2011 | * @param Int= obj | |
2012 | * @returns Int|null | |
2013 | */ | |
2014 | indexType(obj?: Int): Int | null { | |
2015 | const offset = this.bb!.__offset(this.bb_pos, 6); | |
2016 | return offset ? (obj || new Int()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null; | |
2017 | } | |
2018 | ||
2019 | /** | |
2020 | * By default, dictionaries are not ordered, or the order does not have | |
2021 | * semantic meaning. In some statistical, applications, dictionary-encoding | |
2022 | * is used to represent ordered categorical data, and we provide a way to | |
2023 | * preserve that metadata here | |
2024 | * | |
2025 | * @returns boolean | |
2026 | */ | |
2027 | isOrdered(): boolean { | |
2028 | const offset = this.bb!.__offset(this.bb_pos, 8); | |
2029 | return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false; | |
2030 | } | |
2031 | ||
2032 | /** | |
2033 | * @returns DictionaryKind | |
2034 | */ | |
2035 | dictionaryKind(): DictionaryKind { | |
2036 | const offset = this.bb!.__offset(this.bb_pos, 10); | |
2037 | return offset ? /** */ (this.bb!.readInt16(this.bb_pos + offset)) : DictionaryKind.DenseArray; | |
2038 | } | |
2039 | ||
2040 | /** | |
2041 | * @param flatbuffers.Builder builder | |
2042 | */ | |
2043 | static startDictionaryEncoding(builder: flatbuffers.Builder) { | |
2044 | builder.startObject(4); | |
2045 | } | |
2046 | ||
2047 | /** | |
2048 | * @param flatbuffers.Builder builder | |
2049 | * @param flatbuffers.Long id | |
2050 | */ | |
2051 | static addId(builder: flatbuffers.Builder, id: flatbuffers.Long) { | |
2052 | builder.addFieldInt64(0, id, builder.createLong(0, 0)); | |
2053 | } | |
2054 | ||
2055 | /** | |
2056 | * @param flatbuffers.Builder builder | |
2057 | * @param flatbuffers.Offset indexTypeOffset | |
2058 | */ | |
2059 | static addIndexType(builder: flatbuffers.Builder, indexTypeOffset: flatbuffers.Offset) { | |
2060 | builder.addFieldOffset(1, indexTypeOffset, 0); | |
2061 | } | |
2062 | ||
2063 | /** | |
2064 | * @param flatbuffers.Builder builder | |
2065 | * @param boolean isOrdered | |
2066 | */ | |
2067 | static addIsOrdered(builder: flatbuffers.Builder, isOrdered: boolean) { | |
2068 | builder.addFieldInt8(2, +isOrdered, +false); | |
2069 | } | |
2070 | ||
2071 | /** | |
2072 | * @param flatbuffers.Builder builder | |
2073 | * @param DictionaryKind dictionaryKind | |
2074 | */ | |
2075 | static addDictionaryKind(builder: flatbuffers.Builder, dictionaryKind: DictionaryKind) { | |
2076 | builder.addFieldInt16(3, dictionaryKind, DictionaryKind.DenseArray); | |
2077 | } | |
2078 | ||
2079 | /** | |
2080 | * @param flatbuffers.Builder builder | |
2081 | * @returns flatbuffers.Offset | |
2082 | */ | |
2083 | static endDictionaryEncoding(builder: flatbuffers.Builder): flatbuffers.Offset { | |
2084 | const offset = builder.endObject(); | |
2085 | return offset; | |
2086 | } | |
2087 | ||
2088 | static createDictionaryEncoding(builder: flatbuffers.Builder, id: flatbuffers.Long, indexTypeOffset: flatbuffers.Offset, isOrdered: boolean, dictionaryKind: DictionaryKind): flatbuffers.Offset { | |
2089 | DictionaryEncoding.startDictionaryEncoding(builder); | |
2090 | DictionaryEncoding.addId(builder, id); | |
2091 | DictionaryEncoding.addIndexType(builder, indexTypeOffset); | |
2092 | DictionaryEncoding.addIsOrdered(builder, isOrdered); | |
2093 | DictionaryEncoding.addDictionaryKind(builder, dictionaryKind); | |
2094 | return DictionaryEncoding.endDictionaryEncoding(builder); | |
2095 | } | |
2096 | } | |
2097 | /** | |
2098 | * ---------------------------------------------------------------------- | |
2099 | * A field represents a named column in a record / row batch or child of a | |
2100 | * nested type. | |
2101 | * | |
2102 | * @constructor | |
2103 | */ | |
2104 | export class Field { | |
2105 | bb: flatbuffers.ByteBuffer | null = null; | |
2106 | ||
2107 | bb_pos: number = 0; | |
2108 | /** | |
2109 | * @param number i | |
2110 | * @param flatbuffers.ByteBuffer bb | |
2111 | * @returns Field | |
2112 | */ | |
2113 | __init(i: number, bb: flatbuffers.ByteBuffer): Field { | |
2114 | this.bb_pos = i; | |
2115 | this.bb = bb; | |
2116 | return this; | |
2117 | } | |
2118 | ||
2119 | /** | |
2120 | * @param flatbuffers.ByteBuffer bb | |
2121 | * @param Field= obj | |
2122 | * @returns Field | |
2123 | */ | |
2124 | static getRootAsField(bb: flatbuffers.ByteBuffer, obj?: Field): Field { | |
2125 | return (obj || new Field()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
2126 | } | |
2127 | ||
2128 | /** | |
2129 | * @param flatbuffers.ByteBuffer bb | |
2130 | * @param Field= obj | |
2131 | * @returns Field | |
2132 | */ | |
2133 | static getSizePrefixedRootAsField(bb: flatbuffers.ByteBuffer, obj?: Field): Field { | |
2134 | bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); | |
2135 | return (obj || new Field()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
2136 | } | |
2137 | ||
2138 | /** | |
2139 | * Name is not required, in i.e. a List | |
2140 | * | |
2141 | * @param flatbuffers.Encoding= optionalEncoding | |
2142 | * @returns string|Uint8Array|null | |
2143 | */ | |
2144 | name(): string | null; | |
2145 | name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null; | |
2146 | name(optionalEncoding?: any): string | Uint8Array | null { | |
2147 | const offset = this.bb!.__offset(this.bb_pos, 4); | |
2148 | return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null; | |
2149 | } | |
2150 | ||
2151 | /** | |
2152 | * Whether or not this field can contain nulls. Should be true in general. | |
2153 | * | |
2154 | * @returns boolean | |
2155 | */ | |
2156 | nullable(): boolean { | |
2157 | const offset = this.bb!.__offset(this.bb_pos, 6); | |
2158 | return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false; | |
2159 | } | |
2160 | ||
2161 | /** | |
2162 | * @returns Type | |
2163 | */ | |
2164 | typeType(): Type { | |
2165 | const offset = this.bb!.__offset(this.bb_pos, 8); | |
2166 | return offset ? /** */ (this.bb!.readUint8(this.bb_pos + offset)) : Type.NONE; | |
2167 | } | |
2168 | ||
2169 | /** | |
2170 | * This is the type of the decoded value if the field is dictionary encoded. | |
2171 | * | |
2172 | * @param flatbuffers.Table obj | |
2173 | * @returns ?flatbuffers.Table | |
2174 | */ | |
2175 | type<T extends flatbuffers.Table>(obj: T): T | null { | |
2176 | const offset = this.bb!.__offset(this.bb_pos, 10); | |
2177 | return offset ? this.bb!.__union(obj, this.bb_pos + offset) : null; | |
2178 | } | |
2179 | ||
2180 | /** | |
2181 | * Present only if the field is dictionary encoded. | |
2182 | * | |
2183 | * @param DictionaryEncoding= obj | |
2184 | * @returns DictionaryEncoding|null | |
2185 | */ | |
2186 | dictionary(obj?: DictionaryEncoding): DictionaryEncoding | null { | |
2187 | const offset = this.bb!.__offset(this.bb_pos, 12); | |
2188 | return offset ? (obj || new DictionaryEncoding()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null; | |
2189 | } | |
2190 | ||
2191 | /** | |
2192 | * children apply only to nested data types like Struct, List and Union. For | |
2193 | * primitive types children will have length 0. | |
2194 | * | |
2195 | * @param number index | |
2196 | * @param Field= obj | |
2197 | * @returns Field | |
2198 | */ | |
2199 | children(index: number, obj?: Field): Field | null { | |
2200 | const offset = this.bb!.__offset(this.bb_pos, 14); | |
2201 | return offset ? (obj || new Field()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null; | |
2202 | } | |
2203 | ||
2204 | /** | |
2205 | * @returns number | |
2206 | */ | |
2207 | childrenLength(): number { | |
2208 | const offset = this.bb!.__offset(this.bb_pos, 14); | |
2209 | return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; | |
2210 | } | |
2211 | ||
2212 | /** | |
2213 | * User-defined metadata | |
2214 | * | |
2215 | * @param number index | |
2216 | * @param KeyValue= obj | |
2217 | * @returns KeyValue | |
2218 | */ | |
2219 | customMetadata(index: number, obj?: KeyValue): KeyValue | null { | |
2220 | const offset = this.bb!.__offset(this.bb_pos, 16); | |
2221 | return offset ? (obj || new KeyValue()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null; | |
2222 | } | |
2223 | ||
2224 | /** | |
2225 | * @returns number | |
2226 | */ | |
2227 | customMetadataLength(): number { | |
2228 | const offset = this.bb!.__offset(this.bb_pos, 16); | |
2229 | return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; | |
2230 | } | |
2231 | ||
2232 | /** | |
2233 | * @param flatbuffers.Builder builder | |
2234 | */ | |
2235 | static startField(builder: flatbuffers.Builder) { | |
2236 | builder.startObject(7); | |
2237 | } | |
2238 | ||
2239 | /** | |
2240 | * @param flatbuffers.Builder builder | |
2241 | * @param flatbuffers.Offset nameOffset | |
2242 | */ | |
2243 | static addName(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset) { | |
2244 | builder.addFieldOffset(0, nameOffset, 0); | |
2245 | } | |
2246 | ||
2247 | /** | |
2248 | * @param flatbuffers.Builder builder | |
2249 | * @param boolean nullable | |
2250 | */ | |
2251 | static addNullable(builder: flatbuffers.Builder, nullable: boolean) { | |
2252 | builder.addFieldInt8(1, +nullable, +false); | |
2253 | } | |
2254 | ||
2255 | /** | |
2256 | * @param flatbuffers.Builder builder | |
2257 | * @param Type typeType | |
2258 | */ | |
2259 | static addTypeType(builder: flatbuffers.Builder, typeType: Type) { | |
2260 | builder.addFieldInt8(2, typeType, Type.NONE); | |
2261 | } | |
2262 | ||
2263 | /** | |
2264 | * @param flatbuffers.Builder builder | |
2265 | * @param flatbuffers.Offset typeOffset | |
2266 | */ | |
2267 | static addType(builder: flatbuffers.Builder, typeOffset: flatbuffers.Offset) { | |
2268 | builder.addFieldOffset(3, typeOffset, 0); | |
2269 | } | |
2270 | ||
2271 | /** | |
2272 | * @param flatbuffers.Builder builder | |
2273 | * @param flatbuffers.Offset dictionaryOffset | |
2274 | */ | |
2275 | static addDictionary(builder: flatbuffers.Builder, dictionaryOffset: flatbuffers.Offset) { | |
2276 | builder.addFieldOffset(4, dictionaryOffset, 0); | |
2277 | } | |
2278 | ||
2279 | /** | |
2280 | * @param flatbuffers.Builder builder | |
2281 | * @param flatbuffers.Offset childrenOffset | |
2282 | */ | |
2283 | static addChildren(builder: flatbuffers.Builder, childrenOffset: flatbuffers.Offset) { | |
2284 | builder.addFieldOffset(5, childrenOffset, 0); | |
2285 | } | |
2286 | ||
2287 | /** | |
2288 | * @param flatbuffers.Builder builder | |
2289 | * @param Array.<flatbuffers.Offset> data | |
2290 | * @returns flatbuffers.Offset | |
2291 | */ | |
2292 | static createChildrenVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset { | |
2293 | builder.startVector(4, data.length, 4); | |
2294 | for (let i = data.length - 1; i >= 0; i--) { | |
2295 | builder.addOffset(data[i]); | |
2296 | } | |
2297 | return builder.endVector(); | |
2298 | } | |
2299 | ||
2300 | /** | |
2301 | * @param flatbuffers.Builder builder | |
2302 | * @param number numElems | |
2303 | */ | |
2304 | static startChildrenVector(builder: flatbuffers.Builder, numElems: number) { | |
2305 | builder.startVector(4, numElems, 4); | |
2306 | } | |
2307 | ||
2308 | /** | |
2309 | * @param flatbuffers.Builder builder | |
2310 | * @param flatbuffers.Offset customMetadataOffset | |
2311 | */ | |
2312 | static addCustomMetadata(builder: flatbuffers.Builder, customMetadataOffset: flatbuffers.Offset) { | |
2313 | builder.addFieldOffset(6, customMetadataOffset, 0); | |
2314 | } | |
2315 | ||
2316 | /** | |
2317 | * @param flatbuffers.Builder builder | |
2318 | * @param Array.<flatbuffers.Offset> data | |
2319 | * @returns flatbuffers.Offset | |
2320 | */ | |
2321 | static createCustomMetadataVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset { | |
2322 | builder.startVector(4, data.length, 4); | |
2323 | for (let i = data.length - 1; i >= 0; i--) { | |
2324 | builder.addOffset(data[i]); | |
2325 | } | |
2326 | return builder.endVector(); | |
2327 | } | |
2328 | ||
2329 | /** | |
2330 | * @param flatbuffers.Builder builder | |
2331 | * @param number numElems | |
2332 | */ | |
2333 | static startCustomMetadataVector(builder: flatbuffers.Builder, numElems: number) { | |
2334 | builder.startVector(4, numElems, 4); | |
2335 | } | |
2336 | ||
2337 | /** | |
2338 | * @param flatbuffers.Builder builder | |
2339 | * @returns flatbuffers.Offset | |
2340 | */ | |
2341 | static endField(builder: flatbuffers.Builder): flatbuffers.Offset { | |
2342 | const offset = builder.endObject(); | |
2343 | return offset; | |
2344 | } | |
2345 | ||
2346 | static createField(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset, nullable: boolean, typeType: Type, typeOffset: flatbuffers.Offset, dictionaryOffset: flatbuffers.Offset, childrenOffset: flatbuffers.Offset, customMetadataOffset: flatbuffers.Offset): flatbuffers.Offset { | |
2347 | Field.startField(builder); | |
2348 | Field.addName(builder, nameOffset); | |
2349 | Field.addNullable(builder, nullable); | |
2350 | Field.addTypeType(builder, typeType); | |
2351 | Field.addType(builder, typeOffset); | |
2352 | Field.addDictionary(builder, dictionaryOffset); | |
2353 | Field.addChildren(builder, childrenOffset); | |
2354 | Field.addCustomMetadata(builder, customMetadataOffset); | |
2355 | return Field.endField(builder); | |
2356 | } | |
2357 | } | |
2358 | /** | |
2359 | * ---------------------------------------------------------------------- | |
2360 | * A Buffer represents a single contiguous memory segment | |
2361 | * | |
2362 | * @constructor | |
2363 | */ | |
2364 | export class Buffer { | |
2365 | bb: flatbuffers.ByteBuffer | null = null; | |
2366 | ||
2367 | bb_pos: number = 0; | |
2368 | /** | |
2369 | * @param number i | |
2370 | * @param flatbuffers.ByteBuffer bb | |
2371 | * @returns Buffer | |
2372 | */ | |
2373 | __init(i: number, bb: flatbuffers.ByteBuffer): Buffer { | |
2374 | this.bb_pos = i; | |
2375 | this.bb = bb; | |
2376 | return this; | |
2377 | } | |
2378 | ||
2379 | /** | |
2380 | * The relative offset into the shared memory page where the bytes for this | |
2381 | * buffer starts | |
2382 | * | |
2383 | * @returns flatbuffers.Long | |
2384 | */ | |
2385 | offset(): flatbuffers.Long { | |
2386 | return this.bb!.readInt64(this.bb_pos); | |
2387 | } | |
2388 | ||
2389 | /** | |
2390 | * The absolute length (in bytes) of the memory buffer. The memory is found | |
2391 | * from offset (inclusive) to offset + length (non-inclusive). When building | |
2392 | * messages using the encapsulated IPC message, padding bytes may be written | |
2393 | * after a buffer, but such padding bytes do not need to be accounted for in | |
2394 | * the size here. | |
2395 | * | |
2396 | * @returns flatbuffers.Long | |
2397 | */ | |
2398 | length(): flatbuffers.Long { | |
2399 | return this.bb!.readInt64(this.bb_pos + 8); | |
2400 | } | |
2401 | ||
2402 | /** | |
2403 | * @param flatbuffers.Builder builder | |
2404 | * @param flatbuffers.Long offset | |
2405 | * @param flatbuffers.Long length | |
2406 | * @returns flatbuffers.Offset | |
2407 | */ | |
2408 | static createBuffer(builder: flatbuffers.Builder, offset: flatbuffers.Long, length: flatbuffers.Long): flatbuffers.Offset { | |
2409 | builder.prep(8, 16); | |
2410 | builder.writeInt64(length); | |
2411 | builder.writeInt64(offset); | |
2412 | return builder.offset(); | |
2413 | } | |
2414 | ||
2415 | } | |
2416 | /** | |
2417 | * ---------------------------------------------------------------------- | |
2418 | * A Schema describes the columns in a row batch | |
2419 | * | |
2420 | * @constructor | |
2421 | */ | |
2422 | export class Schema { | |
2423 | bb: flatbuffers.ByteBuffer | null = null; | |
2424 | ||
2425 | bb_pos: number = 0; | |
2426 | /** | |
2427 | * @param number i | |
2428 | * @param flatbuffers.ByteBuffer bb | |
2429 | * @returns Schema | |
2430 | */ | |
2431 | __init(i: number, bb: flatbuffers.ByteBuffer): Schema { | |
2432 | this.bb_pos = i; | |
2433 | this.bb = bb; | |
2434 | return this; | |
2435 | } | |
2436 | ||
2437 | /** | |
2438 | * @param flatbuffers.ByteBuffer bb | |
2439 | * @param Schema= obj | |
2440 | * @returns Schema | |
2441 | */ | |
2442 | static getRootAsSchema(bb: flatbuffers.ByteBuffer, obj?: Schema): Schema { | |
2443 | return (obj || new Schema()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
2444 | } | |
2445 | ||
2446 | /** | |
2447 | * @param flatbuffers.ByteBuffer bb | |
2448 | * @param Schema= obj | |
2449 | * @returns Schema | |
2450 | */ | |
2451 | static getSizePrefixedRootAsSchema(bb: flatbuffers.ByteBuffer, obj?: Schema): Schema { | |
2452 | bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); | |
2453 | return (obj || new Schema()).__init(bb.readInt32(bb.position()) + bb.position(), bb); | |
2454 | } | |
2455 | ||
2456 | /** | |
2457 | * endianness of the buffer | |
2458 | * it is Little Endian by default | |
2459 | * if endianness doesn't match the underlying system then the vectors need to be converted | |
2460 | * | |
2461 | * @returns Endianness | |
2462 | */ | |
2463 | endianness(): Endianness { | |
2464 | const offset = this.bb!.__offset(this.bb_pos, 4); | |
2465 | return offset ? /** */ (this.bb!.readInt16(this.bb_pos + offset)) : Endianness.Little; | |
2466 | } | |
2467 | ||
2468 | /** | |
2469 | * @param number index | |
2470 | * @param Field= obj | |
2471 | * @returns Field | |
2472 | */ | |
2473 | fields(index: number, obj?: Field): Field | null { | |
2474 | const offset = this.bb!.__offset(this.bb_pos, 6); | |
2475 | return offset ? (obj || new Field()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null; | |
2476 | } | |
2477 | ||
2478 | /** | |
2479 | * @returns number | |
2480 | */ | |
2481 | fieldsLength(): number { | |
2482 | const offset = this.bb!.__offset(this.bb_pos, 6); | |
2483 | return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; | |
2484 | } | |
2485 | ||
2486 | /** | |
2487 | * @param number index | |
2488 | * @param KeyValue= obj | |
2489 | * @returns KeyValue | |
2490 | */ | |
2491 | customMetadata(index: number, obj?: KeyValue): KeyValue | null { | |
2492 | const offset = this.bb!.__offset(this.bb_pos, 8); | |
2493 | return offset ? (obj || new KeyValue()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null; | |
2494 | } | |
2495 | ||
2496 | /** | |
2497 | * @returns number | |
2498 | */ | |
2499 | customMetadataLength(): number { | |
2500 | const offset = this.bb!.__offset(this.bb_pos, 8); | |
2501 | return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; | |
2502 | } | |
2503 | ||
2504 | /** | |
2505 | * Features used in the stream/file. | |
2506 | * | |
2507 | * @param number index | |
2508 | * @returns flatbuffers.Long | |
2509 | */ | |
2510 | features(index: number): flatbuffers.Long | null { | |
2511 | const offset = this.bb!.__offset(this.bb_pos, 10); | |
2512 | return offset ? /** */ (this.bb!.readInt64(this.bb!.__vector(this.bb_pos + offset) + index * 8)) : this.bb!.createLong(0, 0); | |
2513 | } | |
2514 | ||
2515 | /** | |
2516 | * @returns number | |
2517 | */ | |
2518 | featuresLength(): number { | |
2519 | const offset = this.bb!.__offset(this.bb_pos, 10); | |
2520 | return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; | |
2521 | } | |
2522 | ||
2523 | /** | |
2524 | * @param flatbuffers.Builder builder | |
2525 | */ | |
2526 | static startSchema(builder: flatbuffers.Builder) { | |
2527 | builder.startObject(4); | |
2528 | } | |
2529 | ||
2530 | /** | |
2531 | * @param flatbuffers.Builder builder | |
2532 | * @param Endianness endianness | |
2533 | */ | |
2534 | static addEndianness(builder: flatbuffers.Builder, endianness: Endianness) { | |
2535 | builder.addFieldInt16(0, endianness, Endianness.Little); | |
2536 | } | |
2537 | ||
2538 | /** | |
2539 | * @param flatbuffers.Builder builder | |
2540 | * @param flatbuffers.Offset fieldsOffset | |
2541 | */ | |
2542 | static addFields(builder: flatbuffers.Builder, fieldsOffset: flatbuffers.Offset) { | |
2543 | builder.addFieldOffset(1, fieldsOffset, 0); | |
2544 | } | |
2545 | ||
2546 | /** | |
2547 | * @param flatbuffers.Builder builder | |
2548 | * @param Array.<flatbuffers.Offset> data | |
2549 | * @returns flatbuffers.Offset | |
2550 | */ | |
2551 | static createFieldsVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset { | |
2552 | builder.startVector(4, data.length, 4); | |
2553 | for (let i = data.length - 1; i >= 0; i--) { | |
2554 | builder.addOffset(data[i]); | |
2555 | } | |
2556 | return builder.endVector(); | |
2557 | } | |
2558 | ||
2559 | /** | |
2560 | * @param flatbuffers.Builder builder | |
2561 | * @param number numElems | |
2562 | */ | |
2563 | static startFieldsVector(builder: flatbuffers.Builder, numElems: number) { | |
2564 | builder.startVector(4, numElems, 4); | |
2565 | } | |
2566 | ||
2567 | /** | |
2568 | * @param flatbuffers.Builder builder | |
2569 | * @param flatbuffers.Offset customMetadataOffset | |
2570 | */ | |
2571 | static addCustomMetadata(builder: flatbuffers.Builder, customMetadataOffset: flatbuffers.Offset) { | |
2572 | builder.addFieldOffset(2, customMetadataOffset, 0); | |
2573 | } | |
2574 | ||
2575 | /** | |
2576 | * @param flatbuffers.Builder builder | |
2577 | * @param Array.<flatbuffers.Offset> data | |
2578 | * @returns flatbuffers.Offset | |
2579 | */ | |
2580 | static createCustomMetadataVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset { | |
2581 | builder.startVector(4, data.length, 4); | |
2582 | for (let i = data.length - 1; i >= 0; i--) { | |
2583 | builder.addOffset(data[i]); | |
2584 | } | |
2585 | return builder.endVector(); | |
2586 | } | |
2587 | ||
2588 | /** | |
2589 | * @param flatbuffers.Builder builder | |
2590 | * @param number numElems | |
2591 | */ | |
2592 | static startCustomMetadataVector(builder: flatbuffers.Builder, numElems: number) { | |
2593 | builder.startVector(4, numElems, 4); | |
2594 | } | |
2595 | ||
2596 | /** | |
2597 | * @param flatbuffers.Builder builder | |
2598 | * @param flatbuffers.Offset featuresOffset | |
2599 | */ | |
2600 | static addFeatures(builder: flatbuffers.Builder, featuresOffset: flatbuffers.Offset) { | |
2601 | builder.addFieldOffset(3, featuresOffset, 0); | |
2602 | } | |
2603 | ||
2604 | /** | |
2605 | * @param flatbuffers.Builder builder | |
2606 | * @param Array.<flatbuffers.Long> data | |
2607 | * @returns flatbuffers.Offset | |
2608 | */ | |
2609 | static createFeaturesVector(builder: flatbuffers.Builder, data: flatbuffers.Long[]): flatbuffers.Offset { | |
2610 | builder.startVector(8, data.length, 8); | |
2611 | for (let i = data.length - 1; i >= 0; i--) { | |
2612 | builder.addInt64(data[i]); | |
2613 | } | |
2614 | return builder.endVector(); | |
2615 | } | |
2616 | ||
2617 | /** | |
2618 | * @param flatbuffers.Builder builder | |
2619 | * @param number numElems | |
2620 | */ | |
2621 | static startFeaturesVector(builder: flatbuffers.Builder, numElems: number) { | |
2622 | builder.startVector(8, numElems, 8); | |
2623 | } | |
2624 | ||
2625 | /** | |
2626 | * @param flatbuffers.Builder builder | |
2627 | * @returns flatbuffers.Offset | |
2628 | */ | |
2629 | static endSchema(builder: flatbuffers.Builder): flatbuffers.Offset { | |
2630 | const offset = builder.endObject(); | |
2631 | return offset; | |
2632 | } | |
2633 | ||
2634 | /** | |
2635 | * @param flatbuffers.Builder builder | |
2636 | * @param flatbuffers.Offset offset | |
2637 | */ | |
2638 | static finishSchemaBuffer(builder: flatbuffers.Builder, offset: flatbuffers.Offset) { | |
2639 | builder.finish(offset); | |
2640 | } | |
2641 | ||
2642 | /** | |
2643 | * @param flatbuffers.Builder builder | |
2644 | * @param flatbuffers.Offset offset | |
2645 | */ | |
2646 | static finishSizePrefixedSchemaBuffer(builder: flatbuffers.Builder, offset: flatbuffers.Offset) { | |
2647 | builder.finish(offset, undefined, true); | |
2648 | } | |
2649 | ||
2650 | static createSchema(builder: flatbuffers.Builder, endianness: Endianness, fieldsOffset: flatbuffers.Offset, customMetadataOffset: flatbuffers.Offset, featuresOffset: flatbuffers.Offset): flatbuffers.Offset { | |
2651 | Schema.startSchema(builder); | |
2652 | Schema.addEndianness(builder, endianness); | |
2653 | Schema.addFields(builder, fieldsOffset); | |
2654 | Schema.addCustomMetadata(builder, customMetadataOffset); | |
2655 | Schema.addFeatures(builder, featuresOffset); | |
2656 | return Schema.endSchema(builder); | |
2657 | } | |
2658 | } |