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