1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
|
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: optional_scalars
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
class ScalarStuff(object):
__slots__ = ['_tab']
@classmethod
def GetRootAs(cls, buf, offset=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = ScalarStuff()
x.Init(buf, n + offset)
return x
@classmethod
def GetRootAsScalarStuff(cls, buf, offset=0):
"""This method is deprecated. Please switch to GetRootAs."""
return cls.GetRootAs(buf, offset)
@classmethod
def ScalarStuffBufferHasIdentifier(cls, buf, offset, size_prefixed=False):
return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x4E\x55\x4C\x4C", size_prefixed=size_prefixed)
# ScalarStuff
def Init(self, buf, pos):
self._tab = flatbuffers.table.Table(buf, pos)
# ScalarStuff
def JustI8(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
return 0
# ScalarStuff
def MaybeI8(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
return None
# ScalarStuff
def DefaultI8(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
return 42
# ScalarStuff
def JustU8(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
return 0
# ScalarStuff
def MaybeU8(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
return None
# ScalarStuff
def DefaultU8(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
return 42
# ScalarStuff
def JustI16(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos)
return 0
# ScalarStuff
def MaybeI16(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos)
return None
# ScalarStuff
def DefaultI16(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(20))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos)
return 42
# ScalarStuff
def JustU16(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(22))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Uint16Flags, o + self._tab.Pos)
return 0
# ScalarStuff
def MaybeU16(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(24))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Uint16Flags, o + self._tab.Pos)
return None
# ScalarStuff
def DefaultU16(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(26))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Uint16Flags, o + self._tab.Pos)
return 42
# ScalarStuff
def JustI32(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(28))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
return 0
# ScalarStuff
def MaybeI32(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(30))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
return None
# ScalarStuff
def DefaultI32(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(32))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
return 42
# ScalarStuff
def JustU32(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(34))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos)
return 0
# ScalarStuff
def MaybeU32(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(36))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos)
return None
# ScalarStuff
def DefaultU32(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(38))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos)
return 42
# ScalarStuff
def JustI64(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(40))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
return 0
# ScalarStuff
def MaybeI64(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(42))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
return None
# ScalarStuff
def DefaultI64(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(44))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
return 42
# ScalarStuff
def JustU64(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(46))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
return 0
# ScalarStuff
def MaybeU64(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(48))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
return None
# ScalarStuff
def DefaultU64(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(50))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
return 42
# ScalarStuff
def JustF32(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(52))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos)
return 0.0
# ScalarStuff
def MaybeF32(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(54))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos)
return None
# ScalarStuff
def DefaultF32(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(56))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos)
return 42.0
# ScalarStuff
def JustF64(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(58))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Float64Flags, o + self._tab.Pos)
return 0.0
# ScalarStuff
def MaybeF64(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(60))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Float64Flags, o + self._tab.Pos)
return None
# ScalarStuff
def DefaultF64(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(62))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Float64Flags, o + self._tab.Pos)
return 42.0
# ScalarStuff
def JustBool(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(64))
if o != 0:
return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
return False
# ScalarStuff
def MaybeBool(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(66))
if o != 0:
return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
return None
# ScalarStuff
def DefaultBool(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(68))
if o != 0:
return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
return True
# ScalarStuff
def JustEnum(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(70))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
return 0
# ScalarStuff
def MaybeEnum(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(72))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
return None
# ScalarStuff
def DefaultEnum(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(74))
if o != 0:
return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
return 1
def ScalarStuffStart(builder):
builder.StartObject(36)
def Start(builder):
ScalarStuffStart(builder)
def ScalarStuffAddJustI8(builder, justI8):
builder.PrependInt8Slot(0, justI8, 0)
def AddJustI8(builder: flatbuffers.Builder, justI8: int):
ScalarStuffAddJustI8(builder, justI8)
def ScalarStuffAddMaybeI8(builder, maybeI8):
builder.PrependInt8Slot(1, maybeI8, None)
def AddMaybeI8(builder: flatbuffers.Builder, maybeI8: int):
ScalarStuffAddMaybeI8(builder, maybeI8)
def ScalarStuffAddDefaultI8(builder, defaultI8):
builder.PrependInt8Slot(2, defaultI8, 42)
def AddDefaultI8(builder: flatbuffers.Builder, defaultI8: int):
ScalarStuffAddDefaultI8(builder, defaultI8)
def ScalarStuffAddJustU8(builder, justU8):
builder.PrependUint8Slot(3, justU8, 0)
def AddJustU8(builder: flatbuffers.Builder, justU8: int):
ScalarStuffAddJustU8(builder, justU8)
def ScalarStuffAddMaybeU8(builder, maybeU8):
builder.PrependUint8Slot(4, maybeU8, None)
def AddMaybeU8(builder: flatbuffers.Builder, maybeU8: int):
ScalarStuffAddMaybeU8(builder, maybeU8)
def ScalarStuffAddDefaultU8(builder, defaultU8):
builder.PrependUint8Slot(5, defaultU8, 42)
def AddDefaultU8(builder: flatbuffers.Builder, defaultU8: int):
ScalarStuffAddDefaultU8(builder, defaultU8)
def ScalarStuffAddJustI16(builder, justI16):
builder.PrependInt16Slot(6, justI16, 0)
def AddJustI16(builder: flatbuffers.Builder, justI16: int):
ScalarStuffAddJustI16(builder, justI16)
def ScalarStuffAddMaybeI16(builder, maybeI16):
builder.PrependInt16Slot(7, maybeI16, None)
def AddMaybeI16(builder: flatbuffers.Builder, maybeI16: int):
ScalarStuffAddMaybeI16(builder, maybeI16)
def ScalarStuffAddDefaultI16(builder, defaultI16):
builder.PrependInt16Slot(8, defaultI16, 42)
def AddDefaultI16(builder: flatbuffers.Builder, defaultI16: int):
ScalarStuffAddDefaultI16(builder, defaultI16)
def ScalarStuffAddJustU16(builder, justU16):
builder.PrependUint16Slot(9, justU16, 0)
def AddJustU16(builder: flatbuffers.Builder, justU16: int):
ScalarStuffAddJustU16(builder, justU16)
def ScalarStuffAddMaybeU16(builder, maybeU16):
builder.PrependUint16Slot(10, maybeU16, None)
def AddMaybeU16(builder: flatbuffers.Builder, maybeU16: int):
ScalarStuffAddMaybeU16(builder, maybeU16)
def ScalarStuffAddDefaultU16(builder, defaultU16):
builder.PrependUint16Slot(11, defaultU16, 42)
def AddDefaultU16(builder: flatbuffers.Builder, defaultU16: int):
ScalarStuffAddDefaultU16(builder, defaultU16)
def ScalarStuffAddJustI32(builder, justI32):
builder.PrependInt32Slot(12, justI32, 0)
def AddJustI32(builder: flatbuffers.Builder, justI32: int):
ScalarStuffAddJustI32(builder, justI32)
def ScalarStuffAddMaybeI32(builder, maybeI32):
builder.PrependInt32Slot(13, maybeI32, None)
def AddMaybeI32(builder: flatbuffers.Builder, maybeI32: int):
ScalarStuffAddMaybeI32(builder, maybeI32)
def ScalarStuffAddDefaultI32(builder, defaultI32):
builder.PrependInt32Slot(14, defaultI32, 42)
def AddDefaultI32(builder: flatbuffers.Builder, defaultI32: int):
ScalarStuffAddDefaultI32(builder, defaultI32)
def ScalarStuffAddJustU32(builder, justU32):
builder.PrependUint32Slot(15, justU32, 0)
def AddJustU32(builder: flatbuffers.Builder, justU32: int):
ScalarStuffAddJustU32(builder, justU32)
def ScalarStuffAddMaybeU32(builder, maybeU32):
builder.PrependUint32Slot(16, maybeU32, None)
def AddMaybeU32(builder: flatbuffers.Builder, maybeU32: int):
ScalarStuffAddMaybeU32(builder, maybeU32)
def ScalarStuffAddDefaultU32(builder, defaultU32):
builder.PrependUint32Slot(17, defaultU32, 42)
def AddDefaultU32(builder: flatbuffers.Builder, defaultU32: int):
ScalarStuffAddDefaultU32(builder, defaultU32)
def ScalarStuffAddJustI64(builder, justI64):
builder.PrependInt64Slot(18, justI64, 0)
def AddJustI64(builder: flatbuffers.Builder, justI64: int):
ScalarStuffAddJustI64(builder, justI64)
def ScalarStuffAddMaybeI64(builder, maybeI64):
builder.PrependInt64Slot(19, maybeI64, None)
def AddMaybeI64(builder: flatbuffers.Builder, maybeI64: int):
ScalarStuffAddMaybeI64(builder, maybeI64)
def ScalarStuffAddDefaultI64(builder, defaultI64):
builder.PrependInt64Slot(20, defaultI64, 42)
def AddDefaultI64(builder: flatbuffers.Builder, defaultI64: int):
ScalarStuffAddDefaultI64(builder, defaultI64)
def ScalarStuffAddJustU64(builder, justU64):
builder.PrependUint64Slot(21, justU64, 0)
def AddJustU64(builder: flatbuffers.Builder, justU64: int):
ScalarStuffAddJustU64(builder, justU64)
def ScalarStuffAddMaybeU64(builder, maybeU64):
builder.PrependUint64Slot(22, maybeU64, None)
def AddMaybeU64(builder: flatbuffers.Builder, maybeU64: int):
ScalarStuffAddMaybeU64(builder, maybeU64)
def ScalarStuffAddDefaultU64(builder, defaultU64):
builder.PrependUint64Slot(23, defaultU64, 42)
def AddDefaultU64(builder: flatbuffers.Builder, defaultU64: int):
ScalarStuffAddDefaultU64(builder, defaultU64)
def ScalarStuffAddJustF32(builder, justF32):
builder.PrependFloat32Slot(24, justF32, 0.0)
def AddJustF32(builder: flatbuffers.Builder, justF32: float):
ScalarStuffAddJustF32(builder, justF32)
def ScalarStuffAddMaybeF32(builder, maybeF32):
builder.PrependFloat32Slot(25, maybeF32, None)
def AddMaybeF32(builder: flatbuffers.Builder, maybeF32: float):
ScalarStuffAddMaybeF32(builder, maybeF32)
def ScalarStuffAddDefaultF32(builder, defaultF32):
builder.PrependFloat32Slot(26, defaultF32, 42.0)
def AddDefaultF32(builder: flatbuffers.Builder, defaultF32: float):
ScalarStuffAddDefaultF32(builder, defaultF32)
def ScalarStuffAddJustF64(builder, justF64):
builder.PrependFloat64Slot(27, justF64, 0.0)
def AddJustF64(builder: flatbuffers.Builder, justF64: float):
ScalarStuffAddJustF64(builder, justF64)
def ScalarStuffAddMaybeF64(builder, maybeF64):
builder.PrependFloat64Slot(28, maybeF64, None)
def AddMaybeF64(builder: flatbuffers.Builder, maybeF64: float):
ScalarStuffAddMaybeF64(builder, maybeF64)
def ScalarStuffAddDefaultF64(builder, defaultF64):
builder.PrependFloat64Slot(29, defaultF64, 42.0)
def AddDefaultF64(builder: flatbuffers.Builder, defaultF64: float):
ScalarStuffAddDefaultF64(builder, defaultF64)
def ScalarStuffAddJustBool(builder, justBool):
builder.PrependBoolSlot(30, justBool, 0)
def AddJustBool(builder: flatbuffers.Builder, justBool: bool):
ScalarStuffAddJustBool(builder, justBool)
def ScalarStuffAddMaybeBool(builder, maybeBool):
builder.PrependBoolSlot(31, maybeBool, None)
def AddMaybeBool(builder: flatbuffers.Builder, maybeBool: bool):
ScalarStuffAddMaybeBool(builder, maybeBool)
def ScalarStuffAddDefaultBool(builder, defaultBool):
builder.PrependBoolSlot(32, defaultBool, 1)
def AddDefaultBool(builder: flatbuffers.Builder, defaultBool: bool):
ScalarStuffAddDefaultBool(builder, defaultBool)
def ScalarStuffAddJustEnum(builder, justEnum):
builder.PrependInt8Slot(33, justEnum, 0)
def AddJustEnum(builder: flatbuffers.Builder, justEnum: int):
ScalarStuffAddJustEnum(builder, justEnum)
def ScalarStuffAddMaybeEnum(builder, maybeEnum):
builder.PrependInt8Slot(34, maybeEnum, None)
def AddMaybeEnum(builder: flatbuffers.Builder, maybeEnum: int):
ScalarStuffAddMaybeEnum(builder, maybeEnum)
def ScalarStuffAddDefaultEnum(builder, defaultEnum):
builder.PrependInt8Slot(35, defaultEnum, 1)
def AddDefaultEnum(builder: flatbuffers.Builder, defaultEnum: int):
ScalarStuffAddDefaultEnum(builder, defaultEnum)
def ScalarStuffEnd(builder):
return builder.EndObject()
def End(builder):
return ScalarStuffEnd(builder)
class ScalarStuffT(object):
# ScalarStuffT
def __init__(self):
self.justI8 = 0 # type: int
self.maybeI8 = None # type: Optional[int]
self.defaultI8 = 42 # type: int
self.justU8 = 0 # type: int
self.maybeU8 = None # type: Optional[int]
self.defaultU8 = 42 # type: int
self.justI16 = 0 # type: int
self.maybeI16 = None # type: Optional[int]
self.defaultI16 = 42 # type: int
self.justU16 = 0 # type: int
self.maybeU16 = None # type: Optional[int]
self.defaultU16 = 42 # type: int
self.justI32 = 0 # type: int
self.maybeI32 = None # type: Optional[int]
self.defaultI32 = 42 # type: int
self.justU32 = 0 # type: int
self.maybeU32 = None # type: Optional[int]
self.defaultU32 = 42 # type: int
self.justI64 = 0 # type: int
self.maybeI64 = None # type: Optional[int]
self.defaultI64 = 42 # type: int
self.justU64 = 0 # type: int
self.maybeU64 = None # type: Optional[int]
self.defaultU64 = 42 # type: int
self.justF32 = 0.0 # type: float
self.maybeF32 = None # type: Optional[float]
self.defaultF32 = 42.0 # type: float
self.justF64 = 0.0 # type: float
self.maybeF64 = None # type: Optional[float]
self.defaultF64 = 42.0 # type: float
self.justBool = False # type: bool
self.maybeBool = None # type: Optional[bool]
self.defaultBool = True # type: bool
self.justEnum = 0 # type: int
self.maybeEnum = None # type: Optional[int]
self.defaultEnum = 1 # type: int
@classmethod
def InitFromBuf(cls, buf, pos):
scalarStuff = ScalarStuff()
scalarStuff.Init(buf, pos)
return cls.InitFromObj(scalarStuff)
@classmethod
def InitFromPackedBuf(cls, buf, pos=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)
return cls.InitFromBuf(buf, pos+n)
@classmethod
def InitFromObj(cls, scalarStuff):
x = ScalarStuffT()
x._UnPack(scalarStuff)
return x
# ScalarStuffT
def _UnPack(self, scalarStuff):
if scalarStuff is None:
return
self.justI8 = scalarStuff.JustI8()
self.maybeI8 = scalarStuff.MaybeI8()
self.defaultI8 = scalarStuff.DefaultI8()
self.justU8 = scalarStuff.JustU8()
self.maybeU8 = scalarStuff.MaybeU8()
self.defaultU8 = scalarStuff.DefaultU8()
self.justI16 = scalarStuff.JustI16()
self.maybeI16 = scalarStuff.MaybeI16()
self.defaultI16 = scalarStuff.DefaultI16()
self.justU16 = scalarStuff.JustU16()
self.maybeU16 = scalarStuff.MaybeU16()
self.defaultU16 = scalarStuff.DefaultU16()
self.justI32 = scalarStuff.JustI32()
self.maybeI32 = scalarStuff.MaybeI32()
self.defaultI32 = scalarStuff.DefaultI32()
self.justU32 = scalarStuff.JustU32()
self.maybeU32 = scalarStuff.MaybeU32()
self.defaultU32 = scalarStuff.DefaultU32()
self.justI64 = scalarStuff.JustI64()
self.maybeI64 = scalarStuff.MaybeI64()
self.defaultI64 = scalarStuff.DefaultI64()
self.justU64 = scalarStuff.JustU64()
self.maybeU64 = scalarStuff.MaybeU64()
self.defaultU64 = scalarStuff.DefaultU64()
self.justF32 = scalarStuff.JustF32()
self.maybeF32 = scalarStuff.MaybeF32()
self.defaultF32 = scalarStuff.DefaultF32()
self.justF64 = scalarStuff.JustF64()
self.maybeF64 = scalarStuff.MaybeF64()
self.defaultF64 = scalarStuff.DefaultF64()
self.justBool = scalarStuff.JustBool()
self.maybeBool = scalarStuff.MaybeBool()
self.defaultBool = scalarStuff.DefaultBool()
self.justEnum = scalarStuff.JustEnum()
self.maybeEnum = scalarStuff.MaybeEnum()
self.defaultEnum = scalarStuff.DefaultEnum()
# ScalarStuffT
def Pack(self, builder):
ScalarStuffStart(builder)
ScalarStuffAddJustI8(builder, self.justI8)
ScalarStuffAddMaybeI8(builder, self.maybeI8)
ScalarStuffAddDefaultI8(builder, self.defaultI8)
ScalarStuffAddJustU8(builder, self.justU8)
ScalarStuffAddMaybeU8(builder, self.maybeU8)
ScalarStuffAddDefaultU8(builder, self.defaultU8)
ScalarStuffAddJustI16(builder, self.justI16)
ScalarStuffAddMaybeI16(builder, self.maybeI16)
ScalarStuffAddDefaultI16(builder, self.defaultI16)
ScalarStuffAddJustU16(builder, self.justU16)
ScalarStuffAddMaybeU16(builder, self.maybeU16)
ScalarStuffAddDefaultU16(builder, self.defaultU16)
ScalarStuffAddJustI32(builder, self.justI32)
ScalarStuffAddMaybeI32(builder, self.maybeI32)
ScalarStuffAddDefaultI32(builder, self.defaultI32)
ScalarStuffAddJustU32(builder, self.justU32)
ScalarStuffAddMaybeU32(builder, self.maybeU32)
ScalarStuffAddDefaultU32(builder, self.defaultU32)
ScalarStuffAddJustI64(builder, self.justI64)
ScalarStuffAddMaybeI64(builder, self.maybeI64)
ScalarStuffAddDefaultI64(builder, self.defaultI64)
ScalarStuffAddJustU64(builder, self.justU64)
ScalarStuffAddMaybeU64(builder, self.maybeU64)
ScalarStuffAddDefaultU64(builder, self.defaultU64)
ScalarStuffAddJustF32(builder, self.justF32)
ScalarStuffAddMaybeF32(builder, self.maybeF32)
ScalarStuffAddDefaultF32(builder, self.defaultF32)
ScalarStuffAddJustF64(builder, self.justF64)
ScalarStuffAddMaybeF64(builder, self.maybeF64)
ScalarStuffAddDefaultF64(builder, self.defaultF64)
ScalarStuffAddJustBool(builder, self.justBool)
ScalarStuffAddMaybeBool(builder, self.maybeBool)
ScalarStuffAddDefaultBool(builder, self.defaultBool)
ScalarStuffAddJustEnum(builder, self.justEnum)
ScalarStuffAddMaybeEnum(builder, self.maybeEnum)
ScalarStuffAddDefaultEnum(builder, self.defaultEnum)
scalarStuff = ScalarStuffEnd(builder)
return scalarStuff
|