zlmdb 25.12.2__cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.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.
Files changed (76) hide show
  1. zlmdb/__init__.py +416 -0
  2. zlmdb/_database.py +990 -0
  3. zlmdb/_errors.py +31 -0
  4. zlmdb/_flatc/__init__.py +105 -0
  5. zlmdb/_lmdb_vendor/__init__.py +37 -0
  6. zlmdb/_lmdb_vendor/__main__.py +25 -0
  7. zlmdb/_lmdb_vendor/_config.py +10 -0
  8. zlmdb/_lmdb_vendor/_lmdb_cffi.cpython-314t-aarch64-linux-gnu.so +0 -0
  9. zlmdb/_lmdb_vendor/cffi.py +2606 -0
  10. zlmdb/_lmdb_vendor/tool.py +670 -0
  11. zlmdb/_meta.py +27 -0
  12. zlmdb/_pmap.py +1667 -0
  13. zlmdb/_schema.py +137 -0
  14. zlmdb/_transaction.py +181 -0
  15. zlmdb/_types.py +1596 -0
  16. zlmdb/_version.py +27 -0
  17. zlmdb/cli.py +41 -0
  18. zlmdb/flatbuffers/__init__.py +60 -0
  19. zlmdb/flatbuffers/_git_version.py +24 -0
  20. zlmdb/flatbuffers/_version.py +17 -0
  21. zlmdb/flatbuffers/builder.py +824 -0
  22. zlmdb/flatbuffers/compat.py +89 -0
  23. zlmdb/flatbuffers/encode.py +43 -0
  24. zlmdb/flatbuffers/flexbuffers.py +1570 -0
  25. zlmdb/flatbuffers/number_types.py +182 -0
  26. zlmdb/flatbuffers/packer.py +42 -0
  27. zlmdb/flatbuffers/reflection/AdvancedFeatures.py +10 -0
  28. zlmdb/flatbuffers/reflection/BaseType.py +25 -0
  29. zlmdb/flatbuffers/reflection/Enum.py +252 -0
  30. zlmdb/flatbuffers/reflection/EnumVal.py +144 -0
  31. zlmdb/flatbuffers/reflection/Field.py +325 -0
  32. zlmdb/flatbuffers/reflection/KeyValue.py +84 -0
  33. zlmdb/flatbuffers/reflection/Object.py +260 -0
  34. zlmdb/flatbuffers/reflection/RPCCall.py +195 -0
  35. zlmdb/flatbuffers/reflection/Schema.py +301 -0
  36. zlmdb/flatbuffers/reflection/SchemaFile.py +112 -0
  37. zlmdb/flatbuffers/reflection/Service.py +213 -0
  38. zlmdb/flatbuffers/reflection/Type.py +148 -0
  39. zlmdb/flatbuffers/reflection/__init__.py +0 -0
  40. zlmdb/flatbuffers/reflection.fbs +156 -0
  41. zlmdb/flatbuffers/table.py +129 -0
  42. zlmdb/flatbuffers/util.py +47 -0
  43. zlmdb/py.typed +0 -0
  44. zlmdb/tests/conftest.py +9 -0
  45. zlmdb/tests/lmdb/__init__.py +0 -0
  46. zlmdb/tests/lmdb/address_book.py +287 -0
  47. zlmdb/tests/lmdb/crash_test.py +339 -0
  48. zlmdb/tests/lmdb/cursor_test.py +333 -0
  49. zlmdb/tests/lmdb/env_test.py +919 -0
  50. zlmdb/tests/lmdb/getmulti_test.py +92 -0
  51. zlmdb/tests/lmdb/iteration_test.py +258 -0
  52. zlmdb/tests/lmdb/package_test.py +70 -0
  53. zlmdb/tests/lmdb/test_lmdb.py +188 -0
  54. zlmdb/tests/lmdb/testlib.py +185 -0
  55. zlmdb/tests/lmdb/tool_test.py +60 -0
  56. zlmdb/tests/lmdb/txn_test.py +575 -0
  57. zlmdb/tests/orm/MNodeLog.py +853 -0
  58. zlmdb/tests/orm/__init__.py +0 -0
  59. zlmdb/tests/orm/_schema_fbs.py +215 -0
  60. zlmdb/tests/orm/_schema_mnode_log.py +1202 -0
  61. zlmdb/tests/orm/_schema_py2.py +250 -0
  62. zlmdb/tests/orm/_schema_py3.py +307 -0
  63. zlmdb/tests/orm/_test_flatbuffers.py +144 -0
  64. zlmdb/tests/orm/_test_serialization.py +144 -0
  65. zlmdb/tests/orm/test_basic.py +217 -0
  66. zlmdb/tests/orm/test_etcd.py +275 -0
  67. zlmdb/tests/orm/test_pmap_indexes.py +466 -0
  68. zlmdb/tests/orm/test_pmap_types.py +90 -0
  69. zlmdb/tests/orm/test_pmaps.py +295 -0
  70. zlmdb/tests/orm/test_select.py +619 -0
  71. zlmdb-25.12.2.dist-info/METADATA +280 -0
  72. zlmdb-25.12.2.dist-info/RECORD +76 -0
  73. zlmdb-25.12.2.dist-info/WHEEL +7 -0
  74. zlmdb-25.12.2.dist-info/entry_points.txt +3 -0
  75. zlmdb-25.12.2.dist-info/licenses/LICENSE +167 -0
  76. zlmdb-25.12.2.dist-info/licenses/NOTICE +41 -0
