| 1 |
// automatically generated by the FlatBuffers compiler, do not modify |
| 2 |
|
| 3 |
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ |
| 4 |
|
| 5 |
import * as flatbuffers from 'flatbuffers'; |
| 6 |
|
| 7 |
import { OptionalByte } from '../optional-scalars/optional-byte'; |
| 8 |
|
| 9 |
|
| 10 |
export class ScalarStuff { |
| 11 |
bb: flatbuffers.ByteBuffer|null = null; |
| 12 |
bb_pos = 0; |
| 13 |
__init(i:number, bb:flatbuffers.ByteBuffer):ScalarStuff { |
| 14 |
this.bb_pos = i; |
| 15 |
this.bb = bb; |
| 16 |
return this; |
| 17 |
} |
| 18 |
|
| 19 |
static getRootAsScalarStuff(bb:flatbuffers.ByteBuffer, obj?:ScalarStuff):ScalarStuff { |
| 20 |
return (obj || new ScalarStuff()).__init(bb.readInt32(bb.position()) + bb.position(), bb); |
| 21 |
} |
| 22 |
|
| 23 |
static getSizePrefixedRootAsScalarStuff(bb:flatbuffers.ByteBuffer, obj?:ScalarStuff):ScalarStuff { |
| 24 |
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); |
| 25 |
return (obj || new ScalarStuff()).__init(bb.readInt32(bb.position()) + bb.position(), bb); |
| 26 |
} |
| 27 |
|
| 28 |
static bufferHasIdentifier(bb:flatbuffers.ByteBuffer):boolean { |
| 29 |
return bb.__has_identifier('NULL'); |
| 30 |
} |
| 31 |
|
| 32 |
justI8():number { |
| 33 |
const offset = this.bb!.__offset(this.bb_pos, 4); |
| 34 |
return offset ? this.bb!.readInt8(this.bb_pos + offset) : 0; |
| 35 |
} |
| 36 |
|
| 37 |
maybeI8():number|null { |
| 38 |
const offset = this.bb!.__offset(this.bb_pos, 6); |
| 39 |
return offset ? this.bb!.readInt8(this.bb_pos + offset) : null; |
| 40 |
} |
| 41 |
|
| 42 |
defaultI8():number { |
| 43 |
const offset = this.bb!.__offset(this.bb_pos, 8); |
| 44 |
return offset ? this.bb!.readInt8(this.bb_pos + offset) : 42; |
| 45 |
} |
| 46 |
|
| 47 |
justU8():number { |
| 48 |
const offset = this.bb!.__offset(this.bb_pos, 10); |
| 49 |
return offset ? this.bb!.readUint8(this.bb_pos + offset) : 0; |
| 50 |
} |
| 51 |
|
| 52 |
maybeU8():number|null { |
| 53 |
const offset = this.bb!.__offset(this.bb_pos, 12); |
| 54 |
return offset ? this.bb!.readUint8(this.bb_pos + offset) : null; |
| 55 |
} |
| 56 |
|
| 57 |
defaultU8():number { |
| 58 |
const offset = this.bb!.__offset(this.bb_pos, 14); |
| 59 |
return offset ? this.bb!.readUint8(this.bb_pos + offset) : 42; |
| 60 |
} |
| 61 |
|
| 62 |
justI16():number { |
| 63 |
const offset = this.bb!.__offset(this.bb_pos, 16); |
| 64 |
return offset ? this.bb!.readInt16(this.bb_pos + offset) : 0; |
| 65 |
} |
| 66 |
|
| 67 |
maybeI16():number|null { |
| 68 |
const offset = this.bb!.__offset(this.bb_pos, 18); |
| 69 |
return offset ? this.bb!.readInt16(this.bb_pos + offset) : null; |
| 70 |
} |
| 71 |
|
| 72 |
defaultI16():number { |
| 73 |
const offset = this.bb!.__offset(this.bb_pos, 20); |
| 74 |
return offset ? this.bb!.readInt16(this.bb_pos + offset) : 42; |
| 75 |
} |
| 76 |
|
| 77 |
justU16():number { |
| 78 |
const offset = this.bb!.__offset(this.bb_pos, 22); |
| 79 |
return offset ? this.bb!.readUint16(this.bb_pos + offset) : 0; |
| 80 |
} |
| 81 |
|
| 82 |
maybeU16():number|null { |
| 83 |
const offset = this.bb!.__offset(this.bb_pos, 24); |
| 84 |
return offset ? this.bb!.readUint16(this.bb_pos + offset) : null; |
| 85 |
} |
| 86 |
|
| 87 |
defaultU16():number { |
| 88 |
const offset = this.bb!.__offset(this.bb_pos, 26); |
| 89 |
return offset ? this.bb!.readUint16(this.bb_pos + offset) : 42; |
| 90 |
} |
| 91 |
|
| 92 |
justI32():number { |
| 93 |
const offset = this.bb!.__offset(this.bb_pos, 28); |
| 94 |
return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0; |
| 95 |
} |
| 96 |
|
| 97 |
maybeI32():number|null { |
| 98 |
const offset = this.bb!.__offset(this.bb_pos, 30); |
| 99 |
return offset ? this.bb!.readInt32(this.bb_pos + offset) : null; |
| 100 |
} |
| 101 |
|
| 102 |
defaultI32():number { |
| 103 |
const offset = this.bb!.__offset(this.bb_pos, 32); |
| 104 |
return offset ? this.bb!.readInt32(this.bb_pos + offset) : 42; |
| 105 |
} |
| 106 |
|
| 107 |
justU32():number { |
| 108 |
const offset = this.bb!.__offset(this.bb_pos, 34); |
| 109 |
return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0; |
| 110 |
} |
| 111 |
|
| 112 |
maybeU32():number|null { |
| 113 |
const offset = this.bb!.__offset(this.bb_pos, 36); |
| 114 |
return offset ? this.bb!.readUint32(this.bb_pos + offset) : null; |
| 115 |
} |
| 116 |
|
| 117 |
defaultU32():number { |
| 118 |
const offset = this.bb!.__offset(this.bb_pos, 38); |
| 119 |
return offset ? this.bb!.readUint32(this.bb_pos + offset) : 42; |
| 120 |
} |
| 121 |
|
| 122 |
justI64():bigint { |
| 123 |
const offset = this.bb!.__offset(this.bb_pos, 40); |
| 124 |
return offset ? this.bb!.readInt64(this.bb_pos + offset) : BigInt('0'); |
| 125 |
} |
| 126 |
|
| 127 |
maybeI64():bigint|null { |
| 128 |
const offset = this.bb!.__offset(this.bb_pos, 42); |
| 129 |
return offset ? this.bb!.readInt64(this.bb_pos + offset) : null; |
| 130 |
} |
| 131 |
|
| 132 |
defaultI64():bigint { |
| 133 |
const offset = this.bb!.__offset(this.bb_pos, 44); |
| 134 |
return offset ? this.bb!.readInt64(this.bb_pos + offset) : BigInt('42'); |
| 135 |
} |
| 136 |
|
| 137 |
justU64():bigint { |
| 138 |
const offset = this.bb!.__offset(this.bb_pos, 46); |
| 139 |
return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0'); |
| 140 |
} |
| 141 |
|
| 142 |
maybeU64():bigint|null { |
| 143 |
const offset = this.bb!.__offset(this.bb_pos, 48); |
| 144 |
return offset ? this.bb!.readUint64(this.bb_pos + offset) : null; |
| 145 |
} |
| 146 |
|
| 147 |
defaultU64():bigint { |
| 148 |
const offset = this.bb!.__offset(this.bb_pos, 50); |
| 149 |
return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('42'); |
| 150 |
} |
| 151 |
|
| 152 |
justF32():number { |
| 153 |
const offset = this.bb!.__offset(this.bb_pos, 52); |
| 154 |
return offset ? this.bb!.readFloat32(this.bb_pos + offset) : 0.0; |
| 155 |
} |
| 156 |
|
| 157 |
maybeF32():number|null { |
| 158 |
const offset = this.bb!.__offset(this.bb_pos, 54); |
| 159 |
return offset ? this.bb!.readFloat32(this.bb_pos + offset) : null; |
| 160 |
} |
| 161 |
|
| 162 |
defaultF32():number { |
| 163 |
const offset = this.bb!.__offset(this.bb_pos, 56); |
| 164 |
return offset ? this.bb!.readFloat32(this.bb_pos + offset) : 42.0; |
| 165 |
} |
| 166 |
|
| 167 |
justF64():number { |
| 168 |
const offset = this.bb!.__offset(this.bb_pos, 58); |
| 169 |
return offset ? this.bb!.readFloat64(this.bb_pos + offset) : 0.0; |
| 170 |
} |
| 171 |
|
| 172 |
maybeF64():number|null { |
| 173 |
const offset = this.bb!.__offset(this.bb_pos, 60); |
| 174 |
return offset ? this.bb!.readFloat64(this.bb_pos + offset) : null; |
| 175 |
} |
| 176 |
|
| 177 |
defaultF64():number { |
| 178 |
const offset = this.bb!.__offset(this.bb_pos, 62); |
| 179 |
return offset ? this.bb!.readFloat64(this.bb_pos + offset) : 42.0; |
| 180 |
} |
| 181 |
|
| 182 |
justBool():boolean { |
| 183 |
const offset = this.bb!.__offset(this.bb_pos, 64); |
| 184 |
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false; |
| 185 |
} |
| 186 |
|
| 187 |
maybeBool():boolean|null { |
| 188 |
const offset = this.bb!.__offset(this.bb_pos, 66); |
| 189 |
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : null; |
| 190 |
} |
| 191 |
|
| 192 |
defaultBool():boolean { |
| 193 |
const offset = this.bb!.__offset(this.bb_pos, 68); |
| 194 |
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : true; |
| 195 |
} |
| 196 |
|
| 197 |
justEnum():OptionalByte { |
| 198 |
const offset = this.bb!.__offset(this.bb_pos, 70); |
| 199 |
return offset ? this.bb!.readInt8(this.bb_pos + offset) : OptionalByte.None; |
| 200 |
} |
| 201 |
|
| 202 |
maybeEnum():OptionalByte|null { |
| 203 |
const offset = this.bb!.__offset(this.bb_pos, 72); |
| 204 |
return offset ? this.bb!.readInt8(this.bb_pos + offset) : null; |
| 205 |
} |
| 206 |
|
| 207 |
defaultEnum():OptionalByte { |
| 208 |
const offset = this.bb!.__offset(this.bb_pos, 74); |
| 209 |
return offset ? this.bb!.readInt8(this.bb_pos + offset) : OptionalByte.One; |
| 210 |
} |
| 211 |
|
| 212 |
static getFullyQualifiedName():string { |
| 213 |
return 'optional_scalars.ScalarStuff'; |
| 214 |
} |
| 215 |
|
| 216 |
static startScalarStuff(builder:flatbuffers.Builder) { |
| 217 |
builder.startObject(36); |
| 218 |
} |
| 219 |
|
| 220 |
static addJustI8(builder:flatbuffers.Builder, justI8:number) { |
| 221 |
builder.addFieldInt8(0, justI8, 0); |
| 222 |
} |
| 223 |
|
| 224 |
static addMaybeI8(builder:flatbuffers.Builder, maybeI8:number) { |
| 225 |
builder.addFieldInt8(1, maybeI8, null); |
| 226 |
} |
| 227 |
|
| 228 |
static addDefaultI8(builder:flatbuffers.Builder, defaultI8:number) { |
| 229 |
builder.addFieldInt8(2, defaultI8, 42); |
| 230 |
} |
| 231 |
|
| 232 |
static addJustU8(builder:flatbuffers.Builder, justU8:number) { |
| 233 |
builder.addFieldInt8(3, justU8, 0); |
| 234 |
} |
| 235 |
|
| 236 |
static addMaybeU8(builder:flatbuffers.Builder, maybeU8:number) { |
| 237 |
builder.addFieldInt8(4, maybeU8, null); |
| 238 |
} |
| 239 |
|
| 240 |
static addDefaultU8(builder:flatbuffers.Builder, defaultU8:number) { |
| 241 |
builder.addFieldInt8(5, defaultU8, 42); |
| 242 |
} |
| 243 |
|
| 244 |
static addJustI16(builder:flatbuffers.Builder, justI16:number) { |
| 245 |
builder.addFieldInt16(6, justI16, 0); |
| 246 |
} |
| 247 |
|
| 248 |
static addMaybeI16(builder:flatbuffers.Builder, maybeI16:number) { |
| 249 |
builder.addFieldInt16(7, maybeI16, null); |
| 250 |
} |
| 251 |
|
| 252 |
static addDefaultI16(builder:flatbuffers.Builder, defaultI16:number) { |
| 253 |
builder.addFieldInt16(8, defaultI16, 42); |
| 254 |
} |
| 255 |
|
| 256 |
static addJustU16(builder:flatbuffers.Builder, justU16:number) { |
| 257 |
builder.addFieldInt16(9, justU16, 0); |
| 258 |
} |
| 259 |
|
| 260 |
static addMaybeU16(builder:flatbuffers.Builder, maybeU16:number) { |
| 261 |
builder.addFieldInt16(10, maybeU16, null); |
| 262 |
} |
| 263 |
|
| 264 |
static addDefaultU16(builder:flatbuffers.Builder, defaultU16:number) { |
| 265 |
builder.addFieldInt16(11, defaultU16, 42); |
| 266 |
} |
| 267 |
|
| 268 |
static addJustI32(builder:flatbuffers.Builder, justI32:number) { |
| 269 |
builder.addFieldInt32(12, justI32, 0); |
| 270 |
} |
| 271 |
|
| 272 |
static addMaybeI32(builder:flatbuffers.Builder, maybeI32:number) { |
| 273 |
builder.addFieldInt32(13, maybeI32, null); |
| 274 |
} |
| 275 |
|
| 276 |
static addDefaultI32(builder:flatbuffers.Builder, defaultI32:number) { |
| 277 |
builder.addFieldInt32(14, defaultI32, 42); |
| 278 |
} |
| 279 |
|
| 280 |
static addJustU32(builder:flatbuffers.Builder, justU32:number) { |
| 281 |
builder.addFieldInt32(15, justU32, 0); |
| 282 |
} |
| 283 |
|
| 284 |
static addMaybeU32(builder:flatbuffers.Builder, maybeU32:number) { |
| 285 |
builder.addFieldInt32(16, maybeU32, null); |
| 286 |
} |
| 287 |
|
| 288 |
static addDefaultU32(builder:flatbuffers.Builder, defaultU32:number) { |
| 289 |
builder.addFieldInt32(17, defaultU32, 42); |
| 290 |
} |
| 291 |
|
| 292 |
static addJustI64(builder:flatbuffers.Builder, justI64:bigint) { |
| 293 |
builder.addFieldInt64(18, justI64, BigInt('0')); |
| 294 |
} |
| 295 |
|
| 296 |
static addMaybeI64(builder:flatbuffers.Builder, maybeI64:bigint) { |
| 297 |
builder.addFieldInt64(19, maybeI64, null); |
| 298 |
} |
| 299 |
|
| 300 |
static addDefaultI64(builder:flatbuffers.Builder, defaultI64:bigint) { |
| 301 |
builder.addFieldInt64(20, defaultI64, BigInt('42')); |
| 302 |
} |
| 303 |
|
| 304 |
static addJustU64(builder:flatbuffers.Builder, justU64:bigint) { |
| 305 |
builder.addFieldInt64(21, justU64, BigInt('0')); |
| 306 |
} |
| 307 |
|
| 308 |
static addMaybeU64(builder:flatbuffers.Builder, maybeU64:bigint) { |
| 309 |
builder.addFieldInt64(22, maybeU64, null); |
| 310 |
} |
| 311 |
|
| 312 |
static addDefaultU64(builder:flatbuffers.Builder, defaultU64:bigint) { |
| 313 |
builder.addFieldInt64(23, defaultU64, BigInt('42')); |
| 314 |
} |
| 315 |
|
| 316 |
static addJustF32(builder:flatbuffers.Builder, justF32:number) { |
| 317 |
builder.addFieldFloat32(24, justF32, 0.0); |
| 318 |
} |
| 319 |
|
| 320 |
static addMaybeF32(builder:flatbuffers.Builder, maybeF32:number) { |
| 321 |
builder.addFieldFloat32(25, maybeF32, null); |
| 322 |
} |
| 323 |
|
| 324 |
static addDefaultF32(builder:flatbuffers.Builder, defaultF32:number) { |
| 325 |
builder.addFieldFloat32(26, defaultF32, 42.0); |
| 326 |
} |
| 327 |
|
| 328 |
static addJustF64(builder:flatbuffers.Builder, justF64:number) { |
| 329 |
builder.addFieldFloat64(27, justF64, 0.0); |
| 330 |
} |
| 331 |
|
| 332 |
static addMaybeF64(builder:flatbuffers.Builder, maybeF64:number) { |
| 333 |
builder.addFieldFloat64(28, maybeF64, null); |
| 334 |
} |
| 335 |
|
| 336 |
static addDefaultF64(builder:flatbuffers.Builder, defaultF64:number) { |
| 337 |
builder.addFieldFloat64(29, defaultF64, 42.0); |
| 338 |
} |
| 339 |
|
| 340 |
static addJustBool(builder:flatbuffers.Builder, justBool:boolean) { |
| 341 |
builder.addFieldInt8(30, +justBool, +false); |
| 342 |
} |
| 343 |
|
| 344 |
static addMaybeBool(builder:flatbuffers.Builder, maybeBool:boolean) { |
| 345 |
builder.addFieldInt8(31, +maybeBool, null); |
| 346 |
} |
| 347 |
|
| 348 |
static addDefaultBool(builder:flatbuffers.Builder, defaultBool:boolean) { |
| 349 |
builder.addFieldInt8(32, +defaultBool, +true); |
| 350 |
} |
| 351 |
|
| 352 |
static addJustEnum(builder:flatbuffers.Builder, justEnum:OptionalByte) { |
| 353 |
builder.addFieldInt8(33, justEnum, OptionalByte.None); |
| 354 |
} |
| 355 |
|
| 356 |
static addMaybeEnum(builder:flatbuffers.Builder, maybeEnum:OptionalByte) { |
| 357 |
builder.addFieldInt8(34, maybeEnum, null); |
| 358 |
} |
| 359 |
|
| 360 |
static addDefaultEnum(builder:flatbuffers.Builder, defaultEnum:OptionalByte) { |
| 361 |
builder.addFieldInt8(35, defaultEnum, OptionalByte.One); |
| 362 |
} |
| 363 |
|
| 364 |
static endScalarStuff(builder:flatbuffers.Builder):flatbuffers.Offset { |
| 365 |
const offset = builder.endObject(); |
| 366 |
return offset; |
| 367 |
} |
| 368 |
|
| 369 |
static finishScalarStuffBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) { |
| 370 |
builder.finish(offset, 'NULL'); |
| 371 |
} |
| 372 |
|
| 373 |
static finishSizePrefixedScalarStuffBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) { |
| 374 |
builder.finish(offset, 'NULL', true); |
| 375 |
} |
| 376 |
|
| 377 |
static createScalarStuff(builder:flatbuffers.Builder, justI8:number, maybeI8:number|null, defaultI8:number, justU8:number, maybeU8:number|null, defaultU8:number, justI16:number, maybeI16:number|null, defaultI16:number, justU16:number, maybeU16:number|null, defaultU16:number, justI32:number, maybeI32:number|null, defaultI32:number, justU32:number, maybeU32:number|null, defaultU32:number, justI64:bigint, maybeI64:bigint|null, defaultI64:bigint, justU64:bigint, maybeU64:bigint|null, defaultU64:bigint, justF32:number, maybeF32:number|null, defaultF32:number, justF64:number, maybeF64:number|null, defaultF64:number, justBool:boolean, maybeBool:boolean|null, defaultBool:boolean, justEnum:OptionalByte, maybeEnum:OptionalByte|null, defaultEnum:OptionalByte):flatbuffers.Offset { |
| 378 |
ScalarStuff.startScalarStuff(builder); |
| 379 |
ScalarStuff.addJustI8(builder, justI8); |
| 380 |
if (maybeI8 !== null) |
| 381 |
ScalarStuff.addMaybeI8(builder, maybeI8); |
| 382 |
ScalarStuff.addDefaultI8(builder, defaultI8); |
| 383 |
ScalarStuff.addJustU8(builder, justU8); |
| 384 |
if (maybeU8 !== null) |
| 385 |
ScalarStuff.addMaybeU8(builder, maybeU8); |
| 386 |
ScalarStuff.addDefaultU8(builder, defaultU8); |
| 387 |
ScalarStuff.addJustI16(builder, justI16); |
| 388 |
if (maybeI16 !== null) |
| 389 |
ScalarStuff.addMaybeI16(builder, maybeI16); |
| 390 |
ScalarStuff.addDefaultI16(builder, defaultI16); |
| 391 |
ScalarStuff.addJustU16(builder, justU16); |
| 392 |
if (maybeU16 !== null) |
| 393 |
ScalarStuff.addMaybeU16(builder, maybeU16); |
| 394 |
ScalarStuff.addDefaultU16(builder, defaultU16); |
| 395 |
ScalarStuff.addJustI32(builder, justI32); |
| 396 |
if (maybeI32 !== null) |
| 397 |
ScalarStuff.addMaybeI32(builder, maybeI32); |
| 398 |
ScalarStuff.addDefaultI32(builder, defaultI32); |
| 399 |
ScalarStuff.addJustU32(builder, justU32); |
| 400 |
if (maybeU32 !== null) |
| 401 |
ScalarStuff.addMaybeU32(builder, maybeU32); |
| 402 |
ScalarStuff.addDefaultU32(builder, defaultU32); |
| 403 |
ScalarStuff.addJustI64(builder, justI64); |
| 404 |
if (maybeI64 !== null) |
| 405 |
ScalarStuff.addMaybeI64(builder, maybeI64); |
| 406 |
ScalarStuff.addDefaultI64(builder, defaultI64); |
| 407 |
ScalarStuff.addJustU64(builder, justU64); |
| 408 |
if (maybeU64 !== null) |
| 409 |
ScalarStuff.addMaybeU64(builder, maybeU64); |
| 410 |
ScalarStuff.addDefaultU64(builder, defaultU64); |
| 411 |
ScalarStuff.addJustF32(builder, justF32); |
| 412 |
if (maybeF32 !== null) |
| 413 |
ScalarStuff.addMaybeF32(builder, maybeF32); |
| 414 |
ScalarStuff.addDefaultF32(builder, defaultF32); |
| 415 |
ScalarStuff.addJustF64(builder, justF64); |
| 416 |
if (maybeF64 !== null) |
| 417 |
ScalarStuff.addMaybeF64(builder, maybeF64); |
| 418 |
ScalarStuff.addDefaultF64(builder, defaultF64); |
| 419 |
ScalarStuff.addJustBool(builder, justBool); |
| 420 |
if (maybeBool !== null) |
| 421 |
ScalarStuff.addMaybeBool(builder, maybeBool); |
| 422 |
ScalarStuff.addDefaultBool(builder, defaultBool); |
| 423 |
ScalarStuff.addJustEnum(builder, justEnum); |
| 424 |
if (maybeEnum !== null) |
| 425 |
ScalarStuff.addMaybeEnum(builder, maybeEnum); |
| 426 |
ScalarStuff.addDefaultEnum(builder, defaultEnum); |
| 427 |
return ScalarStuff.endScalarStuff(builder); |
| 428 |
} |
| 429 |
} |