Austin Schuh | 2dd86a9 | 2022-09-14 21:19:23 -0700 | [diff] [blame^] | 1 | // automatically generated by the FlatBuffers compiler, do not modify |
| 2 | |
| 3 | import * as flatbuffers from 'flatbuffers'; |
| 4 | |
| 5 | |
| 6 | export enum BaseType { |
| 7 | None = 0, |
| 8 | UType = 1, |
| 9 | Bool = 2, |
| 10 | Byte = 3, |
| 11 | UByte = 4, |
| 12 | Short = 5, |
| 13 | UShort = 6, |
| 14 | Int = 7, |
| 15 | UInt = 8, |
| 16 | Long = 9, |
| 17 | ULong = 10, |
| 18 | Float = 11, |
| 19 | Double = 12, |
| 20 | String = 13, |
| 21 | Vector = 14, |
| 22 | Obj = 15, |
| 23 | Union = 16, |
| 24 | Array = 17, |
| 25 | MaxBaseType = 18 |
| 26 | } |
| 27 | |
| 28 | /** |
| 29 | * New schema language features that are not supported by old code generators. |
| 30 | */ |
| 31 | export enum AdvancedFeatures { |
| 32 | AdvancedArrayFeatures = '1', |
| 33 | AdvancedUnionFeatures = '2', |
| 34 | OptionalScalars = '4', |
| 35 | DefaultVectorsAndStrings = '8' |
| 36 | } |
| 37 | |
| 38 | export class Type { |
| 39 | bb: flatbuffers.ByteBuffer|null = null; |
| 40 | bb_pos = 0; |
| 41 | __init(i:number, bb:flatbuffers.ByteBuffer):Type { |
| 42 | this.bb_pos = i; |
| 43 | this.bb = bb; |
| 44 | return this; |
| 45 | } |
| 46 | |
| 47 | static getRootAsType(bb:flatbuffers.ByteBuffer, obj?:Type):Type { |
| 48 | return (obj || new Type()).__init(bb.readInt32(bb.position()) + bb.position(), bb); |
| 49 | } |
| 50 | |
| 51 | static getSizePrefixedRootAsType(bb:flatbuffers.ByteBuffer, obj?:Type):Type { |
| 52 | bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); |
| 53 | return (obj || new Type()).__init(bb.readInt32(bb.position()) + bb.position(), bb); |
| 54 | } |
| 55 | |
| 56 | baseType():BaseType { |
| 57 | const offset = this.bb!.__offset(this.bb_pos, 4); |
| 58 | return offset ? this.bb!.readInt8(this.bb_pos + offset) : BaseType.None; |
| 59 | } |
| 60 | |
| 61 | mutate_base_type(value:BaseType):boolean { |
| 62 | const offset = this.bb!.__offset(this.bb_pos, 4); |
| 63 | |
| 64 | if (offset === 0) { |
| 65 | return false; |
| 66 | } |
| 67 | |
| 68 | this.bb!.writeInt8(this.bb_pos + offset, value); |
| 69 | return true; |
| 70 | } |
| 71 | |
| 72 | element():BaseType { |
| 73 | const offset = this.bb!.__offset(this.bb_pos, 6); |
| 74 | return offset ? this.bb!.readInt8(this.bb_pos + offset) : BaseType.None; |
| 75 | } |
| 76 | |
| 77 | mutate_element(value:BaseType):boolean { |
| 78 | const offset = this.bb!.__offset(this.bb_pos, 6); |
| 79 | |
| 80 | if (offset === 0) { |
| 81 | return false; |
| 82 | } |
| 83 | |
| 84 | this.bb!.writeInt8(this.bb_pos + offset, value); |
| 85 | return true; |
| 86 | } |
| 87 | |
| 88 | index():number { |
| 89 | const offset = this.bb!.__offset(this.bb_pos, 8); |
| 90 | return offset ? this.bb!.readInt32(this.bb_pos + offset) : -1; |
| 91 | } |
| 92 | |
| 93 | mutate_index(value:number):boolean { |
| 94 | const offset = this.bb!.__offset(this.bb_pos, 8); |
| 95 | |
| 96 | if (offset === 0) { |
| 97 | return false; |
| 98 | } |
| 99 | |
| 100 | this.bb!.writeInt32(this.bb_pos + offset, value); |
| 101 | return true; |
| 102 | } |
| 103 | |
| 104 | fixedLength():number { |
| 105 | const offset = this.bb!.__offset(this.bb_pos, 10); |
| 106 | return offset ? this.bb!.readUint16(this.bb_pos + offset) : 0; |
| 107 | } |
| 108 | |
| 109 | mutate_fixed_length(value:number):boolean { |
| 110 | const offset = this.bb!.__offset(this.bb_pos, 10); |
| 111 | |
| 112 | if (offset === 0) { |
| 113 | return false; |
| 114 | } |
| 115 | |
| 116 | this.bb!.writeUint16(this.bb_pos + offset, value); |
| 117 | return true; |
| 118 | } |
| 119 | |
| 120 | /** |
| 121 | * The size (octets) of the `base_type` field. |
| 122 | */ |
| 123 | baseSize():number { |
| 124 | const offset = this.bb!.__offset(this.bb_pos, 12); |
| 125 | return offset ? this.bb!.readUint32(this.bb_pos + offset) : 4; |
| 126 | } |
| 127 | |
| 128 | mutate_base_size(value:number):boolean { |
| 129 | const offset = this.bb!.__offset(this.bb_pos, 12); |
| 130 | |
| 131 | if (offset === 0) { |
| 132 | return false; |
| 133 | } |
| 134 | |
| 135 | this.bb!.writeUint32(this.bb_pos + offset, value); |
| 136 | return true; |
| 137 | } |
| 138 | |
| 139 | /** |
| 140 | * The size (octets) of the `element` field, if present. |
| 141 | */ |
| 142 | elementSize():number { |
| 143 | const offset = this.bb!.__offset(this.bb_pos, 14); |
| 144 | return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0; |
| 145 | } |
| 146 | |
| 147 | mutate_element_size(value:number):boolean { |
| 148 | const offset = this.bb!.__offset(this.bb_pos, 14); |
| 149 | |
| 150 | if (offset === 0) { |
| 151 | return false; |
| 152 | } |
| 153 | |
| 154 | this.bb!.writeUint32(this.bb_pos + offset, value); |
| 155 | return true; |
| 156 | } |
| 157 | |
| 158 | static getFullyQualifiedName():string { |
| 159 | return 'reflection_Type'; |
| 160 | } |
| 161 | |
| 162 | static startType(builder:flatbuffers.Builder) { |
| 163 | builder.startObject(6); |
| 164 | } |
| 165 | |
| 166 | static addBaseType(builder:flatbuffers.Builder, baseType:BaseType) { |
| 167 | builder.addFieldInt8(0, baseType, BaseType.None); |
| 168 | } |
| 169 | |
| 170 | static addElement(builder:flatbuffers.Builder, element:BaseType) { |
| 171 | builder.addFieldInt8(1, element, BaseType.None); |
| 172 | } |
| 173 | |
| 174 | static addIndex(builder:flatbuffers.Builder, index:number) { |
| 175 | builder.addFieldInt32(2, index, -1); |
| 176 | } |
| 177 | |
| 178 | static addFixedLength(builder:flatbuffers.Builder, fixedLength:number) { |
| 179 | builder.addFieldInt16(3, fixedLength, 0); |
| 180 | } |
| 181 | |
| 182 | static addBaseSize(builder:flatbuffers.Builder, baseSize:number) { |
| 183 | builder.addFieldInt32(4, baseSize, 4); |
| 184 | } |
| 185 | |
| 186 | static addElementSize(builder:flatbuffers.Builder, elementSize:number) { |
| 187 | builder.addFieldInt32(5, elementSize, 0); |
| 188 | } |
| 189 | |
| 190 | static endType(builder:flatbuffers.Builder):flatbuffers.Offset { |
| 191 | const offset = builder.endObject(); |
| 192 | return offset; |
| 193 | } |
| 194 | |
| 195 | static createType(builder:flatbuffers.Builder, baseType:BaseType, element:BaseType, index:number, fixedLength:number, baseSize:number, elementSize:number):flatbuffers.Offset { |
| 196 | Type.startType(builder); |
| 197 | Type.addBaseType(builder, baseType); |
| 198 | Type.addElement(builder, element); |
| 199 | Type.addIndex(builder, index); |
| 200 | Type.addFixedLength(builder, fixedLength); |
| 201 | Type.addBaseSize(builder, baseSize); |
| 202 | Type.addElementSize(builder, elementSize); |
| 203 | return Type.endType(builder); |
| 204 | } |
| 205 | |
| 206 | unpack(): TypeT { |
| 207 | return new TypeT( |
| 208 | this.baseType(), |
| 209 | this.element(), |
| 210 | this.index(), |
| 211 | this.fixedLength(), |
| 212 | this.baseSize(), |
| 213 | this.elementSize() |
| 214 | ); |
| 215 | } |
| 216 | |
| 217 | |
| 218 | unpackTo(_o: TypeT): void { |
| 219 | _o.baseType = this.baseType(); |
| 220 | _o.element = this.element(); |
| 221 | _o.index = this.index(); |
| 222 | _o.fixedLength = this.fixedLength(); |
| 223 | _o.baseSize = this.baseSize(); |
| 224 | _o.elementSize = this.elementSize(); |
| 225 | } |
| 226 | } |
| 227 | |
| 228 | export class TypeT { |
| 229 | constructor( |
| 230 | public baseType: BaseType = BaseType.None, |
| 231 | public element: BaseType = BaseType.None, |
| 232 | public index: number = -1, |
| 233 | public fixedLength: number = 0, |
| 234 | public baseSize: number = 4, |
| 235 | public elementSize: number = 0 |
| 236 | ){} |
| 237 | |
| 238 | |
| 239 | pack(builder:flatbuffers.Builder): flatbuffers.Offset { |
| 240 | return Type.createType(builder, |
| 241 | this.baseType, |
| 242 | this.element, |
| 243 | this.index, |
| 244 | this.fixedLength, |
| 245 | this.baseSize, |
| 246 | this.elementSize |
| 247 | ); |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | export class KeyValue { |
| 252 | bb: flatbuffers.ByteBuffer|null = null; |
| 253 | bb_pos = 0; |
| 254 | __init(i:number, bb:flatbuffers.ByteBuffer):KeyValue { |
| 255 | this.bb_pos = i; |
| 256 | this.bb = bb; |
| 257 | return this; |
| 258 | } |
| 259 | |
| 260 | static getRootAsKeyValue(bb:flatbuffers.ByteBuffer, obj?:KeyValue):KeyValue { |
| 261 | return (obj || new KeyValue()).__init(bb.readInt32(bb.position()) + bb.position(), bb); |
| 262 | } |
| 263 | |
| 264 | static getSizePrefixedRootAsKeyValue(bb:flatbuffers.ByteBuffer, obj?:KeyValue):KeyValue { |
| 265 | bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); |
| 266 | return (obj || new KeyValue()).__init(bb.readInt32(bb.position()) + bb.position(), bb); |
| 267 | } |
| 268 | |
| 269 | key():string|null |
| 270 | key(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null |
| 271 | key(optionalEncoding?:any):string|Uint8Array|null { |
| 272 | const offset = this.bb!.__offset(this.bb_pos, 4); |
| 273 | return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null; |
| 274 | } |
| 275 | |
| 276 | value():string|null |
| 277 | value(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null |
| 278 | value(optionalEncoding?:any):string|Uint8Array|null { |
| 279 | const offset = this.bb!.__offset(this.bb_pos, 6); |
| 280 | return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null; |
| 281 | } |
| 282 | |
| 283 | static getFullyQualifiedName():string { |
| 284 | return 'reflection_KeyValue'; |
| 285 | } |
| 286 | |
| 287 | static startKeyValue(builder:flatbuffers.Builder) { |
| 288 | builder.startObject(2); |
| 289 | } |
| 290 | |
| 291 | static addKey(builder:flatbuffers.Builder, keyOffset:flatbuffers.Offset) { |
| 292 | builder.addFieldOffset(0, keyOffset, 0); |
| 293 | } |
| 294 | |
| 295 | static addValue(builder:flatbuffers.Builder, valueOffset:flatbuffers.Offset) { |
| 296 | builder.addFieldOffset(1, valueOffset, 0); |
| 297 | } |
| 298 | |
| 299 | static endKeyValue(builder:flatbuffers.Builder):flatbuffers.Offset { |
| 300 | const offset = builder.endObject(); |
| 301 | builder.requiredField(offset, 4) // key |
| 302 | return offset; |
| 303 | } |
| 304 | |
| 305 | static createKeyValue(builder:flatbuffers.Builder, keyOffset:flatbuffers.Offset, valueOffset:flatbuffers.Offset):flatbuffers.Offset { |
| 306 | KeyValue.startKeyValue(builder); |
| 307 | KeyValue.addKey(builder, keyOffset); |
| 308 | KeyValue.addValue(builder, valueOffset); |
| 309 | return KeyValue.endKeyValue(builder); |
| 310 | } |
| 311 | |
| 312 | unpack(): KeyValueT { |
| 313 | return new KeyValueT( |
| 314 | this.key(), |
| 315 | this.value() |
| 316 | ); |
| 317 | } |
| 318 | |
| 319 | |
| 320 | unpackTo(_o: KeyValueT): void { |
| 321 | _o.key = this.key(); |
| 322 | _o.value = this.value(); |
| 323 | } |
| 324 | } |
| 325 | |
| 326 | export class KeyValueT { |
| 327 | constructor( |
| 328 | public key: string|Uint8Array|null = null, |
| 329 | public value: string|Uint8Array|null = null |
| 330 | ){} |
| 331 | |
| 332 | |
| 333 | pack(builder:flatbuffers.Builder): flatbuffers.Offset { |
| 334 | const key = (this.key !== null ? builder.createString(this.key!) : 0); |
| 335 | const value = (this.value !== null ? builder.createString(this.value!) : 0); |
| 336 | |
| 337 | return KeyValue.createKeyValue(builder, |
| 338 | key, |
| 339 | value |
| 340 | ); |
| 341 | } |
| 342 | } |
| 343 | |
| 344 | export class EnumVal { |
| 345 | bb: flatbuffers.ByteBuffer|null = null; |
| 346 | bb_pos = 0; |
| 347 | __init(i:number, bb:flatbuffers.ByteBuffer):EnumVal { |
| 348 | this.bb_pos = i; |
| 349 | this.bb = bb; |
| 350 | return this; |
| 351 | } |
| 352 | |
| 353 | static getRootAsEnumVal(bb:flatbuffers.ByteBuffer, obj?:EnumVal):EnumVal { |
| 354 | return (obj || new EnumVal()).__init(bb.readInt32(bb.position()) + bb.position(), bb); |
| 355 | } |
| 356 | |
| 357 | static getSizePrefixedRootAsEnumVal(bb:flatbuffers.ByteBuffer, obj?:EnumVal):EnumVal { |
| 358 | bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); |
| 359 | return (obj || new EnumVal()).__init(bb.readInt32(bb.position()) + bb.position(), bb); |
| 360 | } |
| 361 | |
| 362 | name():string|null |
| 363 | name(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null |
| 364 | name(optionalEncoding?:any):string|Uint8Array|null { |
| 365 | const offset = this.bb!.__offset(this.bb_pos, 4); |
| 366 | return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null; |
| 367 | } |
| 368 | |
| 369 | value():bigint { |
| 370 | const offset = this.bb!.__offset(this.bb_pos, 6); |
| 371 | return offset ? this.bb!.readInt64(this.bb_pos + offset) : BigInt('0'); |
| 372 | } |
| 373 | |
| 374 | mutate_value(value:bigint):boolean { |
| 375 | const offset = this.bb!.__offset(this.bb_pos, 6); |
| 376 | |
| 377 | if (offset === 0) { |
| 378 | return false; |
| 379 | } |
| 380 | |
| 381 | this.bb!.writeInt64(this.bb_pos + offset, value); |
| 382 | return true; |
| 383 | } |
| 384 | |
| 385 | unionType(obj?:Type):Type|null { |
| 386 | const offset = this.bb!.__offset(this.bb_pos, 10); |
| 387 | return offset ? (obj || new Type()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null; |
| 388 | } |
| 389 | |
| 390 | documentation(index: number):string |
| 391 | documentation(index: number,optionalEncoding:flatbuffers.Encoding):string|Uint8Array |
| 392 | documentation(index: number,optionalEncoding?:any):string|Uint8Array|null { |
| 393 | const offset = this.bb!.__offset(this.bb_pos, 12); |
| 394 | return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null; |
| 395 | } |
| 396 | |
| 397 | documentationLength():number { |
| 398 | const offset = this.bb!.__offset(this.bb_pos, 12); |
| 399 | return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 400 | } |
| 401 | |
| 402 | static getFullyQualifiedName():string { |
| 403 | return 'reflection_EnumVal'; |
| 404 | } |
| 405 | |
| 406 | static startEnumVal(builder:flatbuffers.Builder) { |
| 407 | builder.startObject(5); |
| 408 | } |
| 409 | |
| 410 | static addName(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset) { |
| 411 | builder.addFieldOffset(0, nameOffset, 0); |
| 412 | } |
| 413 | |
| 414 | static addValue(builder:flatbuffers.Builder, value:bigint) { |
| 415 | builder.addFieldInt64(1, value, BigInt('0')); |
| 416 | } |
| 417 | |
| 418 | static addUnionType(builder:flatbuffers.Builder, unionTypeOffset:flatbuffers.Offset) { |
| 419 | builder.addFieldOffset(3, unionTypeOffset, 0); |
| 420 | } |
| 421 | |
| 422 | static addDocumentation(builder:flatbuffers.Builder, documentationOffset:flatbuffers.Offset) { |
| 423 | builder.addFieldOffset(4, documentationOffset, 0); |
| 424 | } |
| 425 | |
| 426 | static createDocumentationVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset { |
| 427 | builder.startVector(4, data.length, 4); |
| 428 | for (let i = data.length - 1; i >= 0; i--) { |
| 429 | builder.addOffset(data[i]!); |
| 430 | } |
| 431 | return builder.endVector(); |
| 432 | } |
| 433 | |
| 434 | static startDocumentationVector(builder:flatbuffers.Builder, numElems:number) { |
| 435 | builder.startVector(4, numElems, 4); |
| 436 | } |
| 437 | |
| 438 | static endEnumVal(builder:flatbuffers.Builder):flatbuffers.Offset { |
| 439 | const offset = builder.endObject(); |
| 440 | builder.requiredField(offset, 4) // name |
| 441 | return offset; |
| 442 | } |
| 443 | |
| 444 | |
| 445 | unpack(): EnumValT { |
| 446 | return new EnumValT( |
| 447 | this.name(), |
| 448 | this.value(), |
| 449 | (this.unionType() !== null ? this.unionType()!.unpack() : null), |
| 450 | this.bb!.createScalarList(this.documentation.bind(this), this.documentationLength()) |
| 451 | ); |
| 452 | } |
| 453 | |
| 454 | |
| 455 | unpackTo(_o: EnumValT): void { |
| 456 | _o.name = this.name(); |
| 457 | _o.value = this.value(); |
| 458 | _o.unionType = (this.unionType() !== null ? this.unionType()!.unpack() : null); |
| 459 | _o.documentation = this.bb!.createScalarList(this.documentation.bind(this), this.documentationLength()); |
| 460 | } |
| 461 | } |
| 462 | |
| 463 | export class EnumValT { |
| 464 | constructor( |
| 465 | public name: string|Uint8Array|null = null, |
| 466 | public value: bigint = BigInt('0'), |
| 467 | public unionType: TypeT|null = null, |
| 468 | public documentation: (string)[] = [] |
| 469 | ){} |
| 470 | |
| 471 | |
| 472 | pack(builder:flatbuffers.Builder): flatbuffers.Offset { |
| 473 | const name = (this.name !== null ? builder.createString(this.name!) : 0); |
| 474 | const unionType = (this.unionType !== null ? this.unionType!.pack(builder) : 0); |
| 475 | const documentation = EnumVal.createDocumentationVector(builder, builder.createObjectOffsetList(this.documentation)); |
| 476 | |
| 477 | EnumVal.startEnumVal(builder); |
| 478 | EnumVal.addName(builder, name); |
| 479 | EnumVal.addValue(builder, this.value); |
| 480 | EnumVal.addUnionType(builder, unionType); |
| 481 | EnumVal.addDocumentation(builder, documentation); |
| 482 | |
| 483 | return EnumVal.endEnumVal(builder); |
| 484 | } |
| 485 | } |
| 486 | |
| 487 | export class Enum { |
| 488 | bb: flatbuffers.ByteBuffer|null = null; |
| 489 | bb_pos = 0; |
| 490 | __init(i:number, bb:flatbuffers.ByteBuffer):Enum { |
| 491 | this.bb_pos = i; |
| 492 | this.bb = bb; |
| 493 | return this; |
| 494 | } |
| 495 | |
| 496 | static getRootAsEnum(bb:flatbuffers.ByteBuffer, obj?:Enum):Enum { |
| 497 | return (obj || new Enum()).__init(bb.readInt32(bb.position()) + bb.position(), bb); |
| 498 | } |
| 499 | |
| 500 | static getSizePrefixedRootAsEnum(bb:flatbuffers.ByteBuffer, obj?:Enum):Enum { |
| 501 | bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); |
| 502 | return (obj || new Enum()).__init(bb.readInt32(bb.position()) + bb.position(), bb); |
| 503 | } |
| 504 | |
| 505 | name():string|null |
| 506 | name(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null |
| 507 | name(optionalEncoding?:any):string|Uint8Array|null { |
| 508 | const offset = this.bb!.__offset(this.bb_pos, 4); |
| 509 | return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null; |
| 510 | } |
| 511 | |
| 512 | values(index: number, obj?:EnumVal):EnumVal|null { |
| 513 | const offset = this.bb!.__offset(this.bb_pos, 6); |
| 514 | return offset ? (obj || new EnumVal()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null; |
| 515 | } |
| 516 | |
| 517 | valuesLength():number { |
| 518 | const offset = this.bb!.__offset(this.bb_pos, 6); |
| 519 | return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 520 | } |
| 521 | |
| 522 | isUnion():boolean { |
| 523 | const offset = this.bb!.__offset(this.bb_pos, 8); |
| 524 | return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false; |
| 525 | } |
| 526 | |
| 527 | mutate_is_union(value:boolean):boolean { |
| 528 | const offset = this.bb!.__offset(this.bb_pos, 8); |
| 529 | |
| 530 | if (offset === 0) { |
| 531 | return false; |
| 532 | } |
| 533 | |
| 534 | this.bb!.writeInt8(this.bb_pos + offset, +value); |
| 535 | return true; |
| 536 | } |
| 537 | |
| 538 | underlyingType(obj?:Type):Type|null { |
| 539 | const offset = this.bb!.__offset(this.bb_pos, 10); |
| 540 | return offset ? (obj || new Type()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null; |
| 541 | } |
| 542 | |
| 543 | attributes(index: number, obj?:KeyValue):KeyValue|null { |
| 544 | const offset = this.bb!.__offset(this.bb_pos, 12); |
| 545 | return offset ? (obj || new KeyValue()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null; |
| 546 | } |
| 547 | |
| 548 | attributesLength():number { |
| 549 | const offset = this.bb!.__offset(this.bb_pos, 12); |
| 550 | return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 551 | } |
| 552 | |
| 553 | documentation(index: number):string |
| 554 | documentation(index: number,optionalEncoding:flatbuffers.Encoding):string|Uint8Array |
| 555 | documentation(index: number,optionalEncoding?:any):string|Uint8Array|null { |
| 556 | const offset = this.bb!.__offset(this.bb_pos, 14); |
| 557 | return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null; |
| 558 | } |
| 559 | |
| 560 | documentationLength():number { |
| 561 | const offset = this.bb!.__offset(this.bb_pos, 14); |
| 562 | return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 563 | } |
| 564 | |
| 565 | /** |
| 566 | * File that this Enum is declared in. |
| 567 | */ |
| 568 | declarationFile():string|null |
| 569 | declarationFile(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null |
| 570 | declarationFile(optionalEncoding?:any):string|Uint8Array|null { |
| 571 | const offset = this.bb!.__offset(this.bb_pos, 16); |
| 572 | return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null; |
| 573 | } |
| 574 | |
| 575 | static getFullyQualifiedName():string { |
| 576 | return 'reflection_Enum'; |
| 577 | } |
| 578 | |
| 579 | static startEnum(builder:flatbuffers.Builder) { |
| 580 | builder.startObject(7); |
| 581 | } |
| 582 | |
| 583 | static addName(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset) { |
| 584 | builder.addFieldOffset(0, nameOffset, 0); |
| 585 | } |
| 586 | |
| 587 | static addValues(builder:flatbuffers.Builder, valuesOffset:flatbuffers.Offset) { |
| 588 | builder.addFieldOffset(1, valuesOffset, 0); |
| 589 | } |
| 590 | |
| 591 | static createValuesVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset { |
| 592 | builder.startVector(4, data.length, 4); |
| 593 | for (let i = data.length - 1; i >= 0; i--) { |
| 594 | builder.addOffset(data[i]!); |
| 595 | } |
| 596 | return builder.endVector(); |
| 597 | } |
| 598 | |
| 599 | static startValuesVector(builder:flatbuffers.Builder, numElems:number) { |
| 600 | builder.startVector(4, numElems, 4); |
| 601 | } |
| 602 | |
| 603 | static addIsUnion(builder:flatbuffers.Builder, isUnion:boolean) { |
| 604 | builder.addFieldInt8(2, +isUnion, +false); |
| 605 | } |
| 606 | |
| 607 | static addUnderlyingType(builder:flatbuffers.Builder, underlyingTypeOffset:flatbuffers.Offset) { |
| 608 | builder.addFieldOffset(3, underlyingTypeOffset, 0); |
| 609 | } |
| 610 | |
| 611 | static addAttributes(builder:flatbuffers.Builder, attributesOffset:flatbuffers.Offset) { |
| 612 | builder.addFieldOffset(4, attributesOffset, 0); |
| 613 | } |
| 614 | |
| 615 | static createAttributesVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset { |
| 616 | builder.startVector(4, data.length, 4); |
| 617 | for (let i = data.length - 1; i >= 0; i--) { |
| 618 | builder.addOffset(data[i]!); |
| 619 | } |
| 620 | return builder.endVector(); |
| 621 | } |
| 622 | |
| 623 | static startAttributesVector(builder:flatbuffers.Builder, numElems:number) { |
| 624 | builder.startVector(4, numElems, 4); |
| 625 | } |
| 626 | |
| 627 | static addDocumentation(builder:flatbuffers.Builder, documentationOffset:flatbuffers.Offset) { |
| 628 | builder.addFieldOffset(5, documentationOffset, 0); |
| 629 | } |
| 630 | |
| 631 | static createDocumentationVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset { |
| 632 | builder.startVector(4, data.length, 4); |
| 633 | for (let i = data.length - 1; i >= 0; i--) { |
| 634 | builder.addOffset(data[i]!); |
| 635 | } |
| 636 | return builder.endVector(); |
| 637 | } |
| 638 | |
| 639 | static startDocumentationVector(builder:flatbuffers.Builder, numElems:number) { |
| 640 | builder.startVector(4, numElems, 4); |
| 641 | } |
| 642 | |
| 643 | static addDeclarationFile(builder:flatbuffers.Builder, declarationFileOffset:flatbuffers.Offset) { |
| 644 | builder.addFieldOffset(6, declarationFileOffset, 0); |
| 645 | } |
| 646 | |
| 647 | static endEnum(builder:flatbuffers.Builder):flatbuffers.Offset { |
| 648 | const offset = builder.endObject(); |
| 649 | builder.requiredField(offset, 4) // name |
| 650 | builder.requiredField(offset, 6) // values |
| 651 | builder.requiredField(offset, 10) // underlying_type |
| 652 | return offset; |
| 653 | } |
| 654 | |
| 655 | |
| 656 | unpack(): EnumT { |
| 657 | return new EnumT( |
| 658 | this.name(), |
| 659 | this.bb!.createObjList(this.values.bind(this), this.valuesLength()), |
| 660 | this.isUnion(), |
| 661 | (this.underlyingType() !== null ? this.underlyingType()!.unpack() : null), |
| 662 | this.bb!.createObjList(this.attributes.bind(this), this.attributesLength()), |
| 663 | this.bb!.createScalarList(this.documentation.bind(this), this.documentationLength()), |
| 664 | this.declarationFile() |
| 665 | ); |
| 666 | } |
| 667 | |
| 668 | |
| 669 | unpackTo(_o: EnumT): void { |
| 670 | _o.name = this.name(); |
| 671 | _o.values = this.bb!.createObjList(this.values.bind(this), this.valuesLength()); |
| 672 | _o.isUnion = this.isUnion(); |
| 673 | _o.underlyingType = (this.underlyingType() !== null ? this.underlyingType()!.unpack() : null); |
| 674 | _o.attributes = this.bb!.createObjList(this.attributes.bind(this), this.attributesLength()); |
| 675 | _o.documentation = this.bb!.createScalarList(this.documentation.bind(this), this.documentationLength()); |
| 676 | _o.declarationFile = this.declarationFile(); |
| 677 | } |
| 678 | } |
| 679 | |
| 680 | export class EnumT { |
| 681 | constructor( |
| 682 | public name: string|Uint8Array|null = null, |
| 683 | public values: (EnumValT)[] = [], |
| 684 | public isUnion: boolean = false, |
| 685 | public underlyingType: TypeT|null = null, |
| 686 | public attributes: (KeyValueT)[] = [], |
| 687 | public documentation: (string)[] = [], |
| 688 | public declarationFile: string|Uint8Array|null = null |
| 689 | ){} |
| 690 | |
| 691 | |
| 692 | pack(builder:flatbuffers.Builder): flatbuffers.Offset { |
| 693 | const name = (this.name !== null ? builder.createString(this.name!) : 0); |
| 694 | const values = Enum.createValuesVector(builder, builder.createObjectOffsetList(this.values)); |
| 695 | const underlyingType = (this.underlyingType !== null ? this.underlyingType!.pack(builder) : 0); |
| 696 | const attributes = Enum.createAttributesVector(builder, builder.createObjectOffsetList(this.attributes)); |
| 697 | const documentation = Enum.createDocumentationVector(builder, builder.createObjectOffsetList(this.documentation)); |
| 698 | const declarationFile = (this.declarationFile !== null ? builder.createString(this.declarationFile!) : 0); |
| 699 | |
| 700 | Enum.startEnum(builder); |
| 701 | Enum.addName(builder, name); |
| 702 | Enum.addValues(builder, values); |
| 703 | Enum.addIsUnion(builder, this.isUnion); |
| 704 | Enum.addUnderlyingType(builder, underlyingType); |
| 705 | Enum.addAttributes(builder, attributes); |
| 706 | Enum.addDocumentation(builder, documentation); |
| 707 | Enum.addDeclarationFile(builder, declarationFile); |
| 708 | |
| 709 | return Enum.endEnum(builder); |
| 710 | } |
| 711 | } |
| 712 | |
| 713 | export class Field { |
| 714 | bb: flatbuffers.ByteBuffer|null = null; |
| 715 | bb_pos = 0; |
| 716 | __init(i:number, bb:flatbuffers.ByteBuffer):Field { |
| 717 | this.bb_pos = i; |
| 718 | this.bb = bb; |
| 719 | return this; |
| 720 | } |
| 721 | |
| 722 | static getRootAsField(bb:flatbuffers.ByteBuffer, obj?:Field):Field { |
| 723 | return (obj || new Field()).__init(bb.readInt32(bb.position()) + bb.position(), bb); |
| 724 | } |
| 725 | |
| 726 | static getSizePrefixedRootAsField(bb:flatbuffers.ByteBuffer, obj?:Field):Field { |
| 727 | bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); |
| 728 | return (obj || new Field()).__init(bb.readInt32(bb.position()) + bb.position(), bb); |
| 729 | } |
| 730 | |
| 731 | name():string|null |
| 732 | name(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null |
| 733 | name(optionalEncoding?:any):string|Uint8Array|null { |
| 734 | const offset = this.bb!.__offset(this.bb_pos, 4); |
| 735 | return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null; |
| 736 | } |
| 737 | |
| 738 | type(obj?:Type):Type|null { |
| 739 | const offset = this.bb!.__offset(this.bb_pos, 6); |
| 740 | return offset ? (obj || new Type()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null; |
| 741 | } |
| 742 | |
| 743 | id():number { |
| 744 | const offset = this.bb!.__offset(this.bb_pos, 8); |
| 745 | return offset ? this.bb!.readUint16(this.bb_pos + offset) : 0; |
| 746 | } |
| 747 | |
| 748 | mutate_id(value:number):boolean { |
| 749 | const offset = this.bb!.__offset(this.bb_pos, 8); |
| 750 | |
| 751 | if (offset === 0) { |
| 752 | return false; |
| 753 | } |
| 754 | |
| 755 | this.bb!.writeUint16(this.bb_pos + offset, value); |
| 756 | return true; |
| 757 | } |
| 758 | |
| 759 | offset():number { |
| 760 | const offset = this.bb!.__offset(this.bb_pos, 10); |
| 761 | return offset ? this.bb!.readUint16(this.bb_pos + offset) : 0; |
| 762 | } |
| 763 | |
| 764 | mutate_offset(value:number):boolean { |
| 765 | const offset = this.bb!.__offset(this.bb_pos, 10); |
| 766 | |
| 767 | if (offset === 0) { |
| 768 | return false; |
| 769 | } |
| 770 | |
| 771 | this.bb!.writeUint16(this.bb_pos + offset, value); |
| 772 | return true; |
| 773 | } |
| 774 | |
| 775 | defaultInteger():bigint { |
| 776 | const offset = this.bb!.__offset(this.bb_pos, 12); |
| 777 | return offset ? this.bb!.readInt64(this.bb_pos + offset) : BigInt('0'); |
| 778 | } |
| 779 | |
| 780 | mutate_default_integer(value:bigint):boolean { |
| 781 | const offset = this.bb!.__offset(this.bb_pos, 12); |
| 782 | |
| 783 | if (offset === 0) { |
| 784 | return false; |
| 785 | } |
| 786 | |
| 787 | this.bb!.writeInt64(this.bb_pos + offset, value); |
| 788 | return true; |
| 789 | } |
| 790 | |
| 791 | defaultReal():number { |
| 792 | const offset = this.bb!.__offset(this.bb_pos, 14); |
| 793 | return offset ? this.bb!.readFloat64(this.bb_pos + offset) : 0.0; |
| 794 | } |
| 795 | |
| 796 | mutate_default_real(value:number):boolean { |
| 797 | const offset = this.bb!.__offset(this.bb_pos, 14); |
| 798 | |
| 799 | if (offset === 0) { |
| 800 | return false; |
| 801 | } |
| 802 | |
| 803 | this.bb!.writeFloat64(this.bb_pos + offset, value); |
| 804 | return true; |
| 805 | } |
| 806 | |
| 807 | deprecated():boolean { |
| 808 | const offset = this.bb!.__offset(this.bb_pos, 16); |
| 809 | return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false; |
| 810 | } |
| 811 | |
| 812 | mutate_deprecated(value:boolean):boolean { |
| 813 | const offset = this.bb!.__offset(this.bb_pos, 16); |
| 814 | |
| 815 | if (offset === 0) { |
| 816 | return false; |
| 817 | } |
| 818 | |
| 819 | this.bb!.writeInt8(this.bb_pos + offset, +value); |
| 820 | return true; |
| 821 | } |
| 822 | |
| 823 | required():boolean { |
| 824 | const offset = this.bb!.__offset(this.bb_pos, 18); |
| 825 | return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false; |
| 826 | } |
| 827 | |
| 828 | mutate_required(value:boolean):boolean { |
| 829 | const offset = this.bb!.__offset(this.bb_pos, 18); |
| 830 | |
| 831 | if (offset === 0) { |
| 832 | return false; |
| 833 | } |
| 834 | |
| 835 | this.bb!.writeInt8(this.bb_pos + offset, +value); |
| 836 | return true; |
| 837 | } |
| 838 | |
| 839 | key():boolean { |
| 840 | const offset = this.bb!.__offset(this.bb_pos, 20); |
| 841 | return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false; |
| 842 | } |
| 843 | |
| 844 | mutate_key(value:boolean):boolean { |
| 845 | const offset = this.bb!.__offset(this.bb_pos, 20); |
| 846 | |
| 847 | if (offset === 0) { |
| 848 | return false; |
| 849 | } |
| 850 | |
| 851 | this.bb!.writeInt8(this.bb_pos + offset, +value); |
| 852 | return true; |
| 853 | } |
| 854 | |
| 855 | attributes(index: number, obj?:KeyValue):KeyValue|null { |
| 856 | const offset = this.bb!.__offset(this.bb_pos, 22); |
| 857 | return offset ? (obj || new KeyValue()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null; |
| 858 | } |
| 859 | |
| 860 | attributesLength():number { |
| 861 | const offset = this.bb!.__offset(this.bb_pos, 22); |
| 862 | return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 863 | } |
| 864 | |
| 865 | documentation(index: number):string |
| 866 | documentation(index: number,optionalEncoding:flatbuffers.Encoding):string|Uint8Array |
| 867 | documentation(index: number,optionalEncoding?:any):string|Uint8Array|null { |
| 868 | const offset = this.bb!.__offset(this.bb_pos, 24); |
| 869 | return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null; |
| 870 | } |
| 871 | |
| 872 | documentationLength():number { |
| 873 | const offset = this.bb!.__offset(this.bb_pos, 24); |
| 874 | return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 875 | } |
| 876 | |
| 877 | optional():boolean { |
| 878 | const offset = this.bb!.__offset(this.bb_pos, 26); |
| 879 | return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false; |
| 880 | } |
| 881 | |
| 882 | mutate_optional(value:boolean):boolean { |
| 883 | const offset = this.bb!.__offset(this.bb_pos, 26); |
| 884 | |
| 885 | if (offset === 0) { |
| 886 | return false; |
| 887 | } |
| 888 | |
| 889 | this.bb!.writeInt8(this.bb_pos + offset, +value); |
| 890 | return true; |
| 891 | } |
| 892 | |
| 893 | /** |
| 894 | * Number of padding octets to always add after this field. Structs only. |
| 895 | */ |
| 896 | padding():number { |
| 897 | const offset = this.bb!.__offset(this.bb_pos, 28); |
| 898 | return offset ? this.bb!.readUint16(this.bb_pos + offset) : 0; |
| 899 | } |
| 900 | |
| 901 | mutate_padding(value:number):boolean { |
| 902 | const offset = this.bb!.__offset(this.bb_pos, 28); |
| 903 | |
| 904 | if (offset === 0) { |
| 905 | return false; |
| 906 | } |
| 907 | |
| 908 | this.bb!.writeUint16(this.bb_pos + offset, value); |
| 909 | return true; |
| 910 | } |
| 911 | |
| 912 | static getFullyQualifiedName():string { |
| 913 | return 'reflection_Field'; |
| 914 | } |
| 915 | |
| 916 | static startField(builder:flatbuffers.Builder) { |
| 917 | builder.startObject(13); |
| 918 | } |
| 919 | |
| 920 | static addName(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset) { |
| 921 | builder.addFieldOffset(0, nameOffset, 0); |
| 922 | } |
| 923 | |
| 924 | static addType(builder:flatbuffers.Builder, typeOffset:flatbuffers.Offset) { |
| 925 | builder.addFieldOffset(1, typeOffset, 0); |
| 926 | } |
| 927 | |
| 928 | static addId(builder:flatbuffers.Builder, id:number) { |
| 929 | builder.addFieldInt16(2, id, 0); |
| 930 | } |
| 931 | |
| 932 | static addOffset(builder:flatbuffers.Builder, offset:number) { |
| 933 | builder.addFieldInt16(3, offset, 0); |
| 934 | } |
| 935 | |
| 936 | static addDefaultInteger(builder:flatbuffers.Builder, defaultInteger:bigint) { |
| 937 | builder.addFieldInt64(4, defaultInteger, BigInt('0')); |
| 938 | } |
| 939 | |
| 940 | static addDefaultReal(builder:flatbuffers.Builder, defaultReal:number) { |
| 941 | builder.addFieldFloat64(5, defaultReal, 0.0); |
| 942 | } |
| 943 | |
| 944 | static addDeprecated(builder:flatbuffers.Builder, deprecated:boolean) { |
| 945 | builder.addFieldInt8(6, +deprecated, +false); |
| 946 | } |
| 947 | |
| 948 | static addRequired(builder:flatbuffers.Builder, required:boolean) { |
| 949 | builder.addFieldInt8(7, +required, +false); |
| 950 | } |
| 951 | |
| 952 | static addKey(builder:flatbuffers.Builder, key:boolean) { |
| 953 | builder.addFieldInt8(8, +key, +false); |
| 954 | } |
| 955 | |
| 956 | static addAttributes(builder:flatbuffers.Builder, attributesOffset:flatbuffers.Offset) { |
| 957 | builder.addFieldOffset(9, attributesOffset, 0); |
| 958 | } |
| 959 | |
| 960 | static createAttributesVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset { |
| 961 | builder.startVector(4, data.length, 4); |
| 962 | for (let i = data.length - 1; i >= 0; i--) { |
| 963 | builder.addOffset(data[i]!); |
| 964 | } |
| 965 | return builder.endVector(); |
| 966 | } |
| 967 | |
| 968 | static startAttributesVector(builder:flatbuffers.Builder, numElems:number) { |
| 969 | builder.startVector(4, numElems, 4); |
| 970 | } |
| 971 | |
| 972 | static addDocumentation(builder:flatbuffers.Builder, documentationOffset:flatbuffers.Offset) { |
| 973 | builder.addFieldOffset(10, documentationOffset, 0); |
| 974 | } |
| 975 | |
| 976 | static createDocumentationVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset { |
| 977 | builder.startVector(4, data.length, 4); |
| 978 | for (let i = data.length - 1; i >= 0; i--) { |
| 979 | builder.addOffset(data[i]!); |
| 980 | } |
| 981 | return builder.endVector(); |
| 982 | } |
| 983 | |
| 984 | static startDocumentationVector(builder:flatbuffers.Builder, numElems:number) { |
| 985 | builder.startVector(4, numElems, 4); |
| 986 | } |
| 987 | |
| 988 | static addOptional(builder:flatbuffers.Builder, optional:boolean) { |
| 989 | builder.addFieldInt8(11, +optional, +false); |
| 990 | } |
| 991 | |
| 992 | static addPadding(builder:flatbuffers.Builder, padding:number) { |
| 993 | builder.addFieldInt16(12, padding, 0); |
| 994 | } |
| 995 | |
| 996 | static endField(builder:flatbuffers.Builder):flatbuffers.Offset { |
| 997 | const offset = builder.endObject(); |
| 998 | builder.requiredField(offset, 4) // name |
| 999 | builder.requiredField(offset, 6) // type |
| 1000 | return offset; |
| 1001 | } |
| 1002 | |
| 1003 | |
| 1004 | unpack(): FieldT { |
| 1005 | return new FieldT( |
| 1006 | this.name(), |
| 1007 | (this.type() !== null ? this.type()!.unpack() : null), |
| 1008 | this.id(), |
| 1009 | this.offset(), |
| 1010 | this.defaultInteger(), |
| 1011 | this.defaultReal(), |
| 1012 | this.deprecated(), |
| 1013 | this.required(), |
| 1014 | this.key(), |
| 1015 | this.bb!.createObjList(this.attributes.bind(this), this.attributesLength()), |
| 1016 | this.bb!.createScalarList(this.documentation.bind(this), this.documentationLength()), |
| 1017 | this.optional(), |
| 1018 | this.padding() |
| 1019 | ); |
| 1020 | } |
| 1021 | |
| 1022 | |
| 1023 | unpackTo(_o: FieldT): void { |
| 1024 | _o.name = this.name(); |
| 1025 | _o.type = (this.type() !== null ? this.type()!.unpack() : null); |
| 1026 | _o.id = this.id(); |
| 1027 | _o.offset = this.offset(); |
| 1028 | _o.defaultInteger = this.defaultInteger(); |
| 1029 | _o.defaultReal = this.defaultReal(); |
| 1030 | _o.deprecated = this.deprecated(); |
| 1031 | _o.required = this.required(); |
| 1032 | _o.key = this.key(); |
| 1033 | _o.attributes = this.bb!.createObjList(this.attributes.bind(this), this.attributesLength()); |
| 1034 | _o.documentation = this.bb!.createScalarList(this.documentation.bind(this), this.documentationLength()); |
| 1035 | _o.optional = this.optional(); |
| 1036 | _o.padding = this.padding(); |
| 1037 | } |
| 1038 | } |
| 1039 | |
| 1040 | export class FieldT { |
| 1041 | constructor( |
| 1042 | public name: string|Uint8Array|null = null, |
| 1043 | public type: TypeT|null = null, |
| 1044 | public id: number = 0, |
| 1045 | public offset: number = 0, |
| 1046 | public defaultInteger: bigint = BigInt('0'), |
| 1047 | public defaultReal: number = 0.0, |
| 1048 | public deprecated: boolean = false, |
| 1049 | public required: boolean = false, |
| 1050 | public key: boolean = false, |
| 1051 | public attributes: (KeyValueT)[] = [], |
| 1052 | public documentation: (string)[] = [], |
| 1053 | public optional: boolean = false, |
| 1054 | public padding: number = 0 |
| 1055 | ){} |
| 1056 | |
| 1057 | |
| 1058 | pack(builder:flatbuffers.Builder): flatbuffers.Offset { |
| 1059 | const name = (this.name !== null ? builder.createString(this.name!) : 0); |
| 1060 | const type = (this.type !== null ? this.type!.pack(builder) : 0); |
| 1061 | const attributes = Field.createAttributesVector(builder, builder.createObjectOffsetList(this.attributes)); |
| 1062 | const documentation = Field.createDocumentationVector(builder, builder.createObjectOffsetList(this.documentation)); |
| 1063 | |
| 1064 | Field.startField(builder); |
| 1065 | Field.addName(builder, name); |
| 1066 | Field.addType(builder, type); |
| 1067 | Field.addId(builder, this.id); |
| 1068 | Field.addOffset(builder, this.offset); |
| 1069 | Field.addDefaultInteger(builder, this.defaultInteger); |
| 1070 | Field.addDefaultReal(builder, this.defaultReal); |
| 1071 | Field.addDeprecated(builder, this.deprecated); |
| 1072 | Field.addRequired(builder, this.required); |
| 1073 | Field.addKey(builder, this.key); |
| 1074 | Field.addAttributes(builder, attributes); |
| 1075 | Field.addDocumentation(builder, documentation); |
| 1076 | Field.addOptional(builder, this.optional); |
| 1077 | Field.addPadding(builder, this.padding); |
| 1078 | |
| 1079 | return Field.endField(builder); |
| 1080 | } |
| 1081 | } |
| 1082 | |
| 1083 | export class Object_ { |
| 1084 | bb: flatbuffers.ByteBuffer|null = null; |
| 1085 | bb_pos = 0; |
| 1086 | __init(i:number, bb:flatbuffers.ByteBuffer):Object_ { |
| 1087 | this.bb_pos = i; |
| 1088 | this.bb = bb; |
| 1089 | return this; |
| 1090 | } |
| 1091 | |
| 1092 | static getRootAsObject(bb:flatbuffers.ByteBuffer, obj?:Object_):Object_ { |
| 1093 | return (obj || new Object_()).__init(bb.readInt32(bb.position()) + bb.position(), bb); |
| 1094 | } |
| 1095 | |
| 1096 | static getSizePrefixedRootAsObject(bb:flatbuffers.ByteBuffer, obj?:Object_):Object_ { |
| 1097 | bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); |
| 1098 | return (obj || new Object_()).__init(bb.readInt32(bb.position()) + bb.position(), bb); |
| 1099 | } |
| 1100 | |
| 1101 | name():string|null |
| 1102 | name(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null |
| 1103 | name(optionalEncoding?:any):string|Uint8Array|null { |
| 1104 | const offset = this.bb!.__offset(this.bb_pos, 4); |
| 1105 | return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null; |
| 1106 | } |
| 1107 | |
| 1108 | fields(index: number, obj?:Field):Field|null { |
| 1109 | const offset = this.bb!.__offset(this.bb_pos, 6); |
| 1110 | return offset ? (obj || new Field()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null; |
| 1111 | } |
| 1112 | |
| 1113 | fieldsLength():number { |
| 1114 | const offset = this.bb!.__offset(this.bb_pos, 6); |
| 1115 | return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 1116 | } |
| 1117 | |
| 1118 | isStruct():boolean { |
| 1119 | const offset = this.bb!.__offset(this.bb_pos, 8); |
| 1120 | return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false; |
| 1121 | } |
| 1122 | |
| 1123 | mutate_is_struct(value:boolean):boolean { |
| 1124 | const offset = this.bb!.__offset(this.bb_pos, 8); |
| 1125 | |
| 1126 | if (offset === 0) { |
| 1127 | return false; |
| 1128 | } |
| 1129 | |
| 1130 | this.bb!.writeInt8(this.bb_pos + offset, +value); |
| 1131 | return true; |
| 1132 | } |
| 1133 | |
| 1134 | minalign():number { |
| 1135 | const offset = this.bb!.__offset(this.bb_pos, 10); |
| 1136 | return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0; |
| 1137 | } |
| 1138 | |
| 1139 | mutate_minalign(value:number):boolean { |
| 1140 | const offset = this.bb!.__offset(this.bb_pos, 10); |
| 1141 | |
| 1142 | if (offset === 0) { |
| 1143 | return false; |
| 1144 | } |
| 1145 | |
| 1146 | this.bb!.writeInt32(this.bb_pos + offset, value); |
| 1147 | return true; |
| 1148 | } |
| 1149 | |
| 1150 | bytesize():number { |
| 1151 | const offset = this.bb!.__offset(this.bb_pos, 12); |
| 1152 | return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0; |
| 1153 | } |
| 1154 | |
| 1155 | mutate_bytesize(value:number):boolean { |
| 1156 | const offset = this.bb!.__offset(this.bb_pos, 12); |
| 1157 | |
| 1158 | if (offset === 0) { |
| 1159 | return false; |
| 1160 | } |
| 1161 | |
| 1162 | this.bb!.writeInt32(this.bb_pos + offset, value); |
| 1163 | return true; |
| 1164 | } |
| 1165 | |
| 1166 | attributes(index: number, obj?:KeyValue):KeyValue|null { |
| 1167 | const offset = this.bb!.__offset(this.bb_pos, 14); |
| 1168 | return offset ? (obj || new KeyValue()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null; |
| 1169 | } |
| 1170 | |
| 1171 | attributesLength():number { |
| 1172 | const offset = this.bb!.__offset(this.bb_pos, 14); |
| 1173 | return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 1174 | } |
| 1175 | |
| 1176 | documentation(index: number):string |
| 1177 | documentation(index: number,optionalEncoding:flatbuffers.Encoding):string|Uint8Array |
| 1178 | documentation(index: number,optionalEncoding?:any):string|Uint8Array|null { |
| 1179 | const offset = this.bb!.__offset(this.bb_pos, 16); |
| 1180 | return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null; |
| 1181 | } |
| 1182 | |
| 1183 | documentationLength():number { |
| 1184 | const offset = this.bb!.__offset(this.bb_pos, 16); |
| 1185 | return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 1186 | } |
| 1187 | |
| 1188 | /** |
| 1189 | * File that this Object is declared in. |
| 1190 | */ |
| 1191 | declarationFile():string|null |
| 1192 | declarationFile(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null |
| 1193 | declarationFile(optionalEncoding?:any):string|Uint8Array|null { |
| 1194 | const offset = this.bb!.__offset(this.bb_pos, 18); |
| 1195 | return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null; |
| 1196 | } |
| 1197 | |
| 1198 | static getFullyQualifiedName():string { |
| 1199 | return 'reflection_Object'; |
| 1200 | } |
| 1201 | |
| 1202 | static startObject(builder:flatbuffers.Builder) { |
| 1203 | builder.startObject(8); |
| 1204 | } |
| 1205 | |
| 1206 | static addName(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset) { |
| 1207 | builder.addFieldOffset(0, nameOffset, 0); |
| 1208 | } |
| 1209 | |
| 1210 | static addFields(builder:flatbuffers.Builder, fieldsOffset:flatbuffers.Offset) { |
| 1211 | builder.addFieldOffset(1, fieldsOffset, 0); |
| 1212 | } |
| 1213 | |
| 1214 | static createFieldsVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset { |
| 1215 | builder.startVector(4, data.length, 4); |
| 1216 | for (let i = data.length - 1; i >= 0; i--) { |
| 1217 | builder.addOffset(data[i]!); |
| 1218 | } |
| 1219 | return builder.endVector(); |
| 1220 | } |
| 1221 | |
| 1222 | static startFieldsVector(builder:flatbuffers.Builder, numElems:number) { |
| 1223 | builder.startVector(4, numElems, 4); |
| 1224 | } |
| 1225 | |
| 1226 | static addIsStruct(builder:flatbuffers.Builder, isStruct:boolean) { |
| 1227 | builder.addFieldInt8(2, +isStruct, +false); |
| 1228 | } |
| 1229 | |
| 1230 | static addMinalign(builder:flatbuffers.Builder, minalign:number) { |
| 1231 | builder.addFieldInt32(3, minalign, 0); |
| 1232 | } |
| 1233 | |
| 1234 | static addBytesize(builder:flatbuffers.Builder, bytesize:number) { |
| 1235 | builder.addFieldInt32(4, bytesize, 0); |
| 1236 | } |
| 1237 | |
| 1238 | static addAttributes(builder:flatbuffers.Builder, attributesOffset:flatbuffers.Offset) { |
| 1239 | builder.addFieldOffset(5, attributesOffset, 0); |
| 1240 | } |
| 1241 | |
| 1242 | static createAttributesVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset { |
| 1243 | builder.startVector(4, data.length, 4); |
| 1244 | for (let i = data.length - 1; i >= 0; i--) { |
| 1245 | builder.addOffset(data[i]!); |
| 1246 | } |
| 1247 | return builder.endVector(); |
| 1248 | } |
| 1249 | |
| 1250 | static startAttributesVector(builder:flatbuffers.Builder, numElems:number) { |
| 1251 | builder.startVector(4, numElems, 4); |
| 1252 | } |
| 1253 | |
| 1254 | static addDocumentation(builder:flatbuffers.Builder, documentationOffset:flatbuffers.Offset) { |
| 1255 | builder.addFieldOffset(6, documentationOffset, 0); |
| 1256 | } |
| 1257 | |
| 1258 | static createDocumentationVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset { |
| 1259 | builder.startVector(4, data.length, 4); |
| 1260 | for (let i = data.length - 1; i >= 0; i--) { |
| 1261 | builder.addOffset(data[i]!); |
| 1262 | } |
| 1263 | return builder.endVector(); |
| 1264 | } |
| 1265 | |
| 1266 | static startDocumentationVector(builder:flatbuffers.Builder, numElems:number) { |
| 1267 | builder.startVector(4, numElems, 4); |
| 1268 | } |
| 1269 | |
| 1270 | static addDeclarationFile(builder:flatbuffers.Builder, declarationFileOffset:flatbuffers.Offset) { |
| 1271 | builder.addFieldOffset(7, declarationFileOffset, 0); |
| 1272 | } |
| 1273 | |
| 1274 | static endObject(builder:flatbuffers.Builder):flatbuffers.Offset { |
| 1275 | const offset = builder.endObject(); |
| 1276 | builder.requiredField(offset, 4) // name |
| 1277 | builder.requiredField(offset, 6) // fields |
| 1278 | return offset; |
| 1279 | } |
| 1280 | |
| 1281 | static createObject(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset, fieldsOffset:flatbuffers.Offset, isStruct:boolean, minalign:number, bytesize:number, attributesOffset:flatbuffers.Offset, documentationOffset:flatbuffers.Offset, declarationFileOffset:flatbuffers.Offset):flatbuffers.Offset { |
| 1282 | Object_.startObject(builder); |
| 1283 | Object_.addName(builder, nameOffset); |
| 1284 | Object_.addFields(builder, fieldsOffset); |
| 1285 | Object_.addIsStruct(builder, isStruct); |
| 1286 | Object_.addMinalign(builder, minalign); |
| 1287 | Object_.addBytesize(builder, bytesize); |
| 1288 | Object_.addAttributes(builder, attributesOffset); |
| 1289 | Object_.addDocumentation(builder, documentationOffset); |
| 1290 | Object_.addDeclarationFile(builder, declarationFileOffset); |
| 1291 | return Object_.endObject(builder); |
| 1292 | } |
| 1293 | |
| 1294 | unpack(): Object_T { |
| 1295 | return new Object_T( |
| 1296 | this.name(), |
| 1297 | this.bb!.createObjList(this.fields.bind(this), this.fieldsLength()), |
| 1298 | this.isStruct(), |
| 1299 | this.minalign(), |
| 1300 | this.bytesize(), |
| 1301 | this.bb!.createObjList(this.attributes.bind(this), this.attributesLength()), |
| 1302 | this.bb!.createScalarList(this.documentation.bind(this), this.documentationLength()), |
| 1303 | this.declarationFile() |
| 1304 | ); |
| 1305 | } |
| 1306 | |
| 1307 | |
| 1308 | unpackTo(_o: Object_T): void { |
| 1309 | _o.name = this.name(); |
| 1310 | _o.fields = this.bb!.createObjList(this.fields.bind(this), this.fieldsLength()); |
| 1311 | _o.isStruct = this.isStruct(); |
| 1312 | _o.minalign = this.minalign(); |
| 1313 | _o.bytesize = this.bytesize(); |
| 1314 | _o.attributes = this.bb!.createObjList(this.attributes.bind(this), this.attributesLength()); |
| 1315 | _o.documentation = this.bb!.createScalarList(this.documentation.bind(this), this.documentationLength()); |
| 1316 | _o.declarationFile = this.declarationFile(); |
| 1317 | } |
| 1318 | } |
| 1319 | |
| 1320 | export class Object_T { |
| 1321 | constructor( |
| 1322 | public name: string|Uint8Array|null = null, |
| 1323 | public fields: (FieldT)[] = [], |
| 1324 | public isStruct: boolean = false, |
| 1325 | public minalign: number = 0, |
| 1326 | public bytesize: number = 0, |
| 1327 | public attributes: (KeyValueT)[] = [], |
| 1328 | public documentation: (string)[] = [], |
| 1329 | public declarationFile: string|Uint8Array|null = null |
| 1330 | ){} |
| 1331 | |
| 1332 | |
| 1333 | pack(builder:flatbuffers.Builder): flatbuffers.Offset { |
| 1334 | const name = (this.name !== null ? builder.createString(this.name!) : 0); |
| 1335 | const fields = Object_.createFieldsVector(builder, builder.createObjectOffsetList(this.fields)); |
| 1336 | const attributes = Object_.createAttributesVector(builder, builder.createObjectOffsetList(this.attributes)); |
| 1337 | const documentation = Object_.createDocumentationVector(builder, builder.createObjectOffsetList(this.documentation)); |
| 1338 | const declarationFile = (this.declarationFile !== null ? builder.createString(this.declarationFile!) : 0); |
| 1339 | |
| 1340 | return Object_.createObject(builder, |
| 1341 | name, |
| 1342 | fields, |
| 1343 | this.isStruct, |
| 1344 | this.minalign, |
| 1345 | this.bytesize, |
| 1346 | attributes, |
| 1347 | documentation, |
| 1348 | declarationFile |
| 1349 | ); |
| 1350 | } |
| 1351 | } |
| 1352 | |
| 1353 | export class RPCCall { |
| 1354 | bb: flatbuffers.ByteBuffer|null = null; |
| 1355 | bb_pos = 0; |
| 1356 | __init(i:number, bb:flatbuffers.ByteBuffer):RPCCall { |
| 1357 | this.bb_pos = i; |
| 1358 | this.bb = bb; |
| 1359 | return this; |
| 1360 | } |
| 1361 | |
| 1362 | static getRootAsRPCCall(bb:flatbuffers.ByteBuffer, obj?:RPCCall):RPCCall { |
| 1363 | return (obj || new RPCCall()).__init(bb.readInt32(bb.position()) + bb.position(), bb); |
| 1364 | } |
| 1365 | |
| 1366 | static getSizePrefixedRootAsRPCCall(bb:flatbuffers.ByteBuffer, obj?:RPCCall):RPCCall { |
| 1367 | bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); |
| 1368 | return (obj || new RPCCall()).__init(bb.readInt32(bb.position()) + bb.position(), bb); |
| 1369 | } |
| 1370 | |
| 1371 | name():string|null |
| 1372 | name(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null |
| 1373 | name(optionalEncoding?:any):string|Uint8Array|null { |
| 1374 | const offset = this.bb!.__offset(this.bb_pos, 4); |
| 1375 | return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null; |
| 1376 | } |
| 1377 | |
| 1378 | request(obj?:Object_):Object_|null { |
| 1379 | const offset = this.bb!.__offset(this.bb_pos, 6); |
| 1380 | return offset ? (obj || new Object_()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null; |
| 1381 | } |
| 1382 | |
| 1383 | response(obj?:Object_):Object_|null { |
| 1384 | const offset = this.bb!.__offset(this.bb_pos, 8); |
| 1385 | return offset ? (obj || new Object_()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null; |
| 1386 | } |
| 1387 | |
| 1388 | attributes(index: number, obj?:KeyValue):KeyValue|null { |
| 1389 | const offset = this.bb!.__offset(this.bb_pos, 10); |
| 1390 | return offset ? (obj || new KeyValue()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null; |
| 1391 | } |
| 1392 | |
| 1393 | attributesLength():number { |
| 1394 | const offset = this.bb!.__offset(this.bb_pos, 10); |
| 1395 | return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 1396 | } |
| 1397 | |
| 1398 | documentation(index: number):string |
| 1399 | documentation(index: number,optionalEncoding:flatbuffers.Encoding):string|Uint8Array |
| 1400 | documentation(index: number,optionalEncoding?:any):string|Uint8Array|null { |
| 1401 | const offset = this.bb!.__offset(this.bb_pos, 12); |
| 1402 | return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null; |
| 1403 | } |
| 1404 | |
| 1405 | documentationLength():number { |
| 1406 | const offset = this.bb!.__offset(this.bb_pos, 12); |
| 1407 | return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 1408 | } |
| 1409 | |
| 1410 | static getFullyQualifiedName():string { |
| 1411 | return 'reflection_RPCCall'; |
| 1412 | } |
| 1413 | |
| 1414 | static startRPCCall(builder:flatbuffers.Builder) { |
| 1415 | builder.startObject(5); |
| 1416 | } |
| 1417 | |
| 1418 | static addName(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset) { |
| 1419 | builder.addFieldOffset(0, nameOffset, 0); |
| 1420 | } |
| 1421 | |
| 1422 | static addRequest(builder:flatbuffers.Builder, requestOffset:flatbuffers.Offset) { |
| 1423 | builder.addFieldOffset(1, requestOffset, 0); |
| 1424 | } |
| 1425 | |
| 1426 | static addResponse(builder:flatbuffers.Builder, responseOffset:flatbuffers.Offset) { |
| 1427 | builder.addFieldOffset(2, responseOffset, 0); |
| 1428 | } |
| 1429 | |
| 1430 | static addAttributes(builder:flatbuffers.Builder, attributesOffset:flatbuffers.Offset) { |
| 1431 | builder.addFieldOffset(3, attributesOffset, 0); |
| 1432 | } |
| 1433 | |
| 1434 | static createAttributesVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset { |
| 1435 | builder.startVector(4, data.length, 4); |
| 1436 | for (let i = data.length - 1; i >= 0; i--) { |
| 1437 | builder.addOffset(data[i]!); |
| 1438 | } |
| 1439 | return builder.endVector(); |
| 1440 | } |
| 1441 | |
| 1442 | static startAttributesVector(builder:flatbuffers.Builder, numElems:number) { |
| 1443 | builder.startVector(4, numElems, 4); |
| 1444 | } |
| 1445 | |
| 1446 | static addDocumentation(builder:flatbuffers.Builder, documentationOffset:flatbuffers.Offset) { |
| 1447 | builder.addFieldOffset(4, documentationOffset, 0); |
| 1448 | } |
| 1449 | |
| 1450 | static createDocumentationVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset { |
| 1451 | builder.startVector(4, data.length, 4); |
| 1452 | for (let i = data.length - 1; i >= 0; i--) { |
| 1453 | builder.addOffset(data[i]!); |
| 1454 | } |
| 1455 | return builder.endVector(); |
| 1456 | } |
| 1457 | |
| 1458 | static startDocumentationVector(builder:flatbuffers.Builder, numElems:number) { |
| 1459 | builder.startVector(4, numElems, 4); |
| 1460 | } |
| 1461 | |
| 1462 | static endRPCCall(builder:flatbuffers.Builder):flatbuffers.Offset { |
| 1463 | const offset = builder.endObject(); |
| 1464 | builder.requiredField(offset, 4) // name |
| 1465 | builder.requiredField(offset, 6) // request |
| 1466 | builder.requiredField(offset, 8) // response |
| 1467 | return offset; |
| 1468 | } |
| 1469 | |
| 1470 | |
| 1471 | unpack(): RPCCallT { |
| 1472 | return new RPCCallT( |
| 1473 | this.name(), |
| 1474 | (this.request() !== null ? this.request()!.unpack() : null), |
| 1475 | (this.response() !== null ? this.response()!.unpack() : null), |
| 1476 | this.bb!.createObjList(this.attributes.bind(this), this.attributesLength()), |
| 1477 | this.bb!.createScalarList(this.documentation.bind(this), this.documentationLength()) |
| 1478 | ); |
| 1479 | } |
| 1480 | |
| 1481 | |
| 1482 | unpackTo(_o: RPCCallT): void { |
| 1483 | _o.name = this.name(); |
| 1484 | _o.request = (this.request() !== null ? this.request()!.unpack() : null); |
| 1485 | _o.response = (this.response() !== null ? this.response()!.unpack() : null); |
| 1486 | _o.attributes = this.bb!.createObjList(this.attributes.bind(this), this.attributesLength()); |
| 1487 | _o.documentation = this.bb!.createScalarList(this.documentation.bind(this), this.documentationLength()); |
| 1488 | } |
| 1489 | } |
| 1490 | |
| 1491 | export class RPCCallT { |
| 1492 | constructor( |
| 1493 | public name: string|Uint8Array|null = null, |
| 1494 | public request: Object_T|null = null, |
| 1495 | public response: Object_T|null = null, |
| 1496 | public attributes: (KeyValueT)[] = [], |
| 1497 | public documentation: (string)[] = [] |
| 1498 | ){} |
| 1499 | |
| 1500 | |
| 1501 | pack(builder:flatbuffers.Builder): flatbuffers.Offset { |
| 1502 | const name = (this.name !== null ? builder.createString(this.name!) : 0); |
| 1503 | const request = (this.request !== null ? this.request!.pack(builder) : 0); |
| 1504 | const response = (this.response !== null ? this.response!.pack(builder) : 0); |
| 1505 | const attributes = RPCCall.createAttributesVector(builder, builder.createObjectOffsetList(this.attributes)); |
| 1506 | const documentation = RPCCall.createDocumentationVector(builder, builder.createObjectOffsetList(this.documentation)); |
| 1507 | |
| 1508 | RPCCall.startRPCCall(builder); |
| 1509 | RPCCall.addName(builder, name); |
| 1510 | RPCCall.addRequest(builder, request); |
| 1511 | RPCCall.addResponse(builder, response); |
| 1512 | RPCCall.addAttributes(builder, attributes); |
| 1513 | RPCCall.addDocumentation(builder, documentation); |
| 1514 | |
| 1515 | return RPCCall.endRPCCall(builder); |
| 1516 | } |
| 1517 | } |
| 1518 | |
| 1519 | export class Service { |
| 1520 | bb: flatbuffers.ByteBuffer|null = null; |
| 1521 | bb_pos = 0; |
| 1522 | __init(i:number, bb:flatbuffers.ByteBuffer):Service { |
| 1523 | this.bb_pos = i; |
| 1524 | this.bb = bb; |
| 1525 | return this; |
| 1526 | } |
| 1527 | |
| 1528 | static getRootAsService(bb:flatbuffers.ByteBuffer, obj?:Service):Service { |
| 1529 | return (obj || new Service()).__init(bb.readInt32(bb.position()) + bb.position(), bb); |
| 1530 | } |
| 1531 | |
| 1532 | static getSizePrefixedRootAsService(bb:flatbuffers.ByteBuffer, obj?:Service):Service { |
| 1533 | bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); |
| 1534 | return (obj || new Service()).__init(bb.readInt32(bb.position()) + bb.position(), bb); |
| 1535 | } |
| 1536 | |
| 1537 | name():string|null |
| 1538 | name(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null |
| 1539 | name(optionalEncoding?:any):string|Uint8Array|null { |
| 1540 | const offset = this.bb!.__offset(this.bb_pos, 4); |
| 1541 | return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null; |
| 1542 | } |
| 1543 | |
| 1544 | calls(index: number, obj?:RPCCall):RPCCall|null { |
| 1545 | const offset = this.bb!.__offset(this.bb_pos, 6); |
| 1546 | return offset ? (obj || new RPCCall()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null; |
| 1547 | } |
| 1548 | |
| 1549 | callsLength():number { |
| 1550 | const offset = this.bb!.__offset(this.bb_pos, 6); |
| 1551 | return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 1552 | } |
| 1553 | |
| 1554 | attributes(index: number, obj?:KeyValue):KeyValue|null { |
| 1555 | const offset = this.bb!.__offset(this.bb_pos, 8); |
| 1556 | return offset ? (obj || new KeyValue()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null; |
| 1557 | } |
| 1558 | |
| 1559 | attributesLength():number { |
| 1560 | const offset = this.bb!.__offset(this.bb_pos, 8); |
| 1561 | return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 1562 | } |
| 1563 | |
| 1564 | documentation(index: number):string |
| 1565 | documentation(index: number,optionalEncoding:flatbuffers.Encoding):string|Uint8Array |
| 1566 | documentation(index: number,optionalEncoding?:any):string|Uint8Array|null { |
| 1567 | const offset = this.bb!.__offset(this.bb_pos, 10); |
| 1568 | return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null; |
| 1569 | } |
| 1570 | |
| 1571 | documentationLength():number { |
| 1572 | const offset = this.bb!.__offset(this.bb_pos, 10); |
| 1573 | return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 1574 | } |
| 1575 | |
| 1576 | /** |
| 1577 | * File that this Service is declared in. |
| 1578 | */ |
| 1579 | declarationFile():string|null |
| 1580 | declarationFile(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null |
| 1581 | declarationFile(optionalEncoding?:any):string|Uint8Array|null { |
| 1582 | const offset = this.bb!.__offset(this.bb_pos, 12); |
| 1583 | return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null; |
| 1584 | } |
| 1585 | |
| 1586 | static getFullyQualifiedName():string { |
| 1587 | return 'reflection_Service'; |
| 1588 | } |
| 1589 | |
| 1590 | static startService(builder:flatbuffers.Builder) { |
| 1591 | builder.startObject(5); |
| 1592 | } |
| 1593 | |
| 1594 | static addName(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset) { |
| 1595 | builder.addFieldOffset(0, nameOffset, 0); |
| 1596 | } |
| 1597 | |
| 1598 | static addCalls(builder:flatbuffers.Builder, callsOffset:flatbuffers.Offset) { |
| 1599 | builder.addFieldOffset(1, callsOffset, 0); |
| 1600 | } |
| 1601 | |
| 1602 | static createCallsVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset { |
| 1603 | builder.startVector(4, data.length, 4); |
| 1604 | for (let i = data.length - 1; i >= 0; i--) { |
| 1605 | builder.addOffset(data[i]!); |
| 1606 | } |
| 1607 | return builder.endVector(); |
| 1608 | } |
| 1609 | |
| 1610 | static startCallsVector(builder:flatbuffers.Builder, numElems:number) { |
| 1611 | builder.startVector(4, numElems, 4); |
| 1612 | } |
| 1613 | |
| 1614 | static addAttributes(builder:flatbuffers.Builder, attributesOffset:flatbuffers.Offset) { |
| 1615 | builder.addFieldOffset(2, attributesOffset, 0); |
| 1616 | } |
| 1617 | |
| 1618 | static createAttributesVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset { |
| 1619 | builder.startVector(4, data.length, 4); |
| 1620 | for (let i = data.length - 1; i >= 0; i--) { |
| 1621 | builder.addOffset(data[i]!); |
| 1622 | } |
| 1623 | return builder.endVector(); |
| 1624 | } |
| 1625 | |
| 1626 | static startAttributesVector(builder:flatbuffers.Builder, numElems:number) { |
| 1627 | builder.startVector(4, numElems, 4); |
| 1628 | } |
| 1629 | |
| 1630 | static addDocumentation(builder:flatbuffers.Builder, documentationOffset:flatbuffers.Offset) { |
| 1631 | builder.addFieldOffset(3, documentationOffset, 0); |
| 1632 | } |
| 1633 | |
| 1634 | static createDocumentationVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset { |
| 1635 | builder.startVector(4, data.length, 4); |
| 1636 | for (let i = data.length - 1; i >= 0; i--) { |
| 1637 | builder.addOffset(data[i]!); |
| 1638 | } |
| 1639 | return builder.endVector(); |
| 1640 | } |
| 1641 | |
| 1642 | static startDocumentationVector(builder:flatbuffers.Builder, numElems:number) { |
| 1643 | builder.startVector(4, numElems, 4); |
| 1644 | } |
| 1645 | |
| 1646 | static addDeclarationFile(builder:flatbuffers.Builder, declarationFileOffset:flatbuffers.Offset) { |
| 1647 | builder.addFieldOffset(4, declarationFileOffset, 0); |
| 1648 | } |
| 1649 | |
| 1650 | static endService(builder:flatbuffers.Builder):flatbuffers.Offset { |
| 1651 | const offset = builder.endObject(); |
| 1652 | builder.requiredField(offset, 4) // name |
| 1653 | return offset; |
| 1654 | } |
| 1655 | |
| 1656 | static createService(builder:flatbuffers.Builder, nameOffset:flatbuffers.Offset, callsOffset:flatbuffers.Offset, attributesOffset:flatbuffers.Offset, documentationOffset:flatbuffers.Offset, declarationFileOffset:flatbuffers.Offset):flatbuffers.Offset { |
| 1657 | Service.startService(builder); |
| 1658 | Service.addName(builder, nameOffset); |
| 1659 | Service.addCalls(builder, callsOffset); |
| 1660 | Service.addAttributes(builder, attributesOffset); |
| 1661 | Service.addDocumentation(builder, documentationOffset); |
| 1662 | Service.addDeclarationFile(builder, declarationFileOffset); |
| 1663 | return Service.endService(builder); |
| 1664 | } |
| 1665 | |
| 1666 | unpack(): ServiceT { |
| 1667 | return new ServiceT( |
| 1668 | this.name(), |
| 1669 | this.bb!.createObjList(this.calls.bind(this), this.callsLength()), |
| 1670 | this.bb!.createObjList(this.attributes.bind(this), this.attributesLength()), |
| 1671 | this.bb!.createScalarList(this.documentation.bind(this), this.documentationLength()), |
| 1672 | this.declarationFile() |
| 1673 | ); |
| 1674 | } |
| 1675 | |
| 1676 | |
| 1677 | unpackTo(_o: ServiceT): void { |
| 1678 | _o.name = this.name(); |
| 1679 | _o.calls = this.bb!.createObjList(this.calls.bind(this), this.callsLength()); |
| 1680 | _o.attributes = this.bb!.createObjList(this.attributes.bind(this), this.attributesLength()); |
| 1681 | _o.documentation = this.bb!.createScalarList(this.documentation.bind(this), this.documentationLength()); |
| 1682 | _o.declarationFile = this.declarationFile(); |
| 1683 | } |
| 1684 | } |
| 1685 | |
| 1686 | export class ServiceT { |
| 1687 | constructor( |
| 1688 | public name: string|Uint8Array|null = null, |
| 1689 | public calls: (RPCCallT)[] = [], |
| 1690 | public attributes: (KeyValueT)[] = [], |
| 1691 | public documentation: (string)[] = [], |
| 1692 | public declarationFile: string|Uint8Array|null = null |
| 1693 | ){} |
| 1694 | |
| 1695 | |
| 1696 | pack(builder:flatbuffers.Builder): flatbuffers.Offset { |
| 1697 | const name = (this.name !== null ? builder.createString(this.name!) : 0); |
| 1698 | const calls = Service.createCallsVector(builder, builder.createObjectOffsetList(this.calls)); |
| 1699 | const attributes = Service.createAttributesVector(builder, builder.createObjectOffsetList(this.attributes)); |
| 1700 | const documentation = Service.createDocumentationVector(builder, builder.createObjectOffsetList(this.documentation)); |
| 1701 | const declarationFile = (this.declarationFile !== null ? builder.createString(this.declarationFile!) : 0); |
| 1702 | |
| 1703 | return Service.createService(builder, |
| 1704 | name, |
| 1705 | calls, |
| 1706 | attributes, |
| 1707 | documentation, |
| 1708 | declarationFile |
| 1709 | ); |
| 1710 | } |
| 1711 | } |
| 1712 | |
| 1713 | /** |
| 1714 | * File specific information. |
| 1715 | * Symbols declared within a file may be recovered by iterating over all |
| 1716 | * symbols and examining the `declaration_file` field. |
| 1717 | */ |
| 1718 | export class SchemaFile { |
| 1719 | bb: flatbuffers.ByteBuffer|null = null; |
| 1720 | bb_pos = 0; |
| 1721 | __init(i:number, bb:flatbuffers.ByteBuffer):SchemaFile { |
| 1722 | this.bb_pos = i; |
| 1723 | this.bb = bb; |
| 1724 | return this; |
| 1725 | } |
| 1726 | |
| 1727 | static getRootAsSchemaFile(bb:flatbuffers.ByteBuffer, obj?:SchemaFile):SchemaFile { |
| 1728 | return (obj || new SchemaFile()).__init(bb.readInt32(bb.position()) + bb.position(), bb); |
| 1729 | } |
| 1730 | |
| 1731 | static getSizePrefixedRootAsSchemaFile(bb:flatbuffers.ByteBuffer, obj?:SchemaFile):SchemaFile { |
| 1732 | bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); |
| 1733 | return (obj || new SchemaFile()).__init(bb.readInt32(bb.position()) + bb.position(), bb); |
| 1734 | } |
| 1735 | |
| 1736 | /** |
| 1737 | * Filename, relative to project root. |
| 1738 | */ |
| 1739 | filename():string|null |
| 1740 | filename(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null |
| 1741 | filename(optionalEncoding?:any):string|Uint8Array|null { |
| 1742 | const offset = this.bb!.__offset(this.bb_pos, 4); |
| 1743 | return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null; |
| 1744 | } |
| 1745 | |
| 1746 | /** |
| 1747 | * Names of included files, relative to project root. |
| 1748 | */ |
| 1749 | includedFilenames(index: number):string |
| 1750 | includedFilenames(index: number,optionalEncoding:flatbuffers.Encoding):string|Uint8Array |
| 1751 | includedFilenames(index: number,optionalEncoding?:any):string|Uint8Array|null { |
| 1752 | const offset = this.bb!.__offset(this.bb_pos, 6); |
| 1753 | return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null; |
| 1754 | } |
| 1755 | |
| 1756 | includedFilenamesLength():number { |
| 1757 | const offset = this.bb!.__offset(this.bb_pos, 6); |
| 1758 | return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 1759 | } |
| 1760 | |
| 1761 | static getFullyQualifiedName():string { |
| 1762 | return 'reflection_SchemaFile'; |
| 1763 | } |
| 1764 | |
| 1765 | static startSchemaFile(builder:flatbuffers.Builder) { |
| 1766 | builder.startObject(2); |
| 1767 | } |
| 1768 | |
| 1769 | static addFilename(builder:flatbuffers.Builder, filenameOffset:flatbuffers.Offset) { |
| 1770 | builder.addFieldOffset(0, filenameOffset, 0); |
| 1771 | } |
| 1772 | |
| 1773 | static addIncludedFilenames(builder:flatbuffers.Builder, includedFilenamesOffset:flatbuffers.Offset) { |
| 1774 | builder.addFieldOffset(1, includedFilenamesOffset, 0); |
| 1775 | } |
| 1776 | |
| 1777 | static createIncludedFilenamesVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset { |
| 1778 | builder.startVector(4, data.length, 4); |
| 1779 | for (let i = data.length - 1; i >= 0; i--) { |
| 1780 | builder.addOffset(data[i]!); |
| 1781 | } |
| 1782 | return builder.endVector(); |
| 1783 | } |
| 1784 | |
| 1785 | static startIncludedFilenamesVector(builder:flatbuffers.Builder, numElems:number) { |
| 1786 | builder.startVector(4, numElems, 4); |
| 1787 | } |
| 1788 | |
| 1789 | static endSchemaFile(builder:flatbuffers.Builder):flatbuffers.Offset { |
| 1790 | const offset = builder.endObject(); |
| 1791 | builder.requiredField(offset, 4) // filename |
| 1792 | return offset; |
| 1793 | } |
| 1794 | |
| 1795 | static createSchemaFile(builder:flatbuffers.Builder, filenameOffset:flatbuffers.Offset, includedFilenamesOffset:flatbuffers.Offset):flatbuffers.Offset { |
| 1796 | SchemaFile.startSchemaFile(builder); |
| 1797 | SchemaFile.addFilename(builder, filenameOffset); |
| 1798 | SchemaFile.addIncludedFilenames(builder, includedFilenamesOffset); |
| 1799 | return SchemaFile.endSchemaFile(builder); |
| 1800 | } |
| 1801 | |
| 1802 | unpack(): SchemaFileT { |
| 1803 | return new SchemaFileT( |
| 1804 | this.filename(), |
| 1805 | this.bb!.createScalarList(this.includedFilenames.bind(this), this.includedFilenamesLength()) |
| 1806 | ); |
| 1807 | } |
| 1808 | |
| 1809 | |
| 1810 | unpackTo(_o: SchemaFileT): void { |
| 1811 | _o.filename = this.filename(); |
| 1812 | _o.includedFilenames = this.bb!.createScalarList(this.includedFilenames.bind(this), this.includedFilenamesLength()); |
| 1813 | } |
| 1814 | } |
| 1815 | |
| 1816 | export class SchemaFileT { |
| 1817 | constructor( |
| 1818 | public filename: string|Uint8Array|null = null, |
| 1819 | public includedFilenames: (string)[] = [] |
| 1820 | ){} |
| 1821 | |
| 1822 | |
| 1823 | pack(builder:flatbuffers.Builder): flatbuffers.Offset { |
| 1824 | const filename = (this.filename !== null ? builder.createString(this.filename!) : 0); |
| 1825 | const includedFilenames = SchemaFile.createIncludedFilenamesVector(builder, builder.createObjectOffsetList(this.includedFilenames)); |
| 1826 | |
| 1827 | return SchemaFile.createSchemaFile(builder, |
| 1828 | filename, |
| 1829 | includedFilenames |
| 1830 | ); |
| 1831 | } |
| 1832 | } |
| 1833 | |
| 1834 | export class Schema { |
| 1835 | bb: flatbuffers.ByteBuffer|null = null; |
| 1836 | bb_pos = 0; |
| 1837 | __init(i:number, bb:flatbuffers.ByteBuffer):Schema { |
| 1838 | this.bb_pos = i; |
| 1839 | this.bb = bb; |
| 1840 | return this; |
| 1841 | } |
| 1842 | |
| 1843 | static getRootAsSchema(bb:flatbuffers.ByteBuffer, obj?:Schema):Schema { |
| 1844 | return (obj || new Schema()).__init(bb.readInt32(bb.position()) + bb.position(), bb); |
| 1845 | } |
| 1846 | |
| 1847 | static getSizePrefixedRootAsSchema(bb:flatbuffers.ByteBuffer, obj?:Schema):Schema { |
| 1848 | bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); |
| 1849 | return (obj || new Schema()).__init(bb.readInt32(bb.position()) + bb.position(), bb); |
| 1850 | } |
| 1851 | |
| 1852 | static bufferHasIdentifier(bb:flatbuffers.ByteBuffer):boolean { |
| 1853 | return bb.__has_identifier('BFBS'); |
| 1854 | } |
| 1855 | |
| 1856 | objects(index: number, obj?:Object_):Object_|null { |
| 1857 | const offset = this.bb!.__offset(this.bb_pos, 4); |
| 1858 | return offset ? (obj || new Object_()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null; |
| 1859 | } |
| 1860 | |
| 1861 | objectsLength():number { |
| 1862 | const offset = this.bb!.__offset(this.bb_pos, 4); |
| 1863 | return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 1864 | } |
| 1865 | |
| 1866 | enums(index: number, obj?:Enum):Enum|null { |
| 1867 | const offset = this.bb!.__offset(this.bb_pos, 6); |
| 1868 | return offset ? (obj || new Enum()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null; |
| 1869 | } |
| 1870 | |
| 1871 | enumsLength():number { |
| 1872 | const offset = this.bb!.__offset(this.bb_pos, 6); |
| 1873 | return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 1874 | } |
| 1875 | |
| 1876 | fileIdent():string|null |
| 1877 | fileIdent(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null |
| 1878 | fileIdent(optionalEncoding?:any):string|Uint8Array|null { |
| 1879 | const offset = this.bb!.__offset(this.bb_pos, 8); |
| 1880 | return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null; |
| 1881 | } |
| 1882 | |
| 1883 | fileExt():string|null |
| 1884 | fileExt(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null |
| 1885 | fileExt(optionalEncoding?:any):string|Uint8Array|null { |
| 1886 | const offset = this.bb!.__offset(this.bb_pos, 10); |
| 1887 | return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null; |
| 1888 | } |
| 1889 | |
| 1890 | rootTable(obj?:Object_):Object_|null { |
| 1891 | const offset = this.bb!.__offset(this.bb_pos, 12); |
| 1892 | return offset ? (obj || new Object_()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null; |
| 1893 | } |
| 1894 | |
| 1895 | services(index: number, obj?:Service):Service|null { |
| 1896 | const offset = this.bb!.__offset(this.bb_pos, 14); |
| 1897 | return offset ? (obj || new Service()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null; |
| 1898 | } |
| 1899 | |
| 1900 | servicesLength():number { |
| 1901 | const offset = this.bb!.__offset(this.bb_pos, 14); |
| 1902 | return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 1903 | } |
| 1904 | |
| 1905 | advancedFeatures():bigint { |
| 1906 | const offset = this.bb!.__offset(this.bb_pos, 16); |
| 1907 | return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0'); |
| 1908 | } |
| 1909 | |
| 1910 | mutate_advanced_features(value:bigint):boolean { |
| 1911 | const offset = this.bb!.__offset(this.bb_pos, 16); |
| 1912 | |
| 1913 | if (offset === 0) { |
| 1914 | return false; |
| 1915 | } |
| 1916 | |
| 1917 | this.bb!.writeUint64(this.bb_pos + offset, value); |
| 1918 | return true; |
| 1919 | } |
| 1920 | |
| 1921 | /** |
| 1922 | * All the files used in this compilation. Files are relative to where |
| 1923 | * flatc was invoked. |
| 1924 | */ |
| 1925 | fbsFiles(index: number, obj?:SchemaFile):SchemaFile|null { |
| 1926 | const offset = this.bb!.__offset(this.bb_pos, 18); |
| 1927 | return offset ? (obj || new SchemaFile()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null; |
| 1928 | } |
| 1929 | |
| 1930 | fbsFilesLength():number { |
| 1931 | const offset = this.bb!.__offset(this.bb_pos, 18); |
| 1932 | return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0; |
| 1933 | } |
| 1934 | |
| 1935 | static getFullyQualifiedName():string { |
| 1936 | return 'reflection_Schema'; |
| 1937 | } |
| 1938 | |
| 1939 | static startSchema(builder:flatbuffers.Builder) { |
| 1940 | builder.startObject(8); |
| 1941 | } |
| 1942 | |
| 1943 | static addObjects(builder:flatbuffers.Builder, objectsOffset:flatbuffers.Offset) { |
| 1944 | builder.addFieldOffset(0, objectsOffset, 0); |
| 1945 | } |
| 1946 | |
| 1947 | static createObjectsVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset { |
| 1948 | builder.startVector(4, data.length, 4); |
| 1949 | for (let i = data.length - 1; i >= 0; i--) { |
| 1950 | builder.addOffset(data[i]!); |
| 1951 | } |
| 1952 | return builder.endVector(); |
| 1953 | } |
| 1954 | |
| 1955 | static startObjectsVector(builder:flatbuffers.Builder, numElems:number) { |
| 1956 | builder.startVector(4, numElems, 4); |
| 1957 | } |
| 1958 | |
| 1959 | static addEnums(builder:flatbuffers.Builder, enumsOffset:flatbuffers.Offset) { |
| 1960 | builder.addFieldOffset(1, enumsOffset, 0); |
| 1961 | } |
| 1962 | |
| 1963 | static createEnumsVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset { |
| 1964 | builder.startVector(4, data.length, 4); |
| 1965 | for (let i = data.length - 1; i >= 0; i--) { |
| 1966 | builder.addOffset(data[i]!); |
| 1967 | } |
| 1968 | return builder.endVector(); |
| 1969 | } |
| 1970 | |
| 1971 | static startEnumsVector(builder:flatbuffers.Builder, numElems:number) { |
| 1972 | builder.startVector(4, numElems, 4); |
| 1973 | } |
| 1974 | |
| 1975 | static addFileIdent(builder:flatbuffers.Builder, fileIdentOffset:flatbuffers.Offset) { |
| 1976 | builder.addFieldOffset(2, fileIdentOffset, 0); |
| 1977 | } |
| 1978 | |
| 1979 | static addFileExt(builder:flatbuffers.Builder, fileExtOffset:flatbuffers.Offset) { |
| 1980 | builder.addFieldOffset(3, fileExtOffset, 0); |
| 1981 | } |
| 1982 | |
| 1983 | static addRootTable(builder:flatbuffers.Builder, rootTableOffset:flatbuffers.Offset) { |
| 1984 | builder.addFieldOffset(4, rootTableOffset, 0); |
| 1985 | } |
| 1986 | |
| 1987 | static addServices(builder:flatbuffers.Builder, servicesOffset:flatbuffers.Offset) { |
| 1988 | builder.addFieldOffset(5, servicesOffset, 0); |
| 1989 | } |
| 1990 | |
| 1991 | static createServicesVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset { |
| 1992 | builder.startVector(4, data.length, 4); |
| 1993 | for (let i = data.length - 1; i >= 0; i--) { |
| 1994 | builder.addOffset(data[i]!); |
| 1995 | } |
| 1996 | return builder.endVector(); |
| 1997 | } |
| 1998 | |
| 1999 | static startServicesVector(builder:flatbuffers.Builder, numElems:number) { |
| 2000 | builder.startVector(4, numElems, 4); |
| 2001 | } |
| 2002 | |
| 2003 | static addAdvancedFeatures(builder:flatbuffers.Builder, advancedFeatures:bigint) { |
| 2004 | builder.addFieldInt64(6, advancedFeatures, BigInt('0')); |
| 2005 | } |
| 2006 | |
| 2007 | static addFbsFiles(builder:flatbuffers.Builder, fbsFilesOffset:flatbuffers.Offset) { |
| 2008 | builder.addFieldOffset(7, fbsFilesOffset, 0); |
| 2009 | } |
| 2010 | |
| 2011 | static createFbsFilesVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset { |
| 2012 | builder.startVector(4, data.length, 4); |
| 2013 | for (let i = data.length - 1; i >= 0; i--) { |
| 2014 | builder.addOffset(data[i]!); |
| 2015 | } |
| 2016 | return builder.endVector(); |
| 2017 | } |
| 2018 | |
| 2019 | static startFbsFilesVector(builder:flatbuffers.Builder, numElems:number) { |
| 2020 | builder.startVector(4, numElems, 4); |
| 2021 | } |
| 2022 | |
| 2023 | static endSchema(builder:flatbuffers.Builder):flatbuffers.Offset { |
| 2024 | const offset = builder.endObject(); |
| 2025 | builder.requiredField(offset, 4) // objects |
| 2026 | builder.requiredField(offset, 6) // enums |
| 2027 | return offset; |
| 2028 | } |
| 2029 | |
| 2030 | static finishSchemaBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) { |
| 2031 | builder.finish(offset, 'BFBS'); |
| 2032 | } |
| 2033 | |
| 2034 | static finishSizePrefixedSchemaBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) { |
| 2035 | builder.finish(offset, 'BFBS', true); |
| 2036 | } |
| 2037 | |
| 2038 | |
| 2039 | unpack(): SchemaT { |
| 2040 | return new SchemaT( |
| 2041 | this.bb!.createObjList(this.objects.bind(this), this.objectsLength()), |
| 2042 | this.bb!.createObjList(this.enums.bind(this), this.enumsLength()), |
| 2043 | this.fileIdent(), |
| 2044 | this.fileExt(), |
| 2045 | (this.rootTable() !== null ? this.rootTable()!.unpack() : null), |
| 2046 | this.bb!.createObjList(this.services.bind(this), this.servicesLength()), |
| 2047 | this.advancedFeatures(), |
| 2048 | this.bb!.createObjList(this.fbsFiles.bind(this), this.fbsFilesLength()) |
| 2049 | ); |
| 2050 | } |
| 2051 | |
| 2052 | |
| 2053 | unpackTo(_o: SchemaT): void { |
| 2054 | _o.objects = this.bb!.createObjList(this.objects.bind(this), this.objectsLength()); |
| 2055 | _o.enums = this.bb!.createObjList(this.enums.bind(this), this.enumsLength()); |
| 2056 | _o.fileIdent = this.fileIdent(); |
| 2057 | _o.fileExt = this.fileExt(); |
| 2058 | _o.rootTable = (this.rootTable() !== null ? this.rootTable()!.unpack() : null); |
| 2059 | _o.services = this.bb!.createObjList(this.services.bind(this), this.servicesLength()); |
| 2060 | _o.advancedFeatures = this.advancedFeatures(); |
| 2061 | _o.fbsFiles = this.bb!.createObjList(this.fbsFiles.bind(this), this.fbsFilesLength()); |
| 2062 | } |
| 2063 | } |
| 2064 | |
| 2065 | export class SchemaT { |
| 2066 | constructor( |
| 2067 | public objects: (Object_T)[] = [], |
| 2068 | public enums: (EnumT)[] = [], |
| 2069 | public fileIdent: string|Uint8Array|null = null, |
| 2070 | public fileExt: string|Uint8Array|null = null, |
| 2071 | public rootTable: Object_T|null = null, |
| 2072 | public services: (ServiceT)[] = [], |
| 2073 | public advancedFeatures: bigint = BigInt('0'), |
| 2074 | public fbsFiles: (SchemaFileT)[] = [] |
| 2075 | ){} |
| 2076 | |
| 2077 | |
| 2078 | pack(builder:flatbuffers.Builder): flatbuffers.Offset { |
| 2079 | const objects = Schema.createObjectsVector(builder, builder.createObjectOffsetList(this.objects)); |
| 2080 | const enums = Schema.createEnumsVector(builder, builder.createObjectOffsetList(this.enums)); |
| 2081 | const fileIdent = (this.fileIdent !== null ? builder.createString(this.fileIdent!) : 0); |
| 2082 | const fileExt = (this.fileExt !== null ? builder.createString(this.fileExt!) : 0); |
| 2083 | const rootTable = (this.rootTable !== null ? this.rootTable!.pack(builder) : 0); |
| 2084 | const services = Schema.createServicesVector(builder, builder.createObjectOffsetList(this.services)); |
| 2085 | const fbsFiles = Schema.createFbsFilesVector(builder, builder.createObjectOffsetList(this.fbsFiles)); |
| 2086 | |
| 2087 | Schema.startSchema(builder); |
| 2088 | Schema.addObjects(builder, objects); |
| 2089 | Schema.addEnums(builder, enums); |
| 2090 | Schema.addFileIdent(builder, fileIdent); |
| 2091 | Schema.addFileExt(builder, fileExt); |
| 2092 | Schema.addRootTable(builder, rootTable); |
| 2093 | Schema.addServices(builder, services); |
| 2094 | Schema.addAdvancedFeatures(builder, this.advancedFeatures); |
| 2095 | Schema.addFbsFiles(builder, fbsFiles); |
| 2096 | |
| 2097 | return Schema.endSchema(builder); |
| 2098 | } |
| 2099 | } |
| 2100 | |