@@ -0,0 +1,182 @@
1
+ # Copyright 2014 Google Inc. All rights reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ import collections
16
+ import struct
17
+
18
+ from . import packer
19
+ from .compat import import_numpy, NumpyRequiredForThisFeature
20
+
21
+ np = import_numpy()
22
+
23
+ # For reference, see:
24
+ # https://docs.python.org/2/library/ctypes.html#ctypes-fundamental-data-types-2
25
+
26
+ # These classes could be collections.namedtuple instances, but those are new
27
+ # in 2.6 and we want to work towards 2.5 compatability.
28
+
29
+
30
+ class BoolFlags(object):
31
+ bytewidth = 1
32
+ min_val = False
33
+ max_val = True
34
+ py_type = bool
35
+ name = "bool"
36
+ packer_type = packer.boolean
37
+
38
+
39
+ class Uint8Flags(object):
40
+ bytewidth = 1
41
+ min_val = 0
42
+ max_val = (2**8) - 1
43
+ py_type = int
44
+ name = "uint8"
45
+ packer_type = packer.uint8
46
+
47
+
48
+ class Uint16Flags(object):
49
+ bytewidth = 2
50
+ min_val = 0
51
+ max_val = (2**16) - 1
52
+ py_type = int
53
+ name = "uint16"
54
+ packer_type = packer.uint16
55
+
56
+
57
+ class Uint32Flags(object):
58
+ bytewidth = 4
59
+ min_val = 0
60
+ max_val = (2**32) - 1
61
+ py_type = int
62
+ name = "uint32"
63
+ packer_type = packer.uint32
64
+
65
+
66
+ class Uint64Flags(object):
67
+ bytewidth = 8
68
+ min_val = 0
69
+ max_val = (2**64) - 1
70
+ py_type = int
71
+ name = "uint64"
72
+ packer_type = packer.uint64
73
+
74
+
75
+ class Int8Flags(object):
76
+ bytewidth = 1
77
+ min_val = -(2**7)
78
+ max_val = (2**7) - 1
79
+ py_type = int
80
+ name = "int8"
81
+ packer_type = packer.int8
82
+
83
+
84
+ class Int16Flags(object):
85
+ bytewidth = 2
86
+ min_val = -(2**15)
87
+ max_val = (2**15) - 1
88
+ py_type = int
89
+ name = "int16"
90
+ packer_type = packer.int16
91
+
92
+
93
+ class Int32Flags(object):
94
+ bytewidth = 4
95
+ min_val = -(2**31)
96
+ max_val = (2**31) - 1
97
+ py_type = int
98
+ name = "int32"
99
+ packer_type = packer.int32
100
+
101
+
102
+ class Int64Flags(object):
103
+ bytewidth = 8
104
+ min_val = -(2**63)
105
+ max_val = (2**63) - 1
106
+ py_type = int
107
+ name = "int64"
108
+ packer_type = packer.int64
109
+
110
+
111
+ class Float32Flags(object):
112
+ bytewidth = 4
113
+ min_val = None
114
+ max_val = None
115
+ py_type = float
116
+ name = "float32"
117
+ packer_type = packer.float32
118
+
119
+
120
+ class Float64Flags(object):
121
+ bytewidth = 8
122
+ min_val = None
123
+ max_val = None
124
+ py_type = float
125
+ name = "float64"
126
+ packer_type = packer.float64
127
+
128
+
129
+ class SOffsetTFlags(Int32Flags):
130
+ pass
131
+
132
+
133
+ class UOffsetTFlags(Uint32Flags):
134
+ pass
135
+
136
+
137
+ class VOffsetTFlags(Uint16Flags):
138
+ pass
139
+
140
+
141
+ def valid_number(n, flags):
142
+ if flags.min_val is None and flags.max_val is None:
143
+ return True
144
+ return flags.min_val <= n <= flags.max_val
145
+
146
+
147
+ def enforce_number(n, flags):
148
+ if flags.min_val is None and flags.max_val is None:
149
+ return
150
+ if not flags.min_val <= n <= flags.max_val:
151
+ raise TypeError("bad number %s for type %s" % (str(n), flags.name))
152
+
153
+
154
+ def float32_to_uint32(n):
155
+ packed = struct.pack("<1f", n)
156
+ (converted,) = struct.unpack("<1L", packed)
157
+ return converted
158
+
159
+
160
+ def uint32_to_float32(n):
161
+ packed = struct.pack("<1L", n)
162
+ (unpacked,) = struct.unpack("<1f", packed)
163
+ return unpacked
164
+
165
+
166
+ def float64_to_uint64(n):
167
+ packed = struct.pack("<1d", n)
168
+ (converted,) = struct.unpack("<1Q", packed)
169
+ return converted
170
+
171
+
172
+ def uint64_to_float64(n):
173
+ packed = struct.pack("<1Q", n)
174
+ (unpacked,) = struct.unpack("<1d", packed)
175
+ return unpacked
176
+
177
+
178
+ def to_numpy_type(number_type):
179
+ if np is not None:
180
+ return np.dtype(number_type.name).newbyteorder("<")
181
+ else:
182
+ raise NumpyRequiredForThisFeature("Numpy was not found.")
@@ -0,0 +1,42 @@
1
+ # Copyright 2016 Google Inc. All rights reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ """
16
+ Provide pre-compiled struct packers for encoding and decoding.
17
+
18
+ See: https://docs.python.org/2/library/struct.html#format-characters
19
+ """
20
+
21
+ import struct
22
+ from . import compat
23
+
24
+
25
+ boolean = struct.Struct(compat.struct_bool_decl)
26
+
27
+ uint8 = struct.Struct("<B")
28
+ uint16 = struct.Struct("<H")
29
+ uint32 = struct.Struct("<I")
30
+ uint64 = struct.Struct("<Q")
31
+
32
+ int8 = struct.Struct("<b")
33
+ int16 = struct.Struct("<h")
34
+ int32 = struct.Struct("<i")
35
+ int64 = struct.Struct("<q")
36
+
37
+ float32 = struct.Struct("<f")
38
+ float64 = struct.Struct("<d")
39
+
40
+ uoffset = uint32
41
+ soffset = int32
42
+ voffset = uint16
@@ -0,0 +1,10 @@
1
+ # automatically generated by the FlatBuffers compiler, do not modify
2
+
3
+ # namespace: reflection
4
+
5
+ # New schema language features that are not supported by old code generators.
6
+ class AdvancedFeatures(object):
7
+ AdvancedArrayFeatures = 1
8
+ AdvancedUnionFeatures = 2
9
+ OptionalScalars = 4
10
+ DefaultVectorsAndStrings = 8
@@ -0,0 +1,25 @@
1
+ # automatically generated by the FlatBuffers compiler, do not modify
2
+
3
+ # namespace: reflection
4
+
5
+
6
+ class BaseType(object):
7
+ None_ = 0
8
+ UType = 1
9
+ Bool = 2
10
+ Byte = 3
11
+ UByte = 4
12
+ Short = 5
13
+ UShort = 6
14
+ Int = 7
15
+ UInt = 8
16
+ Long = 9
17
+ ULong = 10
18
+ Float = 11
19
+ Double = 12
20
+ String = 13
21
+ Vector = 14
22
+ Obj = 15
23
+ Union = 16
24
+ Array = 17
25
+ MaxBaseType = 18
@@ -0,0 +1,252 @@
1
+ # automatically generated by the FlatBuffers compiler, do not modify
2
+
3
+ # namespace: reflection
4
+
5
+ import flatbuffers
6
+ from flatbuffers.compat import import_numpy
7
+
8
+ np = import_numpy()
9
+
10
+
11
+ class Enum(object):
12
+ __slots__ = ["_tab"]
13
+
14
+ @classmethod
15
+ def GetRootAs(cls, buf, offset=0):
16
+ n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
17
+ x = Enum()
18
+ x.Init(buf, n + offset)
19
+ return x
20
+
21
+ @classmethod
22
+ def GetRootAsEnum(cls, buf, offset=0):
23
+ """This method is deprecated. Please switch to GetRootAs."""
24
+ return cls.GetRootAs(buf, offset)
25
+
26
+ @classmethod
27
+ def EnumBufferHasIdentifier(cls, buf, offset, size_prefixed=False):
28
+ return flatbuffers.util.BufferHasIdentifier(
29
+ buf, offset, b"\x42\x46\x42\x53", size_prefixed=size_prefixed
30
+ )
31
+
32
+ # Enum
33
+ def Init(self, buf, pos):
34
+ self._tab = flatbuffers.table.Table(buf, pos)
35
+
36
+ # Enum
37
+ def Name(self):
38
+ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
39
+ if o != 0:
40
+ return self._tab.String(o + self._tab.Pos)
41
+ return None
42
+
43
+ # Enum
44
+ def Values(self, j):
45
+ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
46
+ if o != 0:
47
+ x = self._tab.Vector(o)
48
+ x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
49
+ x = self._tab.Indirect(x)
50
+ from reflection.EnumVal import EnumVal
51
+
52
+ obj = EnumVal()
53
+ obj.Init(self._tab.Bytes, x)
54
+ return obj
55
+ return None
56
+
57
+ # Enum
58
+ def ValuesLength(self):
59
+ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
60
+ if o != 0:
61
+ return self._tab.VectorLen(o)
62
+ return 0
63
+
64
+ # Enum
65
+ def ValuesIsNone(self):
66
+ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
67
+ return o == 0
68
+
69
+ # Enum
70
+ def IsUnion(self):
71
+ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
72
+ if o != 0:
73
+ return bool(
74
+ self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)
75
+ )
76
+ return False
77
+
78
+ # Enum
79
+ def UnderlyingType(self):
80
+ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
81
+ if o != 0:
82
+ x = self._tab.Indirect(o + self._tab.Pos)
83
+ from reflection.Type import Type
84
+
85
+ obj = Type()
86
+ obj.Init(self._tab.Bytes, x)
87
+ return obj
88
+ return None
89
+
90
+ # Enum
91
+ def Attributes(self, j):
92
+ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
93
+ if o != 0:
94
+ x = self._tab.Vector(o)
95
+ x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
96
+ x = self._tab.Indirect(x)
97
+ from reflection.KeyValue import KeyValue
98
+
99
+ obj = KeyValue()
100
+ obj.Init(self._tab.Bytes, x)
101
+ return obj
102
+ return None
103
+
104
+ # Enum
105
+ def AttributesLength(self):
106
+ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
107
+ if o != 0:
108
+ return self._tab.VectorLen(o)
109
+ return 0
110
+
111
+ # Enum
112
+ def AttributesIsNone(self):
113
+ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
114
+ return o == 0
115
+
116
+ # Enum
117
+ def Documentation(self, j):
118
+ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
119
+ if o != 0:
120
+ a = self._tab.Vector(o)
121
+ return self._tab.String(
122
+ a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4)
123
+ )
124
+ return ""
125
+
126
+ # Enum
127
+ def DocumentationLength(self):
128
+ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
129
+ if o != 0:
130
+ return self._tab.VectorLen(o)
131
+ return 0
132
+
133
+ # Enum
134
+ def DocumentationIsNone(self):
135
+ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
136
+ return o == 0
137
+
138
+ # File that this Enum is declared in.
139
+ # Enum
140
+ def DeclarationFile(self):
141
+ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
142
+ if o != 0:
143
+ return self._tab.String(o + self._tab.Pos)
144
+ return None
145
+
146
+
147
+ def EnumStart(builder):
148
+ builder.StartObject(7)
149
+
150
+
151
+ def Start(builder):
152
+ return EnumStart(builder)
153
+
154
+
155
+ def EnumAddName(builder, name):
156
+ builder.PrependUOffsetTRelativeSlot(
157
+ 0, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0
158
+ )
159
+
160
+
161
+ def AddName(builder, name):
162
+ return EnumAddName(builder, name)
163
+
164
+
165
+ def EnumAddValues(builder, values):
166
+ builder.PrependUOffsetTRelativeSlot(
167
+ 1, flatbuffers.number_types.UOffsetTFlags.py_type(values), 0
168
+ )
169
+
170
+
171
+ def AddValues(builder, values):
172
+ return EnumAddValues(builder, values)
173
+
174
+
175
+ def EnumStartValuesVector(builder, numElems):
176
+ return builder.StartVector(4, numElems, 4)
177
+
178
+
179
+ def StartValuesVector(builder, numElems):
180
+ return EnumStartValuesVector(builder, numElems)
181
+
182
+
183
+ def EnumAddIsUnion(builder, isUnion):
184
+ builder.PrependBoolSlot(2, isUnion, 0)
185
+
186
+
187
+ def AddIsUnion(builder, isUnion):
188
+ return EnumAddIsUnion(builder, isUnion)
189
+
190
+
191
+ def EnumAddUnderlyingType(builder, underlyingType):
192
+ builder.PrependUOffsetTRelativeSlot(
193
+ 3, flatbuffers.number_types.UOffsetTFlags.py_type(underlyingType), 0
194
+ )
195
+
196
+
197
+ def AddUnderlyingType(builder, underlyingType):
198
+ return EnumAddUnderlyingType(builder, underlyingType)
199
+
200
+
201
+ def EnumAddAttributes(builder, attributes):
202
+ builder.PrependUOffsetTRelativeSlot(
203
+ 4, flatbuffers.number_types.UOffsetTFlags.py_type(attributes), 0
204
+ )
205
+
206
+
207
+ def AddAttributes(builder, attributes):
208
+ return EnumAddAttributes(builder, attributes)
209
+
210
+
211
+ def EnumStartAttributesVector(builder, numElems):
212
+ return builder.StartVector(4, numElems, 4)
213
+
214
+
215
+ def StartAttributesVector(builder, numElems):
216
+ return EnumStartAttributesVector(builder, numElems)
217
+
218
+
219
+ def EnumAddDocumentation(builder, documentation):
220
+ builder.PrependUOffsetTRelativeSlot(
221
+ 5, flatbuffers.number_types.UOffsetTFlags.py_type(documentation), 0
222
+ )
223
+
224
+
225
+ def AddDocumentation(builder, documentation):
226
+ return EnumAddDocumentation(builder, documentation)
227
+
228
+
229
+ def EnumStartDocumentationVector(builder, numElems):
230
+ return builder.StartVector(4, numElems, 4)
231
+
232
+
233
+ def StartDocumentationVector(builder, numElems):
234
+ return EnumStartDocumentationVector(builder, numElems)
235
+
236
+
237
+ def EnumAddDeclarationFile(builder, declarationFile):
238
+ builder.PrependUOffsetTRelativeSlot(
239
+ 6, flatbuffers.number_types.UOffsetTFlags.py_type(declarationFile), 0
240
+ )
241
+
242
+
243
+ def AddDeclarationFile(builder, declarationFile):
244
+ return EnumAddDeclarationFile(builder, declarationFile)
245
+
246
+
247
+ def EnumEnd(builder):
248
+ return builder.EndObject()
249
+
250
+
251
+ def End(builder):
252
+ return EnumEnd(builder)
@@ -0,0 +1,144 @@
1
+ # automatically generated by the FlatBuffers compiler, do not modify
2
+
3
+ # namespace: reflection
4
+
5
+ import flatbuffers
6
+ from flatbuffers.compat import import_numpy
7
+
8
+ np = import_numpy()
9
+
10
+
11
+ class EnumVal(object):
12
+ __slots__ = ["_tab"]
13
+
14
+ @classmethod
15
+ def GetRootAs(cls, buf, offset=0):
16
+ n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
17
+ x = EnumVal()
18
+ x.Init(buf, n + offset)
19
+ return x
20
+
21
+ @classmethod
22
+ def GetRootAsEnumVal(cls, buf, offset=0):
23
+ """This method is deprecated. Please switch to GetRootAs."""
24
+ return cls.GetRootAs(buf, offset)
25
+
26
+ @classmethod
27
+ def EnumValBufferHasIdentifier(cls, buf, offset, size_prefixed=False):
28
+ return flatbuffers.util.BufferHasIdentifier(
29
+ buf, offset, b"\x42\x46\x42\x53", size_prefixed=size_prefixed
30
+ )
31
+
32
+ # EnumVal
33
+ def Init(self, buf, pos):
34
+ self._tab = flatbuffers.table.Table(buf, pos)
35
+
36
+ # EnumVal
37
+ def Name(self):
38
+ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
39
+ if o != 0:
40
+ return self._tab.String(o + self._tab.Pos)
41
+ return None
42
+
43
+ # EnumVal
44
+ def Value(self):
45
+ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
46
+ if o != 0:
47
+ return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
48
+ return 0
49
+
50
+ # EnumVal
51
+ def UnionType(self):
52
+ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
53
+ if o != 0:
54
+ x = self._tab.Indirect(o + self._tab.Pos)
55
+ from reflection.Type import Type
56
+
57
+ obj = Type()
58
+ obj.Init(self._tab.Bytes, x)
59
+ return obj
60
+ return None
61
+
62
+ # EnumVal
63
+ def Documentation(self, j):
64
+ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
65
+ if o != 0:
66
+ a = self._tab.Vector(o)
67
+ return self._tab.String(
68
+ a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4)
69
+ )
70
+ return ""
71
+
72
+ # EnumVal
73
+ def DocumentationLength(self):
74
+ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
75
+ if o != 0:
76
+ return self._tab.VectorLen(o)
77
+ return 0
78
+
79
+ # EnumVal
80
+ def DocumentationIsNone(self):
81
+ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
82
+ return o == 0
83
+
84
+
85
+ def EnumValStart(builder):
86
+ builder.StartObject(5)
87
+
88
+
89
+ def Start(builder):
90
+ return EnumValStart(builder)
91
+
92
+
93
+ def EnumValAddName(builder, name):
94
+ builder.PrependUOffsetTRelativeSlot(
95
+ 0, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0
96
+ )
97
+
98
+
99
+ def AddName(builder, name):
100
+ return EnumValAddName(builder, name)
101
+
102
+
103
+ def EnumValAddValue(builder, value):
104
+ builder.PrependInt64Slot(1, value, 0)
105
+
106
+
107
+ def AddValue(builder, value):
108
+ return EnumValAddValue(builder, value)
109
+
110
+
111
+ def EnumValAddUnionType(builder, unionType):
112
+ builder.PrependUOffsetTRelativeSlot(
113
+ 3, flatbuffers.number_types.UOffsetTFlags.py_type(unionType), 0
114
+ )
115
+
116
+
117
+ def AddUnionType(builder, unionType):
118
+ return EnumValAddUnionType(builder, unionType)
119
+
120
+
121
+ def EnumValAddDocumentation(builder, documentation):
122
+ builder.PrependUOffsetTRelativeSlot(
123
+ 4, flatbuffers.number_types.UOffsetTFlags.py_type(documentation), 0
124
+ )
125
+
126
+
127
+ def AddDocumentation(builder, documentation):
128
+ return EnumValAddDocumentation(builder, documentation)
129
+
130
+
131
+ def EnumValStartDocumentationVector(builder, numElems):
132
+ return builder.StartVector(4, numElems, 4)
133
+
134
+
135
+ def StartDocumentationVector(builder, numElems):
136
+ return EnumValStartDocumentationVector(builder, numElems)
137
+
138
+
139
+ def EnumValEnd(builder):
140
+ return builder.EndObject()
141
+
142
+
143
+ def End(builder):
144
+ return EnumValEnd(builder)