ai-edge-litert-nightly 2.2.0.dev20260102__cp312-cp312-manylinux_2_27_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ai_edge_litert/__init__.py +1 -0
- ai_edge_litert/_pywrap_analyzer_wrapper.so +0 -0
- ai_edge_litert/_pywrap_litert_compiled_model_wrapper.so +0 -0
- ai_edge_litert/_pywrap_litert_interpreter_wrapper.so +0 -0
- ai_edge_litert/_pywrap_litert_tensor_buffer_wrapper.so +0 -0
- ai_edge_litert/_pywrap_modify_model_interface.so +0 -0
- ai_edge_litert/_pywrap_string_util.so +0 -0
- ai_edge_litert/_pywrap_tensorflow_lite_calibration_wrapper.so +0 -0
- ai_edge_litert/_pywrap_tensorflow_lite_metrics_wrapper.so +0 -0
- ai_edge_litert/any_pb2.py +37 -0
- ai_edge_litert/aot/__init__.py +0 -0
- ai_edge_litert/aot/ai_pack/__init__.py +0 -0
- ai_edge_litert/aot/ai_pack/export_lib.py +300 -0
- ai_edge_litert/aot/aot_compile.py +153 -0
- ai_edge_litert/aot/core/__init__.py +0 -0
- ai_edge_litert/aot/core/apply_plugin.py +148 -0
- ai_edge_litert/aot/core/common.py +97 -0
- ai_edge_litert/aot/core/components.py +93 -0
- ai_edge_litert/aot/core/mlir_transforms.py +36 -0
- ai_edge_litert/aot/core/tflxx_util.py +30 -0
- ai_edge_litert/aot/core/types.py +374 -0
- ai_edge_litert/aot/prepare_for_npu.py +152 -0
- ai_edge_litert/aot/vendors/__init__.py +22 -0
- ai_edge_litert/aot/vendors/example/__init__.py +0 -0
- ai_edge_litert/aot/vendors/example/example_backend.py +157 -0
- ai_edge_litert/aot/vendors/fallback_backend.py +128 -0
- ai_edge_litert/aot/vendors/google_tensor/__init__.py +0 -0
- ai_edge_litert/aot/vendors/google_tensor/google_tensor_backend.py +168 -0
- ai_edge_litert/aot/vendors/google_tensor/target.py +84 -0
- ai_edge_litert/aot/vendors/import_vendor.py +132 -0
- ai_edge_litert/aot/vendors/mediatek/__init__.py +0 -0
- ai_edge_litert/aot/vendors/mediatek/mediatek_backend.py +196 -0
- ai_edge_litert/aot/vendors/mediatek/target.py +94 -0
- ai_edge_litert/aot/vendors/qualcomm/__init__.py +0 -0
- ai_edge_litert/aot/vendors/qualcomm/qualcomm_backend.py +161 -0
- ai_edge_litert/aot/vendors/qualcomm/target.py +75 -0
- ai_edge_litert/api_pb2.py +43 -0
- ai_edge_litert/compiled_model.py +250 -0
- ai_edge_litert/descriptor_pb2.py +3361 -0
- ai_edge_litert/duration_pb2.py +37 -0
- ai_edge_litert/empty_pb2.py +37 -0
- ai_edge_litert/field_mask_pb2.py +37 -0
- ai_edge_litert/format_converter_wrapper_pybind11.so +0 -0
- ai_edge_litert/hardware_accelerator.py +22 -0
- ai_edge_litert/internal/__init__.py +0 -0
- ai_edge_litert/internal/litertlm_builder.py +584 -0
- ai_edge_litert/internal/litertlm_core.py +58 -0
- ai_edge_litert/internal/litertlm_header_schema_py_generated.py +1596 -0
- ai_edge_litert/internal/llm_metadata_pb2.py +45 -0
- ai_edge_litert/internal/llm_model_type_pb2.py +51 -0
- ai_edge_litert/internal/sampler_params_pb2.py +39 -0
- ai_edge_litert/internal/token_pb2.py +38 -0
- ai_edge_litert/interpreter.py +1039 -0
- ai_edge_litert/libLiteRt.so +0 -0
- ai_edge_litert/libpywrap_litert_common.so +0 -0
- ai_edge_litert/metrics_interface.py +48 -0
- ai_edge_litert/metrics_portable.py +70 -0
- ai_edge_litert/model_runtime_info_pb2.py +66 -0
- ai_edge_litert/plugin_pb2.py +46 -0
- ai_edge_litert/profiling_info_pb2.py +47 -0
- ai_edge_litert/pywrap_genai_ops.so +0 -0
- ai_edge_litert/schema_py_generated.py +19640 -0
- ai_edge_litert/source_context_pb2.py +37 -0
- ai_edge_litert/struct_pb2.py +47 -0
- ai_edge_litert/tensor_buffer.py +167 -0
- ai_edge_litert/timestamp_pb2.py +37 -0
- ai_edge_litert/tools/__init__.py +0 -0
- ai_edge_litert/tools/apply_plugin_main +0 -0
- ai_edge_litert/tools/flatbuffer_utils.py +534 -0
- ai_edge_litert/type_pb2.py +53 -0
- ai_edge_litert/vendors/google_tensor/compiler/libLiteRtCompilerPlugin_google_tensor.so +0 -0
- ai_edge_litert/vendors/mediatek/compiler/libLiteRtCompilerPlugin_MediaTek.so +0 -0
- ai_edge_litert/vendors/qualcomm/compiler/libLiteRtCompilerPlugin_Qualcomm.so +0 -0
- ai_edge_litert/wrappers_pb2.py +53 -0
- ai_edge_litert_nightly-2.2.0.dev20260102.dist-info/METADATA +52 -0
- ai_edge_litert_nightly-2.2.0.dev20260102.dist-info/RECORD +78 -0
- ai_edge_litert_nightly-2.2.0.dev20260102.dist-info/WHEEL +5 -0
- ai_edge_litert_nightly-2.2.0.dev20260102.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,1596 @@
|
|
|
1
|
+
import flatbuffers
|
|
2
|
+
|
|
3
|
+
# automatically generated by the FlatBuffers compiler, do not modify
|
|
4
|
+
|
|
5
|
+
# namespace: schema
|
|
6
|
+
|
|
7
|
+
from flatbuffers.compat import import_numpy
|
|
8
|
+
np = import_numpy()
|
|
9
|
+
|
|
10
|
+
class VData(object):
|
|
11
|
+
NONE = 0
|
|
12
|
+
UInt8 = 1
|
|
13
|
+
Int8 = 2
|
|
14
|
+
UInt16 = 3
|
|
15
|
+
Int16 = 4
|
|
16
|
+
UInt32 = 5
|
|
17
|
+
Int32 = 6
|
|
18
|
+
Float32 = 7
|
|
19
|
+
Bool = 8
|
|
20
|
+
StringValue = 9
|
|
21
|
+
UInt64 = 10
|
|
22
|
+
Int64 = 11
|
|
23
|
+
Double = 12
|
|
24
|
+
|
|
25
|
+
def VdataCreator(unionType, table):
|
|
26
|
+
from flatbuffers.table import Table
|
|
27
|
+
if not isinstance(table, Table):
|
|
28
|
+
return None
|
|
29
|
+
if unionType == VData.UInt8:
|
|
30
|
+
return UInt8T.InitFromBuf(table.Bytes, table.Pos)
|
|
31
|
+
if unionType == VData.Int8:
|
|
32
|
+
return Int8T.InitFromBuf(table.Bytes, table.Pos)
|
|
33
|
+
if unionType == VData.UInt16:
|
|
34
|
+
return UInt16T.InitFromBuf(table.Bytes, table.Pos)
|
|
35
|
+
if unionType == VData.Int16:
|
|
36
|
+
return Int16T.InitFromBuf(table.Bytes, table.Pos)
|
|
37
|
+
if unionType == VData.UInt32:
|
|
38
|
+
return UInt32T.InitFromBuf(table.Bytes, table.Pos)
|
|
39
|
+
if unionType == VData.Int32:
|
|
40
|
+
return Int32T.InitFromBuf(table.Bytes, table.Pos)
|
|
41
|
+
if unionType == VData.Float32:
|
|
42
|
+
return Float32T.InitFromBuf(table.Bytes, table.Pos)
|
|
43
|
+
if unionType == VData.Bool:
|
|
44
|
+
return BoolT.InitFromBuf(table.Bytes, table.Pos)
|
|
45
|
+
if unionType == VData.StringValue:
|
|
46
|
+
return StringValueT.InitFromBuf(table.Bytes, table.Pos)
|
|
47
|
+
if unionType == VData.UInt64:
|
|
48
|
+
return UInt64T.InitFromBuf(table.Bytes, table.Pos)
|
|
49
|
+
if unionType == VData.Int64:
|
|
50
|
+
return Int64T.InitFromBuf(table.Bytes, table.Pos)
|
|
51
|
+
if unionType == VData.Double:
|
|
52
|
+
return DoubleT.InitFromBuf(table.Bytes, table.Pos)
|
|
53
|
+
return None
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
class AnySectionDataType(object):
|
|
57
|
+
NONE = 0
|
|
58
|
+
GenericBinaryData = 1
|
|
59
|
+
Deprecated = 2
|
|
60
|
+
TFLiteModel = 3
|
|
61
|
+
SP_Tokenizer = 4
|
|
62
|
+
LlmMetadataProto = 5
|
|
63
|
+
HF_Tokenizer_Zlib = 6
|
|
64
|
+
TFLiteWeights = 7
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
class UInt8(object):
|
|
68
|
+
__slots__ = ['_tab']
|
|
69
|
+
|
|
70
|
+
@classmethod
|
|
71
|
+
def GetRootAs(cls, buf, offset=0):
|
|
72
|
+
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
|
73
|
+
x = UInt8()
|
|
74
|
+
x.Init(buf, n + offset)
|
|
75
|
+
return x
|
|
76
|
+
|
|
77
|
+
@classmethod
|
|
78
|
+
def GetRootAsUInt8(cls, buf, offset=0):
|
|
79
|
+
"""This method is deprecated. Please switch to GetRootAs."""
|
|
80
|
+
return cls.GetRootAs(buf, offset)
|
|
81
|
+
# UInt8
|
|
82
|
+
def Init(self, buf, pos):
|
|
83
|
+
self._tab = flatbuffers.table.Table(buf, pos)
|
|
84
|
+
|
|
85
|
+
# UInt8
|
|
86
|
+
def Value(self):
|
|
87
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
|
88
|
+
if o != 0:
|
|
89
|
+
return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
|
|
90
|
+
return 0
|
|
91
|
+
|
|
92
|
+
def UInt8Start(builder):
|
|
93
|
+
builder.StartObject(1)
|
|
94
|
+
|
|
95
|
+
def UInt8AddValue(builder, value):
|
|
96
|
+
builder.PrependUint8Slot(0, value, 0)
|
|
97
|
+
|
|
98
|
+
def UInt8End(builder):
|
|
99
|
+
return builder.EndObject()
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
class UInt8T(object):
|
|
104
|
+
|
|
105
|
+
# UInt8T
|
|
106
|
+
def __init__(
|
|
107
|
+
self,
|
|
108
|
+
value = 0,
|
|
109
|
+
):
|
|
110
|
+
self.value = value # type: int
|
|
111
|
+
|
|
112
|
+
@classmethod
|
|
113
|
+
def InitFromBuf(cls, buf, pos):
|
|
114
|
+
uint8 = UInt8()
|
|
115
|
+
uint8.Init(buf, pos)
|
|
116
|
+
return cls.InitFromObj(uint8)
|
|
117
|
+
|
|
118
|
+
@classmethod
|
|
119
|
+
def InitFromPackedBuf(cls, buf, pos=0):
|
|
120
|
+
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)
|
|
121
|
+
return cls.InitFromBuf(buf, pos+n)
|
|
122
|
+
|
|
123
|
+
@classmethod
|
|
124
|
+
def InitFromObj(cls, uint8):
|
|
125
|
+
x = UInt8T()
|
|
126
|
+
x._UnPack(uint8)
|
|
127
|
+
return x
|
|
128
|
+
|
|
129
|
+
# UInt8T
|
|
130
|
+
def _UnPack(self, uint8):
|
|
131
|
+
if uint8 is None:
|
|
132
|
+
return
|
|
133
|
+
self.value = uint8.Value()
|
|
134
|
+
|
|
135
|
+
# UInt8T
|
|
136
|
+
def Pack(self, builder):
|
|
137
|
+
UInt8Start(builder)
|
|
138
|
+
UInt8AddValue(builder, self.value)
|
|
139
|
+
uint8 = UInt8End(builder)
|
|
140
|
+
return uint8
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
class Int8(object):
|
|
144
|
+
__slots__ = ['_tab']
|
|
145
|
+
|
|
146
|
+
@classmethod
|
|
147
|
+
def GetRootAs(cls, buf, offset=0):
|
|
148
|
+
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
|
149
|
+
x = Int8()
|
|
150
|
+
x.Init(buf, n + offset)
|
|
151
|
+
return x
|
|
152
|
+
|
|
153
|
+
@classmethod
|
|
154
|
+
def GetRootAsInt8(cls, buf, offset=0):
|
|
155
|
+
"""This method is deprecated. Please switch to GetRootAs."""
|
|
156
|
+
return cls.GetRootAs(buf, offset)
|
|
157
|
+
# Int8
|
|
158
|
+
def Init(self, buf, pos):
|
|
159
|
+
self._tab = flatbuffers.table.Table(buf, pos)
|
|
160
|
+
|
|
161
|
+
# Int8
|
|
162
|
+
def Value(self):
|
|
163
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
|
164
|
+
if o != 0:
|
|
165
|
+
return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
|
|
166
|
+
return 0
|
|
167
|
+
|
|
168
|
+
def Int8Start(builder):
|
|
169
|
+
builder.StartObject(1)
|
|
170
|
+
|
|
171
|
+
def Int8AddValue(builder, value):
|
|
172
|
+
builder.PrependInt8Slot(0, value, 0)
|
|
173
|
+
|
|
174
|
+
def Int8End(builder):
|
|
175
|
+
return builder.EndObject()
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
class Int8T(object):
|
|
180
|
+
|
|
181
|
+
# Int8T
|
|
182
|
+
def __init__(
|
|
183
|
+
self,
|
|
184
|
+
value = 0,
|
|
185
|
+
):
|
|
186
|
+
self.value = value # type: int
|
|
187
|
+
|
|
188
|
+
@classmethod
|
|
189
|
+
def InitFromBuf(cls, buf, pos):
|
|
190
|
+
int8 = Int8()
|
|
191
|
+
int8.Init(buf, pos)
|
|
192
|
+
return cls.InitFromObj(int8)
|
|
193
|
+
|
|
194
|
+
@classmethod
|
|
195
|
+
def InitFromPackedBuf(cls, buf, pos=0):
|
|
196
|
+
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)
|
|
197
|
+
return cls.InitFromBuf(buf, pos+n)
|
|
198
|
+
|
|
199
|
+
@classmethod
|
|
200
|
+
def InitFromObj(cls, int8):
|
|
201
|
+
x = Int8T()
|
|
202
|
+
x._UnPack(int8)
|
|
203
|
+
return x
|
|
204
|
+
|
|
205
|
+
# Int8T
|
|
206
|
+
def _UnPack(self, int8):
|
|
207
|
+
if int8 is None:
|
|
208
|
+
return
|
|
209
|
+
self.value = int8.Value()
|
|
210
|
+
|
|
211
|
+
# Int8T
|
|
212
|
+
def Pack(self, builder):
|
|
213
|
+
Int8Start(builder)
|
|
214
|
+
Int8AddValue(builder, self.value)
|
|
215
|
+
int8 = Int8End(builder)
|
|
216
|
+
return int8
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
class UInt16(object):
|
|
220
|
+
__slots__ = ['_tab']
|
|
221
|
+
|
|
222
|
+
@classmethod
|
|
223
|
+
def GetRootAs(cls, buf, offset=0):
|
|
224
|
+
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
|
225
|
+
x = UInt16()
|
|
226
|
+
x.Init(buf, n + offset)
|
|
227
|
+
return x
|
|
228
|
+
|
|
229
|
+
@classmethod
|
|
230
|
+
def GetRootAsUInt16(cls, buf, offset=0):
|
|
231
|
+
"""This method is deprecated. Please switch to GetRootAs."""
|
|
232
|
+
return cls.GetRootAs(buf, offset)
|
|
233
|
+
# UInt16
|
|
234
|
+
def Init(self, buf, pos):
|
|
235
|
+
self._tab = flatbuffers.table.Table(buf, pos)
|
|
236
|
+
|
|
237
|
+
# UInt16
|
|
238
|
+
def Value(self):
|
|
239
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
|
240
|
+
if o != 0:
|
|
241
|
+
return self._tab.Get(flatbuffers.number_types.Uint16Flags, o + self._tab.Pos)
|
|
242
|
+
return 0
|
|
243
|
+
|
|
244
|
+
def UInt16Start(builder):
|
|
245
|
+
builder.StartObject(1)
|
|
246
|
+
|
|
247
|
+
def UInt16AddValue(builder, value):
|
|
248
|
+
builder.PrependUint16Slot(0, value, 0)
|
|
249
|
+
|
|
250
|
+
def UInt16End(builder):
|
|
251
|
+
return builder.EndObject()
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
class UInt16T(object):
|
|
256
|
+
|
|
257
|
+
# UInt16T
|
|
258
|
+
def __init__(
|
|
259
|
+
self,
|
|
260
|
+
value = 0,
|
|
261
|
+
):
|
|
262
|
+
self.value = value # type: int
|
|
263
|
+
|
|
264
|
+
@classmethod
|
|
265
|
+
def InitFromBuf(cls, buf, pos):
|
|
266
|
+
uint16 = UInt16()
|
|
267
|
+
uint16.Init(buf, pos)
|
|
268
|
+
return cls.InitFromObj(uint16)
|
|
269
|
+
|
|
270
|
+
@classmethod
|
|
271
|
+
def InitFromPackedBuf(cls, buf, pos=0):
|
|
272
|
+
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)
|
|
273
|
+
return cls.InitFromBuf(buf, pos+n)
|
|
274
|
+
|
|
275
|
+
@classmethod
|
|
276
|
+
def InitFromObj(cls, uint16):
|
|
277
|
+
x = UInt16T()
|
|
278
|
+
x._UnPack(uint16)
|
|
279
|
+
return x
|
|
280
|
+
|
|
281
|
+
# UInt16T
|
|
282
|
+
def _UnPack(self, uint16):
|
|
283
|
+
if uint16 is None:
|
|
284
|
+
return
|
|
285
|
+
self.value = uint16.Value()
|
|
286
|
+
|
|
287
|
+
# UInt16T
|
|
288
|
+
def Pack(self, builder):
|
|
289
|
+
UInt16Start(builder)
|
|
290
|
+
UInt16AddValue(builder, self.value)
|
|
291
|
+
uint16 = UInt16End(builder)
|
|
292
|
+
return uint16
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
class Int16(object):
|
|
296
|
+
__slots__ = ['_tab']
|
|
297
|
+
|
|
298
|
+
@classmethod
|
|
299
|
+
def GetRootAs(cls, buf, offset=0):
|
|
300
|
+
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
|
301
|
+
x = Int16()
|
|
302
|
+
x.Init(buf, n + offset)
|
|
303
|
+
return x
|
|
304
|
+
|
|
305
|
+
@classmethod
|
|
306
|
+
def GetRootAsInt16(cls, buf, offset=0):
|
|
307
|
+
"""This method is deprecated. Please switch to GetRootAs."""
|
|
308
|
+
return cls.GetRootAs(buf, offset)
|
|
309
|
+
# Int16
|
|
310
|
+
def Init(self, buf, pos):
|
|
311
|
+
self._tab = flatbuffers.table.Table(buf, pos)
|
|
312
|
+
|
|
313
|
+
# Int16
|
|
314
|
+
def Value(self):
|
|
315
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
|
316
|
+
if o != 0:
|
|
317
|
+
return self._tab.Get(flatbuffers.number_types.Int16Flags, o + self._tab.Pos)
|
|
318
|
+
return 0
|
|
319
|
+
|
|
320
|
+
def Int16Start(builder):
|
|
321
|
+
builder.StartObject(1)
|
|
322
|
+
|
|
323
|
+
def Int16AddValue(builder, value):
|
|
324
|
+
builder.PrependInt16Slot(0, value, 0)
|
|
325
|
+
|
|
326
|
+
def Int16End(builder):
|
|
327
|
+
return builder.EndObject()
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
class Int16T(object):
|
|
332
|
+
|
|
333
|
+
# Int16T
|
|
334
|
+
def __init__(
|
|
335
|
+
self,
|
|
336
|
+
value = 0,
|
|
337
|
+
):
|
|
338
|
+
self.value = value # type: int
|
|
339
|
+
|
|
340
|
+
@classmethod
|
|
341
|
+
def InitFromBuf(cls, buf, pos):
|
|
342
|
+
int16 = Int16()
|
|
343
|
+
int16.Init(buf, pos)
|
|
344
|
+
return cls.InitFromObj(int16)
|
|
345
|
+
|
|
346
|
+
@classmethod
|
|
347
|
+
def InitFromPackedBuf(cls, buf, pos=0):
|
|
348
|
+
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)
|
|
349
|
+
return cls.InitFromBuf(buf, pos+n)
|
|
350
|
+
|
|
351
|
+
@classmethod
|
|
352
|
+
def InitFromObj(cls, int16):
|
|
353
|
+
x = Int16T()
|
|
354
|
+
x._UnPack(int16)
|
|
355
|
+
return x
|
|
356
|
+
|
|
357
|
+
# Int16T
|
|
358
|
+
def _UnPack(self, int16):
|
|
359
|
+
if int16 is None:
|
|
360
|
+
return
|
|
361
|
+
self.value = int16.Value()
|
|
362
|
+
|
|
363
|
+
# Int16T
|
|
364
|
+
def Pack(self, builder):
|
|
365
|
+
Int16Start(builder)
|
|
366
|
+
Int16AddValue(builder, self.value)
|
|
367
|
+
int16 = Int16End(builder)
|
|
368
|
+
return int16
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
class UInt32(object):
|
|
372
|
+
__slots__ = ['_tab']
|
|
373
|
+
|
|
374
|
+
@classmethod
|
|
375
|
+
def GetRootAs(cls, buf, offset=0):
|
|
376
|
+
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
|
377
|
+
x = UInt32()
|
|
378
|
+
x.Init(buf, n + offset)
|
|
379
|
+
return x
|
|
380
|
+
|
|
381
|
+
@classmethod
|
|
382
|
+
def GetRootAsUInt32(cls, buf, offset=0):
|
|
383
|
+
"""This method is deprecated. Please switch to GetRootAs."""
|
|
384
|
+
return cls.GetRootAs(buf, offset)
|
|
385
|
+
# UInt32
|
|
386
|
+
def Init(self, buf, pos):
|
|
387
|
+
self._tab = flatbuffers.table.Table(buf, pos)
|
|
388
|
+
|
|
389
|
+
# UInt32
|
|
390
|
+
def Value(self):
|
|
391
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
|
392
|
+
if o != 0:
|
|
393
|
+
return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos)
|
|
394
|
+
return 0
|
|
395
|
+
|
|
396
|
+
def UInt32Start(builder):
|
|
397
|
+
builder.StartObject(1)
|
|
398
|
+
|
|
399
|
+
def UInt32AddValue(builder, value):
|
|
400
|
+
builder.PrependUint32Slot(0, value, 0)
|
|
401
|
+
|
|
402
|
+
def UInt32End(builder):
|
|
403
|
+
return builder.EndObject()
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
class UInt32T(object):
|
|
408
|
+
|
|
409
|
+
# UInt32T
|
|
410
|
+
def __init__(
|
|
411
|
+
self,
|
|
412
|
+
value = 0,
|
|
413
|
+
):
|
|
414
|
+
self.value = value # type: int
|
|
415
|
+
|
|
416
|
+
@classmethod
|
|
417
|
+
def InitFromBuf(cls, buf, pos):
|
|
418
|
+
uint32 = UInt32()
|
|
419
|
+
uint32.Init(buf, pos)
|
|
420
|
+
return cls.InitFromObj(uint32)
|
|
421
|
+
|
|
422
|
+
@classmethod
|
|
423
|
+
def InitFromPackedBuf(cls, buf, pos=0):
|
|
424
|
+
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)
|
|
425
|
+
return cls.InitFromBuf(buf, pos+n)
|
|
426
|
+
|
|
427
|
+
@classmethod
|
|
428
|
+
def InitFromObj(cls, uint32):
|
|
429
|
+
x = UInt32T()
|
|
430
|
+
x._UnPack(uint32)
|
|
431
|
+
return x
|
|
432
|
+
|
|
433
|
+
# UInt32T
|
|
434
|
+
def _UnPack(self, uint32):
|
|
435
|
+
if uint32 is None:
|
|
436
|
+
return
|
|
437
|
+
self.value = uint32.Value()
|
|
438
|
+
|
|
439
|
+
# UInt32T
|
|
440
|
+
def Pack(self, builder):
|
|
441
|
+
UInt32Start(builder)
|
|
442
|
+
UInt32AddValue(builder, self.value)
|
|
443
|
+
uint32 = UInt32End(builder)
|
|
444
|
+
return uint32
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
class Int32(object):
|
|
448
|
+
__slots__ = ['_tab']
|
|
449
|
+
|
|
450
|
+
@classmethod
|
|
451
|
+
def GetRootAs(cls, buf, offset=0):
|
|
452
|
+
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
|
453
|
+
x = Int32()
|
|
454
|
+
x.Init(buf, n + offset)
|
|
455
|
+
return x
|
|
456
|
+
|
|
457
|
+
@classmethod
|
|
458
|
+
def GetRootAsInt32(cls, buf, offset=0):
|
|
459
|
+
"""This method is deprecated. Please switch to GetRootAs."""
|
|
460
|
+
return cls.GetRootAs(buf, offset)
|
|
461
|
+
# Int32
|
|
462
|
+
def Init(self, buf, pos):
|
|
463
|
+
self._tab = flatbuffers.table.Table(buf, pos)
|
|
464
|
+
|
|
465
|
+
# Int32
|
|
466
|
+
def Value(self):
|
|
467
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
|
468
|
+
if o != 0:
|
|
469
|
+
return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
|
|
470
|
+
return 0
|
|
471
|
+
|
|
472
|
+
def Int32Start(builder):
|
|
473
|
+
builder.StartObject(1)
|
|
474
|
+
|
|
475
|
+
def Int32AddValue(builder, value):
|
|
476
|
+
builder.PrependInt32Slot(0, value, 0)
|
|
477
|
+
|
|
478
|
+
def Int32End(builder):
|
|
479
|
+
return builder.EndObject()
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+
class Int32T(object):
|
|
484
|
+
|
|
485
|
+
# Int32T
|
|
486
|
+
def __init__(
|
|
487
|
+
self,
|
|
488
|
+
value = 0,
|
|
489
|
+
):
|
|
490
|
+
self.value = value # type: int
|
|
491
|
+
|
|
492
|
+
@classmethod
|
|
493
|
+
def InitFromBuf(cls, buf, pos):
|
|
494
|
+
int32 = Int32()
|
|
495
|
+
int32.Init(buf, pos)
|
|
496
|
+
return cls.InitFromObj(int32)
|
|
497
|
+
|
|
498
|
+
@classmethod
|
|
499
|
+
def InitFromPackedBuf(cls, buf, pos=0):
|
|
500
|
+
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)
|
|
501
|
+
return cls.InitFromBuf(buf, pos+n)
|
|
502
|
+
|
|
503
|
+
@classmethod
|
|
504
|
+
def InitFromObj(cls, int32):
|
|
505
|
+
x = Int32T()
|
|
506
|
+
x._UnPack(int32)
|
|
507
|
+
return x
|
|
508
|
+
|
|
509
|
+
# Int32T
|
|
510
|
+
def _UnPack(self, int32):
|
|
511
|
+
if int32 is None:
|
|
512
|
+
return
|
|
513
|
+
self.value = int32.Value()
|
|
514
|
+
|
|
515
|
+
# Int32T
|
|
516
|
+
def Pack(self, builder):
|
|
517
|
+
Int32Start(builder)
|
|
518
|
+
Int32AddValue(builder, self.value)
|
|
519
|
+
int32 = Int32End(builder)
|
|
520
|
+
return int32
|
|
521
|
+
|
|
522
|
+
|
|
523
|
+
class Float32(object):
|
|
524
|
+
__slots__ = ['_tab']
|
|
525
|
+
|
|
526
|
+
@classmethod
|
|
527
|
+
def GetRootAs(cls, buf, offset=0):
|
|
528
|
+
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
|
529
|
+
x = Float32()
|
|
530
|
+
x.Init(buf, n + offset)
|
|
531
|
+
return x
|
|
532
|
+
|
|
533
|
+
@classmethod
|
|
534
|
+
def GetRootAsFloat32(cls, buf, offset=0):
|
|
535
|
+
"""This method is deprecated. Please switch to GetRootAs."""
|
|
536
|
+
return cls.GetRootAs(buf, offset)
|
|
537
|
+
# Float32
|
|
538
|
+
def Init(self, buf, pos):
|
|
539
|
+
self._tab = flatbuffers.table.Table(buf, pos)
|
|
540
|
+
|
|
541
|
+
# Float32
|
|
542
|
+
def Value(self):
|
|
543
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
|
544
|
+
if o != 0:
|
|
545
|
+
return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos)
|
|
546
|
+
return 0.0
|
|
547
|
+
|
|
548
|
+
def Float32Start(builder):
|
|
549
|
+
builder.StartObject(1)
|
|
550
|
+
|
|
551
|
+
def Float32AddValue(builder, value):
|
|
552
|
+
builder.PrependFloat32Slot(0, value, 0.0)
|
|
553
|
+
|
|
554
|
+
def Float32End(builder):
|
|
555
|
+
return builder.EndObject()
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+
|
|
559
|
+
class Float32T(object):
|
|
560
|
+
|
|
561
|
+
# Float32T
|
|
562
|
+
def __init__(
|
|
563
|
+
self,
|
|
564
|
+
value = 0.0,
|
|
565
|
+
):
|
|
566
|
+
self.value = value # type: float
|
|
567
|
+
|
|
568
|
+
@classmethod
|
|
569
|
+
def InitFromBuf(cls, buf, pos):
|
|
570
|
+
float32 = Float32()
|
|
571
|
+
float32.Init(buf, pos)
|
|
572
|
+
return cls.InitFromObj(float32)
|
|
573
|
+
|
|
574
|
+
@classmethod
|
|
575
|
+
def InitFromPackedBuf(cls, buf, pos=0):
|
|
576
|
+
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)
|
|
577
|
+
return cls.InitFromBuf(buf, pos+n)
|
|
578
|
+
|
|
579
|
+
@classmethod
|
|
580
|
+
def InitFromObj(cls, float32):
|
|
581
|
+
x = Float32T()
|
|
582
|
+
x._UnPack(float32)
|
|
583
|
+
return x
|
|
584
|
+
|
|
585
|
+
# Float32T
|
|
586
|
+
def _UnPack(self, float32):
|
|
587
|
+
if float32 is None:
|
|
588
|
+
return
|
|
589
|
+
self.value = float32.Value()
|
|
590
|
+
|
|
591
|
+
# Float32T
|
|
592
|
+
def Pack(self, builder):
|
|
593
|
+
Float32Start(builder)
|
|
594
|
+
Float32AddValue(builder, self.value)
|
|
595
|
+
float32 = Float32End(builder)
|
|
596
|
+
return float32
|
|
597
|
+
|
|
598
|
+
|
|
599
|
+
class Bool(object):
|
|
600
|
+
__slots__ = ['_tab']
|
|
601
|
+
|
|
602
|
+
@classmethod
|
|
603
|
+
def GetRootAs(cls, buf, offset=0):
|
|
604
|
+
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
|
605
|
+
x = Bool()
|
|
606
|
+
x.Init(buf, n + offset)
|
|
607
|
+
return x
|
|
608
|
+
|
|
609
|
+
@classmethod
|
|
610
|
+
def GetRootAsBool(cls, buf, offset=0):
|
|
611
|
+
"""This method is deprecated. Please switch to GetRootAs."""
|
|
612
|
+
return cls.GetRootAs(buf, offset)
|
|
613
|
+
# Bool
|
|
614
|
+
def Init(self, buf, pos):
|
|
615
|
+
self._tab = flatbuffers.table.Table(buf, pos)
|
|
616
|
+
|
|
617
|
+
# Bool
|
|
618
|
+
def Value(self):
|
|
619
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
|
620
|
+
if o != 0:
|
|
621
|
+
return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
|
|
622
|
+
return False
|
|
623
|
+
|
|
624
|
+
def BoolStart(builder):
|
|
625
|
+
builder.StartObject(1)
|
|
626
|
+
|
|
627
|
+
def BoolAddValue(builder, value):
|
|
628
|
+
builder.PrependBoolSlot(0, value, 0)
|
|
629
|
+
|
|
630
|
+
def BoolEnd(builder):
|
|
631
|
+
return builder.EndObject()
|
|
632
|
+
|
|
633
|
+
|
|
634
|
+
|
|
635
|
+
class BoolT(object):
|
|
636
|
+
|
|
637
|
+
# BoolT
|
|
638
|
+
def __init__(
|
|
639
|
+
self,
|
|
640
|
+
value = False,
|
|
641
|
+
):
|
|
642
|
+
self.value = value # type: bool
|
|
643
|
+
|
|
644
|
+
@classmethod
|
|
645
|
+
def InitFromBuf(cls, buf, pos):
|
|
646
|
+
bool = Bool()
|
|
647
|
+
bool.Init(buf, pos)
|
|
648
|
+
return cls.InitFromObj(bool)
|
|
649
|
+
|
|
650
|
+
@classmethod
|
|
651
|
+
def InitFromPackedBuf(cls, buf, pos=0):
|
|
652
|
+
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)
|
|
653
|
+
return cls.InitFromBuf(buf, pos+n)
|
|
654
|
+
|
|
655
|
+
@classmethod
|
|
656
|
+
def InitFromObj(cls, bool):
|
|
657
|
+
x = BoolT()
|
|
658
|
+
x._UnPack(bool)
|
|
659
|
+
return x
|
|
660
|
+
|
|
661
|
+
# BoolT
|
|
662
|
+
def _UnPack(self, bool):
|
|
663
|
+
if bool is None:
|
|
664
|
+
return
|
|
665
|
+
self.value = bool.Value()
|
|
666
|
+
|
|
667
|
+
# BoolT
|
|
668
|
+
def Pack(self, builder):
|
|
669
|
+
BoolStart(builder)
|
|
670
|
+
BoolAddValue(builder, self.value)
|
|
671
|
+
bool = BoolEnd(builder)
|
|
672
|
+
return bool
|
|
673
|
+
|
|
674
|
+
|
|
675
|
+
class UInt64(object):
|
|
676
|
+
__slots__ = ['_tab']
|
|
677
|
+
|
|
678
|
+
@classmethod
|
|
679
|
+
def GetRootAs(cls, buf, offset=0):
|
|
680
|
+
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
|
681
|
+
x = UInt64()
|
|
682
|
+
x.Init(buf, n + offset)
|
|
683
|
+
return x
|
|
684
|
+
|
|
685
|
+
@classmethod
|
|
686
|
+
def GetRootAsUInt64(cls, buf, offset=0):
|
|
687
|
+
"""This method is deprecated. Please switch to GetRootAs."""
|
|
688
|
+
return cls.GetRootAs(buf, offset)
|
|
689
|
+
# UInt64
|
|
690
|
+
def Init(self, buf, pos):
|
|
691
|
+
self._tab = flatbuffers.table.Table(buf, pos)
|
|
692
|
+
|
|
693
|
+
# UInt64
|
|
694
|
+
def Value(self):
|
|
695
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
|
696
|
+
if o != 0:
|
|
697
|
+
return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
|
|
698
|
+
return 0
|
|
699
|
+
|
|
700
|
+
def UInt64Start(builder):
|
|
701
|
+
builder.StartObject(1)
|
|
702
|
+
|
|
703
|
+
def UInt64AddValue(builder, value):
|
|
704
|
+
builder.PrependUint64Slot(0, value, 0)
|
|
705
|
+
|
|
706
|
+
def UInt64End(builder):
|
|
707
|
+
return builder.EndObject()
|
|
708
|
+
|
|
709
|
+
|
|
710
|
+
|
|
711
|
+
class UInt64T(object):
|
|
712
|
+
|
|
713
|
+
# UInt64T
|
|
714
|
+
def __init__(
|
|
715
|
+
self,
|
|
716
|
+
value = 0,
|
|
717
|
+
):
|
|
718
|
+
self.value = value # type: int
|
|
719
|
+
|
|
720
|
+
@classmethod
|
|
721
|
+
def InitFromBuf(cls, buf, pos):
|
|
722
|
+
uint64 = UInt64()
|
|
723
|
+
uint64.Init(buf, pos)
|
|
724
|
+
return cls.InitFromObj(uint64)
|
|
725
|
+
|
|
726
|
+
@classmethod
|
|
727
|
+
def InitFromPackedBuf(cls, buf, pos=0):
|
|
728
|
+
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)
|
|
729
|
+
return cls.InitFromBuf(buf, pos+n)
|
|
730
|
+
|
|
731
|
+
@classmethod
|
|
732
|
+
def InitFromObj(cls, uint64):
|
|
733
|
+
x = UInt64T()
|
|
734
|
+
x._UnPack(uint64)
|
|
735
|
+
return x
|
|
736
|
+
|
|
737
|
+
# UInt64T
|
|
738
|
+
def _UnPack(self, uint64):
|
|
739
|
+
if uint64 is None:
|
|
740
|
+
return
|
|
741
|
+
self.value = uint64.Value()
|
|
742
|
+
|
|
743
|
+
# UInt64T
|
|
744
|
+
def Pack(self, builder):
|
|
745
|
+
UInt64Start(builder)
|
|
746
|
+
UInt64AddValue(builder, self.value)
|
|
747
|
+
uint64 = UInt64End(builder)
|
|
748
|
+
return uint64
|
|
749
|
+
|
|
750
|
+
|
|
751
|
+
class Int64(object):
|
|
752
|
+
__slots__ = ['_tab']
|
|
753
|
+
|
|
754
|
+
@classmethod
|
|
755
|
+
def GetRootAs(cls, buf, offset=0):
|
|
756
|
+
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
|
757
|
+
x = Int64()
|
|
758
|
+
x.Init(buf, n + offset)
|
|
759
|
+
return x
|
|
760
|
+
|
|
761
|
+
@classmethod
|
|
762
|
+
def GetRootAsInt64(cls, buf, offset=0):
|
|
763
|
+
"""This method is deprecated. Please switch to GetRootAs."""
|
|
764
|
+
return cls.GetRootAs(buf, offset)
|
|
765
|
+
# Int64
|
|
766
|
+
def Init(self, buf, pos):
|
|
767
|
+
self._tab = flatbuffers.table.Table(buf, pos)
|
|
768
|
+
|
|
769
|
+
# Int64
|
|
770
|
+
def Value(self):
|
|
771
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
|
772
|
+
if o != 0:
|
|
773
|
+
return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
|
|
774
|
+
return 0
|
|
775
|
+
|
|
776
|
+
def Int64Start(builder):
|
|
777
|
+
builder.StartObject(1)
|
|
778
|
+
|
|
779
|
+
def Int64AddValue(builder, value):
|
|
780
|
+
builder.PrependInt64Slot(0, value, 0)
|
|
781
|
+
|
|
782
|
+
def Int64End(builder):
|
|
783
|
+
return builder.EndObject()
|
|
784
|
+
|
|
785
|
+
|
|
786
|
+
|
|
787
|
+
class Int64T(object):
|
|
788
|
+
|
|
789
|
+
# Int64T
|
|
790
|
+
def __init__(
|
|
791
|
+
self,
|
|
792
|
+
value = 0,
|
|
793
|
+
):
|
|
794
|
+
self.value = value # type: int
|
|
795
|
+
|
|
796
|
+
@classmethod
|
|
797
|
+
def InitFromBuf(cls, buf, pos):
|
|
798
|
+
int64 = Int64()
|
|
799
|
+
int64.Init(buf, pos)
|
|
800
|
+
return cls.InitFromObj(int64)
|
|
801
|
+
|
|
802
|
+
@classmethod
|
|
803
|
+
def InitFromPackedBuf(cls, buf, pos=0):
|
|
804
|
+
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)
|
|
805
|
+
return cls.InitFromBuf(buf, pos+n)
|
|
806
|
+
|
|
807
|
+
@classmethod
|
|
808
|
+
def InitFromObj(cls, int64):
|
|
809
|
+
x = Int64T()
|
|
810
|
+
x._UnPack(int64)
|
|
811
|
+
return x
|
|
812
|
+
|
|
813
|
+
# Int64T
|
|
814
|
+
def _UnPack(self, int64):
|
|
815
|
+
if int64 is None:
|
|
816
|
+
return
|
|
817
|
+
self.value = int64.Value()
|
|
818
|
+
|
|
819
|
+
# Int64T
|
|
820
|
+
def Pack(self, builder):
|
|
821
|
+
Int64Start(builder)
|
|
822
|
+
Int64AddValue(builder, self.value)
|
|
823
|
+
int64 = Int64End(builder)
|
|
824
|
+
return int64
|
|
825
|
+
|
|
826
|
+
|
|
827
|
+
class Double(object):
|
|
828
|
+
__slots__ = ['_tab']
|
|
829
|
+
|
|
830
|
+
@classmethod
|
|
831
|
+
def GetRootAs(cls, buf, offset=0):
|
|
832
|
+
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
|
833
|
+
x = Double()
|
|
834
|
+
x.Init(buf, n + offset)
|
|
835
|
+
return x
|
|
836
|
+
|
|
837
|
+
@classmethod
|
|
838
|
+
def GetRootAsDouble(cls, buf, offset=0):
|
|
839
|
+
"""This method is deprecated. Please switch to GetRootAs."""
|
|
840
|
+
return cls.GetRootAs(buf, offset)
|
|
841
|
+
# Double
|
|
842
|
+
def Init(self, buf, pos):
|
|
843
|
+
self._tab = flatbuffers.table.Table(buf, pos)
|
|
844
|
+
|
|
845
|
+
# Double
|
|
846
|
+
def Value(self):
|
|
847
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
|
848
|
+
if o != 0:
|
|
849
|
+
return self._tab.Get(flatbuffers.number_types.Float64Flags, o + self._tab.Pos)
|
|
850
|
+
return 0.0
|
|
851
|
+
|
|
852
|
+
def DoubleStart(builder):
|
|
853
|
+
builder.StartObject(1)
|
|
854
|
+
|
|
855
|
+
def DoubleAddValue(builder, value):
|
|
856
|
+
builder.PrependFloat64Slot(0, value, 0.0)
|
|
857
|
+
|
|
858
|
+
def DoubleEnd(builder):
|
|
859
|
+
return builder.EndObject()
|
|
860
|
+
|
|
861
|
+
|
|
862
|
+
|
|
863
|
+
class DoubleT(object):
|
|
864
|
+
|
|
865
|
+
# DoubleT
|
|
866
|
+
def __init__(
|
|
867
|
+
self,
|
|
868
|
+
value = 0.0,
|
|
869
|
+
):
|
|
870
|
+
self.value = value # type: float
|
|
871
|
+
|
|
872
|
+
@classmethod
|
|
873
|
+
def InitFromBuf(cls, buf, pos):
|
|
874
|
+
double = Double()
|
|
875
|
+
double.Init(buf, pos)
|
|
876
|
+
return cls.InitFromObj(double)
|
|
877
|
+
|
|
878
|
+
@classmethod
|
|
879
|
+
def InitFromPackedBuf(cls, buf, pos=0):
|
|
880
|
+
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)
|
|
881
|
+
return cls.InitFromBuf(buf, pos+n)
|
|
882
|
+
|
|
883
|
+
@classmethod
|
|
884
|
+
def InitFromObj(cls, double):
|
|
885
|
+
x = DoubleT()
|
|
886
|
+
x._UnPack(double)
|
|
887
|
+
return x
|
|
888
|
+
|
|
889
|
+
# DoubleT
|
|
890
|
+
def _UnPack(self, double):
|
|
891
|
+
if double is None:
|
|
892
|
+
return
|
|
893
|
+
self.value = double.Value()
|
|
894
|
+
|
|
895
|
+
# DoubleT
|
|
896
|
+
def Pack(self, builder):
|
|
897
|
+
DoubleStart(builder)
|
|
898
|
+
DoubleAddValue(builder, self.value)
|
|
899
|
+
double = DoubleEnd(builder)
|
|
900
|
+
return double
|
|
901
|
+
|
|
902
|
+
|
|
903
|
+
class StringValue(object):
|
|
904
|
+
__slots__ = ['_tab']
|
|
905
|
+
|
|
906
|
+
@classmethod
|
|
907
|
+
def GetRootAs(cls, buf, offset=0):
|
|
908
|
+
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
|
909
|
+
x = StringValue()
|
|
910
|
+
x.Init(buf, n + offset)
|
|
911
|
+
return x
|
|
912
|
+
|
|
913
|
+
@classmethod
|
|
914
|
+
def GetRootAsStringValue(cls, buf, offset=0):
|
|
915
|
+
"""This method is deprecated. Please switch to GetRootAs."""
|
|
916
|
+
return cls.GetRootAs(buf, offset)
|
|
917
|
+
# StringValue
|
|
918
|
+
def Init(self, buf, pos):
|
|
919
|
+
self._tab = flatbuffers.table.Table(buf, pos)
|
|
920
|
+
|
|
921
|
+
# StringValue
|
|
922
|
+
def Value(self):
|
|
923
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
|
924
|
+
if o != 0:
|
|
925
|
+
return self._tab.String(o + self._tab.Pos)
|
|
926
|
+
return None
|
|
927
|
+
|
|
928
|
+
def StringValueStart(builder):
|
|
929
|
+
builder.StartObject(1)
|
|
930
|
+
|
|
931
|
+
def StringValueAddValue(builder, value):
|
|
932
|
+
builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(value), 0)
|
|
933
|
+
|
|
934
|
+
def StringValueEnd(builder):
|
|
935
|
+
return builder.EndObject()
|
|
936
|
+
|
|
937
|
+
|
|
938
|
+
|
|
939
|
+
class StringValueT(object):
|
|
940
|
+
|
|
941
|
+
# StringValueT
|
|
942
|
+
def __init__(
|
|
943
|
+
self,
|
|
944
|
+
value = None,
|
|
945
|
+
):
|
|
946
|
+
self.value = value # type: Optional[str]
|
|
947
|
+
|
|
948
|
+
@classmethod
|
|
949
|
+
def InitFromBuf(cls, buf, pos):
|
|
950
|
+
stringValue = StringValue()
|
|
951
|
+
stringValue.Init(buf, pos)
|
|
952
|
+
return cls.InitFromObj(stringValue)
|
|
953
|
+
|
|
954
|
+
@classmethod
|
|
955
|
+
def InitFromPackedBuf(cls, buf, pos=0):
|
|
956
|
+
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)
|
|
957
|
+
return cls.InitFromBuf(buf, pos+n)
|
|
958
|
+
|
|
959
|
+
@classmethod
|
|
960
|
+
def InitFromObj(cls, stringValue):
|
|
961
|
+
x = StringValueT()
|
|
962
|
+
x._UnPack(stringValue)
|
|
963
|
+
return x
|
|
964
|
+
|
|
965
|
+
# StringValueT
|
|
966
|
+
def _UnPack(self, stringValue):
|
|
967
|
+
if stringValue is None:
|
|
968
|
+
return
|
|
969
|
+
self.value = stringValue.Value()
|
|
970
|
+
|
|
971
|
+
# StringValueT
|
|
972
|
+
def Pack(self, builder):
|
|
973
|
+
if self.value is not None:
|
|
974
|
+
value = builder.CreateString(self.value)
|
|
975
|
+
StringValueStart(builder)
|
|
976
|
+
if self.value is not None:
|
|
977
|
+
StringValueAddValue(builder, value)
|
|
978
|
+
stringValue = StringValueEnd(builder)
|
|
979
|
+
return stringValue
|
|
980
|
+
|
|
981
|
+
|
|
982
|
+
class KeyValuePair(object):
|
|
983
|
+
__slots__ = ['_tab']
|
|
984
|
+
|
|
985
|
+
@classmethod
|
|
986
|
+
def GetRootAs(cls, buf, offset=0):
|
|
987
|
+
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
|
988
|
+
x = KeyValuePair()
|
|
989
|
+
x.Init(buf, n + offset)
|
|
990
|
+
return x
|
|
991
|
+
|
|
992
|
+
@classmethod
|
|
993
|
+
def GetRootAsKeyValuePair(cls, buf, offset=0):
|
|
994
|
+
"""This method is deprecated. Please switch to GetRootAs."""
|
|
995
|
+
return cls.GetRootAs(buf, offset)
|
|
996
|
+
# KeyValuePair
|
|
997
|
+
def Init(self, buf, pos):
|
|
998
|
+
self._tab = flatbuffers.table.Table(buf, pos)
|
|
999
|
+
|
|
1000
|
+
# KeyValuePair
|
|
1001
|
+
def Key(self):
|
|
1002
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
|
1003
|
+
if o != 0:
|
|
1004
|
+
return self._tab.String(o + self._tab.Pos)
|
|
1005
|
+
return None
|
|
1006
|
+
|
|
1007
|
+
# KeyValuePair
|
|
1008
|
+
def ValueType(self):
|
|
1009
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
|
1010
|
+
if o != 0:
|
|
1011
|
+
return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
|
|
1012
|
+
return 0
|
|
1013
|
+
|
|
1014
|
+
# KeyValuePair
|
|
1015
|
+
def Value(self):
|
|
1016
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
|
|
1017
|
+
if o != 0:
|
|
1018
|
+
from flatbuffers.table import Table
|
|
1019
|
+
obj = Table(bytearray(), 0)
|
|
1020
|
+
self._tab.Union(obj, o)
|
|
1021
|
+
return obj
|
|
1022
|
+
return None
|
|
1023
|
+
|
|
1024
|
+
def KeyValuePairStart(builder):
|
|
1025
|
+
builder.StartObject(3)
|
|
1026
|
+
|
|
1027
|
+
def KeyValuePairAddKey(builder, key):
|
|
1028
|
+
builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(key), 0)
|
|
1029
|
+
|
|
1030
|
+
def KeyValuePairAddValueType(builder, valueType):
|
|
1031
|
+
builder.PrependUint8Slot(1, valueType, 0)
|
|
1032
|
+
|
|
1033
|
+
def KeyValuePairAddValue(builder, value):
|
|
1034
|
+
builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(value), 0)
|
|
1035
|
+
|
|
1036
|
+
def KeyValuePairEnd(builder):
|
|
1037
|
+
return builder.EndObject()
|
|
1038
|
+
|
|
1039
|
+
|
|
1040
|
+
try:
|
|
1041
|
+
from typing import Union
|
|
1042
|
+
except:
|
|
1043
|
+
pass
|
|
1044
|
+
|
|
1045
|
+
class KeyValuePairT(object):
|
|
1046
|
+
|
|
1047
|
+
# KeyValuePairT
|
|
1048
|
+
def __init__(
|
|
1049
|
+
self,
|
|
1050
|
+
key = None,
|
|
1051
|
+
valueType = 0,
|
|
1052
|
+
value = None,
|
|
1053
|
+
):
|
|
1054
|
+
self.key = key # type: Optional[str]
|
|
1055
|
+
self.valueType = valueType # type: int
|
|
1056
|
+
self.value = value # type: Union[None, 'UInt8T', 'Int8T', 'UInt16T', 'Int16T', 'UInt32T', 'Int32T', 'Float32T', 'BoolT', 'StringValueT', 'UInt64T', 'Int64T', 'DoubleT']
|
|
1057
|
+
|
|
1058
|
+
@classmethod
|
|
1059
|
+
def InitFromBuf(cls, buf, pos):
|
|
1060
|
+
keyValuePair = KeyValuePair()
|
|
1061
|
+
keyValuePair.Init(buf, pos)
|
|
1062
|
+
return cls.InitFromObj(keyValuePair)
|
|
1063
|
+
|
|
1064
|
+
@classmethod
|
|
1065
|
+
def InitFromPackedBuf(cls, buf, pos=0):
|
|
1066
|
+
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)
|
|
1067
|
+
return cls.InitFromBuf(buf, pos+n)
|
|
1068
|
+
|
|
1069
|
+
@classmethod
|
|
1070
|
+
def InitFromObj(cls, keyValuePair):
|
|
1071
|
+
x = KeyValuePairT()
|
|
1072
|
+
x._UnPack(keyValuePair)
|
|
1073
|
+
return x
|
|
1074
|
+
|
|
1075
|
+
# KeyValuePairT
|
|
1076
|
+
def _UnPack(self, keyValuePair):
|
|
1077
|
+
if keyValuePair is None:
|
|
1078
|
+
return
|
|
1079
|
+
self.key = keyValuePair.Key()
|
|
1080
|
+
self.valueType = keyValuePair.ValueType()
|
|
1081
|
+
self.value = VDataCreator(self.valueType, keyValuePair.Value())
|
|
1082
|
+
|
|
1083
|
+
# KeyValuePairT
|
|
1084
|
+
def Pack(self, builder):
|
|
1085
|
+
if self.key is not None:
|
|
1086
|
+
key = builder.CreateString(self.key)
|
|
1087
|
+
if self.value is not None:
|
|
1088
|
+
value = self.value.Pack(builder)
|
|
1089
|
+
KeyValuePairStart(builder)
|
|
1090
|
+
if self.key is not None:
|
|
1091
|
+
KeyValuePairAddKey(builder, key)
|
|
1092
|
+
KeyValuePairAddValueType(builder, self.valueType)
|
|
1093
|
+
if self.value is not None:
|
|
1094
|
+
KeyValuePairAddValue(builder, value)
|
|
1095
|
+
keyValuePair = KeyValuePairEnd(builder)
|
|
1096
|
+
return keyValuePair
|
|
1097
|
+
|
|
1098
|
+
|
|
1099
|
+
class SystemMetadata(object):
|
|
1100
|
+
__slots__ = ['_tab']
|
|
1101
|
+
|
|
1102
|
+
@classmethod
|
|
1103
|
+
def GetRootAs(cls, buf, offset=0):
|
|
1104
|
+
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
|
1105
|
+
x = SystemMetadata()
|
|
1106
|
+
x.Init(buf, n + offset)
|
|
1107
|
+
return x
|
|
1108
|
+
|
|
1109
|
+
@classmethod
|
|
1110
|
+
def GetRootAsSystemMetadata(cls, buf, offset=0):
|
|
1111
|
+
"""This method is deprecated. Please switch to GetRootAs."""
|
|
1112
|
+
return cls.GetRootAs(buf, offset)
|
|
1113
|
+
# SystemMetadata
|
|
1114
|
+
def Init(self, buf, pos):
|
|
1115
|
+
self._tab = flatbuffers.table.Table(buf, pos)
|
|
1116
|
+
|
|
1117
|
+
# SystemMetadata
|
|
1118
|
+
def Entries(self, j):
|
|
1119
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
|
1120
|
+
if o != 0:
|
|
1121
|
+
x = self._tab.Vector(o)
|
|
1122
|
+
x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
|
|
1123
|
+
x = self._tab.Indirect(x)
|
|
1124
|
+
obj = KeyValuePair()
|
|
1125
|
+
obj.Init(self._tab.Bytes, x)
|
|
1126
|
+
return obj
|
|
1127
|
+
return None
|
|
1128
|
+
|
|
1129
|
+
# SystemMetadata
|
|
1130
|
+
def EntriesLength(self):
|
|
1131
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
|
1132
|
+
if o != 0:
|
|
1133
|
+
return self._tab.VectorLen(o)
|
|
1134
|
+
return 0
|
|
1135
|
+
|
|
1136
|
+
# SystemMetadata
|
|
1137
|
+
def EntriesIsNone(self):
|
|
1138
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
|
1139
|
+
return o == 0
|
|
1140
|
+
|
|
1141
|
+
def SystemMetadataStart(builder):
|
|
1142
|
+
builder.StartObject(1)
|
|
1143
|
+
|
|
1144
|
+
def SystemMetadataAddEntries(builder, entries):
|
|
1145
|
+
builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(entries), 0)
|
|
1146
|
+
|
|
1147
|
+
def SystemMetadataStartEntriesVector(builder, numElems):
|
|
1148
|
+
return builder.StartVector(4, numElems, 4)
|
|
1149
|
+
|
|
1150
|
+
def SystemMetadataEnd(builder):
|
|
1151
|
+
return builder.EndObject()
|
|
1152
|
+
|
|
1153
|
+
|
|
1154
|
+
try:
|
|
1155
|
+
from typing import List
|
|
1156
|
+
except:
|
|
1157
|
+
pass
|
|
1158
|
+
|
|
1159
|
+
class SystemMetadataT(object):
|
|
1160
|
+
|
|
1161
|
+
# SystemMetadataT
|
|
1162
|
+
def __init__(
|
|
1163
|
+
self,
|
|
1164
|
+
entries = None,
|
|
1165
|
+
):
|
|
1166
|
+
self.entries = entries # type: Optional[List[KeyValuePairT]]
|
|
1167
|
+
|
|
1168
|
+
@classmethod
|
|
1169
|
+
def InitFromBuf(cls, buf, pos):
|
|
1170
|
+
systemMetadata = SystemMetadata()
|
|
1171
|
+
systemMetadata.Init(buf, pos)
|
|
1172
|
+
return cls.InitFromObj(systemMetadata)
|
|
1173
|
+
|
|
1174
|
+
@classmethod
|
|
1175
|
+
def InitFromPackedBuf(cls, buf, pos=0):
|
|
1176
|
+
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)
|
|
1177
|
+
return cls.InitFromBuf(buf, pos+n)
|
|
1178
|
+
|
|
1179
|
+
@classmethod
|
|
1180
|
+
def InitFromObj(cls, systemMetadata):
|
|
1181
|
+
x = SystemMetadataT()
|
|
1182
|
+
x._UnPack(systemMetadata)
|
|
1183
|
+
return x
|
|
1184
|
+
|
|
1185
|
+
# SystemMetadataT
|
|
1186
|
+
def _UnPack(self, systemMetadata):
|
|
1187
|
+
if systemMetadata is None:
|
|
1188
|
+
return
|
|
1189
|
+
if not systemMetadata.EntriesIsNone():
|
|
1190
|
+
self.entries = []
|
|
1191
|
+
for i in range(systemMetadata.EntriesLength()):
|
|
1192
|
+
if systemMetadata.Entries(i) is None:
|
|
1193
|
+
self.entries.append(None)
|
|
1194
|
+
else:
|
|
1195
|
+
keyValuePair_ = KeyValuePairT.InitFromObj(systemMetadata.Entries(i))
|
|
1196
|
+
self.entries.append(keyValuePair_)
|
|
1197
|
+
|
|
1198
|
+
# SystemMetadataT
|
|
1199
|
+
def Pack(self, builder):
|
|
1200
|
+
if self.entries is not None:
|
|
1201
|
+
entrieslist = []
|
|
1202
|
+
for i in range(len(self.entries)):
|
|
1203
|
+
entrieslist.append(self.entries[i].Pack(builder))
|
|
1204
|
+
SystemMetadataStartEntriesVector(builder, len(self.entries))
|
|
1205
|
+
for i in reversed(range(len(self.entries))):
|
|
1206
|
+
builder.PrependUOffsetTRelative(entrieslist[i])
|
|
1207
|
+
entries = builder.EndVector()
|
|
1208
|
+
SystemMetadataStart(builder)
|
|
1209
|
+
if self.entries is not None:
|
|
1210
|
+
SystemMetadataAddEntries(builder, entries)
|
|
1211
|
+
systemMetadata = SystemMetadataEnd(builder)
|
|
1212
|
+
return systemMetadata
|
|
1213
|
+
|
|
1214
|
+
|
|
1215
|
+
class SectionObject(object):
|
|
1216
|
+
__slots__ = ['_tab']
|
|
1217
|
+
|
|
1218
|
+
@classmethod
|
|
1219
|
+
def GetRootAs(cls, buf, offset=0):
|
|
1220
|
+
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
|
1221
|
+
x = SectionObject()
|
|
1222
|
+
x.Init(buf, n + offset)
|
|
1223
|
+
return x
|
|
1224
|
+
|
|
1225
|
+
@classmethod
|
|
1226
|
+
def GetRootAsSectionObject(cls, buf, offset=0):
|
|
1227
|
+
"""This method is deprecated. Please switch to GetRootAs."""
|
|
1228
|
+
return cls.GetRootAs(buf, offset)
|
|
1229
|
+
# SectionObject
|
|
1230
|
+
def Init(self, buf, pos):
|
|
1231
|
+
self._tab = flatbuffers.table.Table(buf, pos)
|
|
1232
|
+
|
|
1233
|
+
# SectionObject
|
|
1234
|
+
def Items(self, j):
|
|
1235
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
|
1236
|
+
if o != 0:
|
|
1237
|
+
x = self._tab.Vector(o)
|
|
1238
|
+
x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
|
|
1239
|
+
x = self._tab.Indirect(x)
|
|
1240
|
+
obj = KeyValuePair()
|
|
1241
|
+
obj.Init(self._tab.Bytes, x)
|
|
1242
|
+
return obj
|
|
1243
|
+
return None
|
|
1244
|
+
|
|
1245
|
+
# SectionObject
|
|
1246
|
+
def ItemsLength(self):
|
|
1247
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
|
1248
|
+
if o != 0:
|
|
1249
|
+
return self._tab.VectorLen(o)
|
|
1250
|
+
return 0
|
|
1251
|
+
|
|
1252
|
+
# SectionObject
|
|
1253
|
+
def ItemsIsNone(self):
|
|
1254
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
|
1255
|
+
return o == 0
|
|
1256
|
+
|
|
1257
|
+
# SectionObject
|
|
1258
|
+
def BeginOffset(self):
|
|
1259
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
|
1260
|
+
if o != 0:
|
|
1261
|
+
return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
|
|
1262
|
+
return 0
|
|
1263
|
+
|
|
1264
|
+
# SectionObject
|
|
1265
|
+
def EndOffset(self):
|
|
1266
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
|
|
1267
|
+
if o != 0:
|
|
1268
|
+
return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
|
|
1269
|
+
return 0
|
|
1270
|
+
|
|
1271
|
+
# SectionObject
|
|
1272
|
+
def DataType(self):
|
|
1273
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
|
|
1274
|
+
if o != 0:
|
|
1275
|
+
return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
|
|
1276
|
+
return 0
|
|
1277
|
+
|
|
1278
|
+
def SectionObjectStart(builder):
|
|
1279
|
+
builder.StartObject(4)
|
|
1280
|
+
|
|
1281
|
+
def SectionObjectAddItems(builder, items):
|
|
1282
|
+
builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(items), 0)
|
|
1283
|
+
|
|
1284
|
+
def SectionObjectStartItemsVector(builder, numElems):
|
|
1285
|
+
return builder.StartVector(4, numElems, 4)
|
|
1286
|
+
|
|
1287
|
+
def SectionObjectAddBeginOffset(builder, beginOffset):
|
|
1288
|
+
builder.PrependUint64Slot(1, beginOffset, 0)
|
|
1289
|
+
|
|
1290
|
+
def SectionObjectAddEndOffset(builder, endOffset):
|
|
1291
|
+
builder.PrependUint64Slot(2, endOffset, 0)
|
|
1292
|
+
|
|
1293
|
+
def SectionObjectAddDataType(builder, dataType):
|
|
1294
|
+
builder.PrependUint8Slot(3, dataType, 0)
|
|
1295
|
+
|
|
1296
|
+
def SectionObjectEnd(builder):
|
|
1297
|
+
return builder.EndObject()
|
|
1298
|
+
|
|
1299
|
+
|
|
1300
|
+
try:
|
|
1301
|
+
from typing import List
|
|
1302
|
+
except:
|
|
1303
|
+
pass
|
|
1304
|
+
|
|
1305
|
+
class SectionObjectT(object):
|
|
1306
|
+
|
|
1307
|
+
# SectionObjectT
|
|
1308
|
+
def __init__(
|
|
1309
|
+
self,
|
|
1310
|
+
items = None,
|
|
1311
|
+
beginOffset = 0,
|
|
1312
|
+
endOffset = 0,
|
|
1313
|
+
dataType = 0,
|
|
1314
|
+
):
|
|
1315
|
+
self.items = items # type: Optional[List[KeyValuePairT]]
|
|
1316
|
+
self.beginOffset = beginOffset # type: int
|
|
1317
|
+
self.endOffset = endOffset # type: int
|
|
1318
|
+
self.dataType = dataType # type: int
|
|
1319
|
+
|
|
1320
|
+
@classmethod
|
|
1321
|
+
def InitFromBuf(cls, buf, pos):
|
|
1322
|
+
sectionObject = SectionObject()
|
|
1323
|
+
sectionObject.Init(buf, pos)
|
|
1324
|
+
return cls.InitFromObj(sectionObject)
|
|
1325
|
+
|
|
1326
|
+
@classmethod
|
|
1327
|
+
def InitFromPackedBuf(cls, buf, pos=0):
|
|
1328
|
+
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)
|
|
1329
|
+
return cls.InitFromBuf(buf, pos+n)
|
|
1330
|
+
|
|
1331
|
+
@classmethod
|
|
1332
|
+
def InitFromObj(cls, sectionObject):
|
|
1333
|
+
x = SectionObjectT()
|
|
1334
|
+
x._UnPack(sectionObject)
|
|
1335
|
+
return x
|
|
1336
|
+
|
|
1337
|
+
# SectionObjectT
|
|
1338
|
+
def _UnPack(self, sectionObject):
|
|
1339
|
+
if sectionObject is None:
|
|
1340
|
+
return
|
|
1341
|
+
if not sectionObject.ItemsIsNone():
|
|
1342
|
+
self.items = []
|
|
1343
|
+
for i in range(sectionObject.ItemsLength()):
|
|
1344
|
+
if sectionObject.Items(i) is None:
|
|
1345
|
+
self.items.append(None)
|
|
1346
|
+
else:
|
|
1347
|
+
keyValuePair_ = KeyValuePairT.InitFromObj(sectionObject.Items(i))
|
|
1348
|
+
self.items.append(keyValuePair_)
|
|
1349
|
+
self.beginOffset = sectionObject.BeginOffset()
|
|
1350
|
+
self.endOffset = sectionObject.EndOffset()
|
|
1351
|
+
self.dataType = sectionObject.DataType()
|
|
1352
|
+
|
|
1353
|
+
# SectionObjectT
|
|
1354
|
+
def Pack(self, builder):
|
|
1355
|
+
if self.items is not None:
|
|
1356
|
+
itemslist = []
|
|
1357
|
+
for i in range(len(self.items)):
|
|
1358
|
+
itemslist.append(self.items[i].Pack(builder))
|
|
1359
|
+
SectionObjectStartItemsVector(builder, len(self.items))
|
|
1360
|
+
for i in reversed(range(len(self.items))):
|
|
1361
|
+
builder.PrependUOffsetTRelative(itemslist[i])
|
|
1362
|
+
items = builder.EndVector()
|
|
1363
|
+
SectionObjectStart(builder)
|
|
1364
|
+
if self.items is not None:
|
|
1365
|
+
SectionObjectAddItems(builder, items)
|
|
1366
|
+
SectionObjectAddBeginOffset(builder, self.beginOffset)
|
|
1367
|
+
SectionObjectAddEndOffset(builder, self.endOffset)
|
|
1368
|
+
SectionObjectAddDataType(builder, self.dataType)
|
|
1369
|
+
sectionObject = SectionObjectEnd(builder)
|
|
1370
|
+
return sectionObject
|
|
1371
|
+
|
|
1372
|
+
|
|
1373
|
+
class SectionMetadata(object):
|
|
1374
|
+
__slots__ = ['_tab']
|
|
1375
|
+
|
|
1376
|
+
@classmethod
|
|
1377
|
+
def GetRootAs(cls, buf, offset=0):
|
|
1378
|
+
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
|
1379
|
+
x = SectionMetadata()
|
|
1380
|
+
x.Init(buf, n + offset)
|
|
1381
|
+
return x
|
|
1382
|
+
|
|
1383
|
+
@classmethod
|
|
1384
|
+
def GetRootAsSectionMetadata(cls, buf, offset=0):
|
|
1385
|
+
"""This method is deprecated. Please switch to GetRootAs."""
|
|
1386
|
+
return cls.GetRootAs(buf, offset)
|
|
1387
|
+
# SectionMetadata
|
|
1388
|
+
def Init(self, buf, pos):
|
|
1389
|
+
self._tab = flatbuffers.table.Table(buf, pos)
|
|
1390
|
+
|
|
1391
|
+
# SectionMetadata
|
|
1392
|
+
def Objects(self, j):
|
|
1393
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
|
1394
|
+
if o != 0:
|
|
1395
|
+
x = self._tab.Vector(o)
|
|
1396
|
+
x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
|
|
1397
|
+
x = self._tab.Indirect(x)
|
|
1398
|
+
obj = SectionObject()
|
|
1399
|
+
obj.Init(self._tab.Bytes, x)
|
|
1400
|
+
return obj
|
|
1401
|
+
return None
|
|
1402
|
+
|
|
1403
|
+
# SectionMetadata
|
|
1404
|
+
def ObjectsLength(self):
|
|
1405
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
|
1406
|
+
if o != 0:
|
|
1407
|
+
return self._tab.VectorLen(o)
|
|
1408
|
+
return 0
|
|
1409
|
+
|
|
1410
|
+
# SectionMetadata
|
|
1411
|
+
def ObjectsIsNone(self):
|
|
1412
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
|
1413
|
+
return o == 0
|
|
1414
|
+
|
|
1415
|
+
def SectionMetadataStart(builder):
|
|
1416
|
+
builder.StartObject(1)
|
|
1417
|
+
|
|
1418
|
+
def SectionMetadataAddObjects(builder, objects):
|
|
1419
|
+
builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(objects), 0)
|
|
1420
|
+
|
|
1421
|
+
def SectionMetadataStartObjectsVector(builder, numElems):
|
|
1422
|
+
return builder.StartVector(4, numElems, 4)
|
|
1423
|
+
|
|
1424
|
+
def SectionMetadataEnd(builder):
|
|
1425
|
+
return builder.EndObject()
|
|
1426
|
+
|
|
1427
|
+
|
|
1428
|
+
try:
|
|
1429
|
+
from typing import List
|
|
1430
|
+
except:
|
|
1431
|
+
pass
|
|
1432
|
+
|
|
1433
|
+
class SectionMetadataT(object):
|
|
1434
|
+
|
|
1435
|
+
# SectionMetadataT
|
|
1436
|
+
def __init__(
|
|
1437
|
+
self,
|
|
1438
|
+
objects = None,
|
|
1439
|
+
):
|
|
1440
|
+
self.objects = objects # type: Optional[List[SectionObjectT]]
|
|
1441
|
+
|
|
1442
|
+
@classmethod
|
|
1443
|
+
def InitFromBuf(cls, buf, pos):
|
|
1444
|
+
sectionMetadata = SectionMetadata()
|
|
1445
|
+
sectionMetadata.Init(buf, pos)
|
|
1446
|
+
return cls.InitFromObj(sectionMetadata)
|
|
1447
|
+
|
|
1448
|
+
@classmethod
|
|
1449
|
+
def InitFromPackedBuf(cls, buf, pos=0):
|
|
1450
|
+
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)
|
|
1451
|
+
return cls.InitFromBuf(buf, pos+n)
|
|
1452
|
+
|
|
1453
|
+
@classmethod
|
|
1454
|
+
def InitFromObj(cls, sectionMetadata):
|
|
1455
|
+
x = SectionMetadataT()
|
|
1456
|
+
x._UnPack(sectionMetadata)
|
|
1457
|
+
return x
|
|
1458
|
+
|
|
1459
|
+
# SectionMetadataT
|
|
1460
|
+
def _UnPack(self, sectionMetadata):
|
|
1461
|
+
if sectionMetadata is None:
|
|
1462
|
+
return
|
|
1463
|
+
if not sectionMetadata.ObjectsIsNone():
|
|
1464
|
+
self.objects = []
|
|
1465
|
+
for i in range(sectionMetadata.ObjectsLength()):
|
|
1466
|
+
if sectionMetadata.Objects(i) is None:
|
|
1467
|
+
self.objects.append(None)
|
|
1468
|
+
else:
|
|
1469
|
+
sectionObject_ = SectionObjectT.InitFromObj(sectionMetadata.Objects(i))
|
|
1470
|
+
self.objects.append(sectionObject_)
|
|
1471
|
+
|
|
1472
|
+
# SectionMetadataT
|
|
1473
|
+
def Pack(self, builder):
|
|
1474
|
+
if self.objects is not None:
|
|
1475
|
+
objectslist = []
|
|
1476
|
+
for i in range(len(self.objects)):
|
|
1477
|
+
objectslist.append(self.objects[i].Pack(builder))
|
|
1478
|
+
SectionMetadataStartObjectsVector(builder, len(self.objects))
|
|
1479
|
+
for i in reversed(range(len(self.objects))):
|
|
1480
|
+
builder.PrependUOffsetTRelative(objectslist[i])
|
|
1481
|
+
objects = builder.EndVector()
|
|
1482
|
+
SectionMetadataStart(builder)
|
|
1483
|
+
if self.objects is not None:
|
|
1484
|
+
SectionMetadataAddObjects(builder, objects)
|
|
1485
|
+
sectionMetadata = SectionMetadataEnd(builder)
|
|
1486
|
+
return sectionMetadata
|
|
1487
|
+
|
|
1488
|
+
|
|
1489
|
+
class LiteRTLMMetaData(object):
|
|
1490
|
+
__slots__ = ['_tab']
|
|
1491
|
+
|
|
1492
|
+
@classmethod
|
|
1493
|
+
def GetRootAs(cls, buf, offset=0):
|
|
1494
|
+
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
|
1495
|
+
x = LiteRTLMMetaData()
|
|
1496
|
+
x.Init(buf, n + offset)
|
|
1497
|
+
return x
|
|
1498
|
+
|
|
1499
|
+
@classmethod
|
|
1500
|
+
def GetRootAsLiteRTLMMetaData(cls, buf, offset=0):
|
|
1501
|
+
"""This method is deprecated. Please switch to GetRootAs."""
|
|
1502
|
+
return cls.GetRootAs(buf, offset)
|
|
1503
|
+
# LiteRTLMMetaData
|
|
1504
|
+
def Init(self, buf, pos):
|
|
1505
|
+
self._tab = flatbuffers.table.Table(buf, pos)
|
|
1506
|
+
|
|
1507
|
+
# LiteRTLMMetaData
|
|
1508
|
+
def SystemMetadata(self):
|
|
1509
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
|
1510
|
+
if o != 0:
|
|
1511
|
+
x = self._tab.Indirect(o + self._tab.Pos)
|
|
1512
|
+
obj = SystemMetadata()
|
|
1513
|
+
obj.Init(self._tab.Bytes, x)
|
|
1514
|
+
return obj
|
|
1515
|
+
return None
|
|
1516
|
+
|
|
1517
|
+
# LiteRTLMMetaData
|
|
1518
|
+
def SectionMetadata(self):
|
|
1519
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
|
1520
|
+
if o != 0:
|
|
1521
|
+
x = self._tab.Indirect(o + self._tab.Pos)
|
|
1522
|
+
obj = SectionMetadata()
|
|
1523
|
+
obj.Init(self._tab.Bytes, x)
|
|
1524
|
+
return obj
|
|
1525
|
+
return None
|
|
1526
|
+
|
|
1527
|
+
def LiteRTLMMetaDataStart(builder):
|
|
1528
|
+
builder.StartObject(2)
|
|
1529
|
+
|
|
1530
|
+
def LiteRTLMMetaDataAddSystemMetadata(builder, systemMetadata):
|
|
1531
|
+
builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(systemMetadata), 0)
|
|
1532
|
+
|
|
1533
|
+
def LiteRTLMMetaDataAddSectionMetadata(builder, sectionMetadata):
|
|
1534
|
+
builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(sectionMetadata), 0)
|
|
1535
|
+
|
|
1536
|
+
def LiteRTLMMetaDataEnd(builder):
|
|
1537
|
+
return builder.EndObject()
|
|
1538
|
+
|
|
1539
|
+
|
|
1540
|
+
try:
|
|
1541
|
+
from typing import Optional
|
|
1542
|
+
except:
|
|
1543
|
+
pass
|
|
1544
|
+
|
|
1545
|
+
class LiteRTLMMetaDataT(object):
|
|
1546
|
+
|
|
1547
|
+
# LiteRTLMMetaDataT
|
|
1548
|
+
def __init__(
|
|
1549
|
+
self,
|
|
1550
|
+
systemMetadata = None,
|
|
1551
|
+
sectionMetadata = None,
|
|
1552
|
+
):
|
|
1553
|
+
self.systemMetadata = systemMetadata # type: Optional[SystemMetadataT]
|
|
1554
|
+
self.sectionMetadata = sectionMetadata # type: Optional[SectionMetadataT]
|
|
1555
|
+
|
|
1556
|
+
@classmethod
|
|
1557
|
+
def InitFromBuf(cls, buf, pos):
|
|
1558
|
+
liteRtlmmetaData = LiteRTLMMetaData()
|
|
1559
|
+
liteRtlmmetaData.Init(buf, pos)
|
|
1560
|
+
return cls.InitFromObj(liteRtlmmetaData)
|
|
1561
|
+
|
|
1562
|
+
@classmethod
|
|
1563
|
+
def InitFromPackedBuf(cls, buf, pos=0):
|
|
1564
|
+
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)
|
|
1565
|
+
return cls.InitFromBuf(buf, pos+n)
|
|
1566
|
+
|
|
1567
|
+
@classmethod
|
|
1568
|
+
def InitFromObj(cls, liteRtlmmetaData):
|
|
1569
|
+
x = LiteRTLMMetaDataT()
|
|
1570
|
+
x._UnPack(liteRtlmmetaData)
|
|
1571
|
+
return x
|
|
1572
|
+
|
|
1573
|
+
# LiteRTLMMetaDataT
|
|
1574
|
+
def _UnPack(self, liteRtlmmetaData):
|
|
1575
|
+
if liteRtlmmetaData is None:
|
|
1576
|
+
return
|
|
1577
|
+
if liteRtlmmetaData.SystemMetadata() is not None:
|
|
1578
|
+
self.systemMetadata = SystemMetadataT.InitFromObj(liteRtlmmetaData.SystemMetadata())
|
|
1579
|
+
if liteRtlmmetaData.SectionMetadata() is not None:
|
|
1580
|
+
self.sectionMetadata = SectionMetadataT.InitFromObj(liteRtlmmetaData.SectionMetadata())
|
|
1581
|
+
|
|
1582
|
+
# LiteRTLMMetaDataT
|
|
1583
|
+
def Pack(self, builder):
|
|
1584
|
+
if self.systemMetadata is not None:
|
|
1585
|
+
systemMetadata = self.systemMetadata.Pack(builder)
|
|
1586
|
+
if self.sectionMetadata is not None:
|
|
1587
|
+
sectionMetadata = self.sectionMetadata.Pack(builder)
|
|
1588
|
+
LiteRTLMMetaDataStart(builder)
|
|
1589
|
+
if self.systemMetadata is not None:
|
|
1590
|
+
LiteRTLMMetaDataAddSystemMetadata(builder, systemMetadata)
|
|
1591
|
+
if self.sectionMetadata is not None:
|
|
1592
|
+
LiteRTLMMetaDataAddSectionMetadata(builder, sectionMetadata)
|
|
1593
|
+
liteRtlmmetaData = LiteRTLMMetaDataEnd(builder)
|
|
1594
|
+
return liteRtlmmetaData
|
|
1595
|
+
|
|
1596
|
+
|