zlmdb 25.10.1__cp314-cp314-manylinux_2_34_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.
Potentially problematic release.
This version of zlmdb might be problematic. Click here for more details.
- flatbuffers/__init__.py +19 -0
- flatbuffers/_version.py +17 -0
- flatbuffers/builder.py +776 -0
- flatbuffers/compat.py +86 -0
- flatbuffers/encode.py +42 -0
- flatbuffers/flexbuffers.py +1527 -0
- flatbuffers/number_types.py +181 -0
- flatbuffers/packer.py +42 -0
- flatbuffers/reflection/AdvancedFeatures.py +10 -0
- flatbuffers/reflection/BaseType.py +24 -0
- flatbuffers/reflection/Enum.py +169 -0
- flatbuffers/reflection/EnumVal.py +96 -0
- flatbuffers/reflection/Field.py +208 -0
- flatbuffers/reflection/KeyValue.py +56 -0
- flatbuffers/reflection/Object.py +175 -0
- flatbuffers/reflection/RPCCall.py +131 -0
- flatbuffers/reflection/Schema.py +206 -0
- flatbuffers/reflection/SchemaFile.py +77 -0
- flatbuffers/reflection/Service.py +145 -0
- flatbuffers/reflection/Type.py +98 -0
- flatbuffers/reflection/__init__.py +0 -0
- flatbuffers/table.py +129 -0
- flatbuffers/util.py +43 -0
- zlmdb/__init__.py +312 -0
- zlmdb/_database.py +990 -0
- zlmdb/_errors.py +31 -0
- zlmdb/_meta.py +27 -0
- zlmdb/_pmap.py +1667 -0
- zlmdb/_schema.py +137 -0
- zlmdb/_transaction.py +181 -0
- zlmdb/_types.py +1596 -0
- zlmdb/_version.py +27 -0
- zlmdb/cli.py +41 -0
- zlmdb/flatbuffers/__init__.py +5 -0
- zlmdb/flatbuffers/reflection/AdvancedFeatures.py +10 -0
- zlmdb/flatbuffers/reflection/BaseType.py +25 -0
- zlmdb/flatbuffers/reflection/Enum.py +252 -0
- zlmdb/flatbuffers/reflection/EnumVal.py +144 -0
- zlmdb/flatbuffers/reflection/Field.py +325 -0
- zlmdb/flatbuffers/reflection/KeyValue.py +84 -0
- zlmdb/flatbuffers/reflection/Object.py +260 -0
- zlmdb/flatbuffers/reflection/RPCCall.py +195 -0
- zlmdb/flatbuffers/reflection/Schema.py +301 -0
- zlmdb/flatbuffers/reflection/SchemaFile.py +112 -0
- zlmdb/flatbuffers/reflection/Service.py +213 -0
- zlmdb/flatbuffers/reflection/Type.py +148 -0
- zlmdb/flatbuffers/reflection/__init__.py +0 -0
- zlmdb/flatbuffers/reflection.fbs +152 -0
- zlmdb/lmdb/__init__.py +37 -0
- zlmdb/lmdb/__main__.py +25 -0
- zlmdb/lmdb/_config.py +10 -0
- zlmdb/lmdb/_lmdb_cffi.cpython-314-x86_64-linux-gnu.so +0 -0
- zlmdb/lmdb/cffi.py +2606 -0
- zlmdb/lmdb/tool.py +670 -0
- zlmdb/tests/lmdb/__init__.py +0 -0
- zlmdb/tests/lmdb/address_book.py +287 -0
- zlmdb/tests/lmdb/crash_test.py +339 -0
- zlmdb/tests/lmdb/cursor_test.py +333 -0
- zlmdb/tests/lmdb/env_test.py +919 -0
- zlmdb/tests/lmdb/getmulti_test.py +92 -0
- zlmdb/tests/lmdb/iteration_test.py +258 -0
- zlmdb/tests/lmdb/package_test.py +70 -0
- zlmdb/tests/lmdb/test_lmdb.py +188 -0
- zlmdb/tests/lmdb/testlib.py +185 -0
- zlmdb/tests/lmdb/tool_test.py +60 -0
- zlmdb/tests/lmdb/txn_test.py +575 -0
- zlmdb/tests/orm/MNodeLog.py +853 -0
- zlmdb/tests/orm/__init__.py +0 -0
- zlmdb/tests/orm/_schema_fbs.py +215 -0
- zlmdb/tests/orm/_schema_mnode_log.py +1201 -0
- zlmdb/tests/orm/_schema_py2.py +250 -0
- zlmdb/tests/orm/_schema_py3.py +307 -0
- zlmdb/tests/orm/_test_flatbuffers.py +144 -0
- zlmdb/tests/orm/_test_serialization.py +144 -0
- zlmdb/tests/orm/test_basic.py +217 -0
- zlmdb/tests/orm/test_etcd.py +275 -0
- zlmdb/tests/orm/test_pmap_indexes.py +466 -0
- zlmdb/tests/orm/test_pmap_types.py +90 -0
- zlmdb/tests/orm/test_pmaps.py +295 -0
- zlmdb/tests/orm/test_select.py +619 -0
- zlmdb-25.10.1.dist-info/METADATA +264 -0
- zlmdb-25.10.1.dist-info/RECORD +87 -0
- zlmdb-25.10.1.dist-info/WHEEL +5 -0
- zlmdb-25.10.1.dist-info/entry_points.txt +2 -0
- zlmdb-25.10.1.dist-info/licenses/LICENSE +137 -0
- zlmdb-25.10.1.dist-info/licenses/NOTICE +41 -0
- zlmdb-25.10.1.dist-info/top_level.txt +2 -0
|
@@ -0,0 +1,181 @@
|
|
|
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
|
+
class BoolFlags(object):
|
|
30
|
+
bytewidth = 1
|
|
31
|
+
min_val = False
|
|
32
|
+
max_val = True
|
|
33
|
+
py_type = bool
|
|
34
|
+
name = "bool"
|
|
35
|
+
packer_type = packer.boolean
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class Uint8Flags(object):
|
|
39
|
+
bytewidth = 1
|
|
40
|
+
min_val = 0
|
|
41
|
+
max_val = (2**8) - 1
|
|
42
|
+
py_type = int
|
|
43
|
+
name = "uint8"
|
|
44
|
+
packer_type = packer.uint8
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class Uint16Flags(object):
|
|
48
|
+
bytewidth = 2
|
|
49
|
+
min_val = 0
|
|
50
|
+
max_val = (2**16) - 1
|
|
51
|
+
py_type = int
|
|
52
|
+
name = "uint16"
|
|
53
|
+
packer_type = packer.uint16
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
class Uint32Flags(object):
|
|
57
|
+
bytewidth = 4
|
|
58
|
+
min_val = 0
|
|
59
|
+
max_val = (2**32) - 1
|
|
60
|
+
py_type = int
|
|
61
|
+
name = "uint32"
|
|
62
|
+
packer_type = packer.uint32
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
class Uint64Flags(object):
|
|
66
|
+
bytewidth = 8
|
|
67
|
+
min_val = 0
|
|
68
|
+
max_val = (2**64) - 1
|
|
69
|
+
py_type = int
|
|
70
|
+
name = "uint64"
|
|
71
|
+
packer_type = packer.uint64
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
class Int8Flags(object):
|
|
75
|
+
bytewidth = 1
|
|
76
|
+
min_val = -(2**7)
|
|
77
|
+
max_val = (2**7) - 1
|
|
78
|
+
py_type = int
|
|
79
|
+
name = "int8"
|
|
80
|
+
packer_type = packer.int8
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
class Int16Flags(object):
|
|
84
|
+
bytewidth = 2
|
|
85
|
+
min_val = -(2**15)
|
|
86
|
+
max_val = (2**15) - 1
|
|
87
|
+
py_type = int
|
|
88
|
+
name = "int16"
|
|
89
|
+
packer_type = packer.int16
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
class Int32Flags(object):
|
|
93
|
+
bytewidth = 4
|
|
94
|
+
min_val = -(2**31)
|
|
95
|
+
max_val = (2**31) - 1
|
|
96
|
+
py_type = int
|
|
97
|
+
name = "int32"
|
|
98
|
+
packer_type = packer.int32
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
class Int64Flags(object):
|
|
102
|
+
bytewidth = 8
|
|
103
|
+
min_val = -(2**63)
|
|
104
|
+
max_val = (2**63) - 1
|
|
105
|
+
py_type = int
|
|
106
|
+
name = "int64"
|
|
107
|
+
packer_type = packer.int64
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
class Float32Flags(object):
|
|
111
|
+
bytewidth = 4
|
|
112
|
+
min_val = None
|
|
113
|
+
max_val = None
|
|
114
|
+
py_type = float
|
|
115
|
+
name = "float32"
|
|
116
|
+
packer_type = packer.float32
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
class Float64Flags(object):
|
|
120
|
+
bytewidth = 8
|
|
121
|
+
min_val = None
|
|
122
|
+
max_val = None
|
|
123
|
+
py_type = float
|
|
124
|
+
name = "float64"
|
|
125
|
+
packer_type = packer.float64
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
class SOffsetTFlags(Int32Flags):
|
|
129
|
+
pass
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
class UOffsetTFlags(Uint32Flags):
|
|
133
|
+
pass
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
class VOffsetTFlags(Uint16Flags):
|
|
137
|
+
pass
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
def valid_number(n, flags):
|
|
141
|
+
if flags.min_val is None and flags.max_val is None:
|
|
142
|
+
return True
|
|
143
|
+
return flags.min_val <= n <= flags.max_val
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
def enforce_number(n, flags):
|
|
147
|
+
if flags.min_val is None and flags.max_val is None:
|
|
148
|
+
return
|
|
149
|
+
if not flags.min_val <= n <= flags.max_val:
|
|
150
|
+
raise TypeError("bad number %s for type %s" % (str(n), flags.name))
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
def float32_to_uint32(n):
|
|
154
|
+
packed = struct.pack("<1f", n)
|
|
155
|
+
(converted,) = struct.unpack("<1L", packed)
|
|
156
|
+
return converted
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def uint32_to_float32(n):
|
|
160
|
+
packed = struct.pack("<1L", n)
|
|
161
|
+
(unpacked,) = struct.unpack("<1f", packed)
|
|
162
|
+
return unpacked
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
def float64_to_uint64(n):
|
|
166
|
+
packed = struct.pack("<1d", n)
|
|
167
|
+
(converted,) = struct.unpack("<1Q", packed)
|
|
168
|
+
return converted
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
def uint64_to_float64(n):
|
|
172
|
+
packed = struct.pack("<1Q", n)
|
|
173
|
+
(unpacked,) = struct.unpack("<1d", packed)
|
|
174
|
+
return unpacked
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
def to_numpy_type(number_type):
|
|
178
|
+
if np is not None:
|
|
179
|
+
return np.dtype(number_type.name).newbyteorder('<')
|
|
180
|
+
else:
|
|
181
|
+
raise NumpyRequiredForThisFeature('Numpy was not found.')
|
flatbuffers/packer.py
ADDED
|
@@ -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,24 @@
|
|
|
1
|
+
# automatically generated by the FlatBuffers compiler, do not modify
|
|
2
|
+
|
|
3
|
+
# namespace: reflection
|
|
4
|
+
|
|
5
|
+
class BaseType(object):
|
|
6
|
+
None_ = 0
|
|
7
|
+
UType = 1
|
|
8
|
+
Bool = 2
|
|
9
|
+
Byte = 3
|
|
10
|
+
UByte = 4
|
|
11
|
+
Short = 5
|
|
12
|
+
UShort = 6
|
|
13
|
+
Int = 7
|
|
14
|
+
UInt = 8
|
|
15
|
+
Long = 9
|
|
16
|
+
ULong = 10
|
|
17
|
+
Float = 11
|
|
18
|
+
Double = 12
|
|
19
|
+
String = 13
|
|
20
|
+
Vector = 14
|
|
21
|
+
Obj = 15
|
|
22
|
+
Union = 16
|
|
23
|
+
Array = 17
|
|
24
|
+
MaxBaseType = 18
|
|
@@ -0,0 +1,169 @@
|
|
|
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
|
+
np = import_numpy()
|
|
8
|
+
|
|
9
|
+
class Enum(object):
|
|
10
|
+
__slots__ = ['_tab']
|
|
11
|
+
|
|
12
|
+
@classmethod
|
|
13
|
+
def GetRootAs(cls, buf, offset=0):
|
|
14
|
+
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
|
15
|
+
x = Enum()
|
|
16
|
+
x.Init(buf, n + offset)
|
|
17
|
+
return x
|
|
18
|
+
|
|
19
|
+
@classmethod
|
|
20
|
+
def GetRootAsEnum(cls, buf, offset=0):
|
|
21
|
+
"""This method is deprecated. Please switch to GetRootAs."""
|
|
22
|
+
return cls.GetRootAs(buf, offset)
|
|
23
|
+
@classmethod
|
|
24
|
+
def EnumBufferHasIdentifier(cls, buf, offset, size_prefixed=False):
|
|
25
|
+
return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x42\x46\x42\x53", size_prefixed=size_prefixed)
|
|
26
|
+
|
|
27
|
+
# Enum
|
|
28
|
+
def Init(self, buf, pos):
|
|
29
|
+
self._tab = flatbuffers.table.Table(buf, pos)
|
|
30
|
+
|
|
31
|
+
# Enum
|
|
32
|
+
def Name(self):
|
|
33
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
|
34
|
+
if o != 0:
|
|
35
|
+
return self._tab.String(o + self._tab.Pos)
|
|
36
|
+
return None
|
|
37
|
+
|
|
38
|
+
# Enum
|
|
39
|
+
def Values(self, j):
|
|
40
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
|
41
|
+
if o != 0:
|
|
42
|
+
x = self._tab.Vector(o)
|
|
43
|
+
x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
|
|
44
|
+
x = self._tab.Indirect(x)
|
|
45
|
+
from reflection.EnumVal import EnumVal
|
|
46
|
+
obj = EnumVal()
|
|
47
|
+
obj.Init(self._tab.Bytes, x)
|
|
48
|
+
return obj
|
|
49
|
+
return None
|
|
50
|
+
|
|
51
|
+
# Enum
|
|
52
|
+
def ValuesLength(self):
|
|
53
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
|
54
|
+
if o != 0:
|
|
55
|
+
return self._tab.VectorLen(o)
|
|
56
|
+
return 0
|
|
57
|
+
|
|
58
|
+
# Enum
|
|
59
|
+
def ValuesIsNone(self):
|
|
60
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
|
61
|
+
return o == 0
|
|
62
|
+
|
|
63
|
+
# Enum
|
|
64
|
+
def IsUnion(self):
|
|
65
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
|
|
66
|
+
if o != 0:
|
|
67
|
+
return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
|
|
68
|
+
return False
|
|
69
|
+
|
|
70
|
+
# Enum
|
|
71
|
+
def UnderlyingType(self):
|
|
72
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
|
|
73
|
+
if o != 0:
|
|
74
|
+
x = self._tab.Indirect(o + self._tab.Pos)
|
|
75
|
+
from reflection.Type import Type
|
|
76
|
+
obj = Type()
|
|
77
|
+
obj.Init(self._tab.Bytes, x)
|
|
78
|
+
return obj
|
|
79
|
+
return None
|
|
80
|
+
|
|
81
|
+
# Enum
|
|
82
|
+
def Attributes(self, j):
|
|
83
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
|
|
84
|
+
if o != 0:
|
|
85
|
+
x = self._tab.Vector(o)
|
|
86
|
+
x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
|
|
87
|
+
x = self._tab.Indirect(x)
|
|
88
|
+
from reflection.KeyValue import KeyValue
|
|
89
|
+
obj = KeyValue()
|
|
90
|
+
obj.Init(self._tab.Bytes, x)
|
|
91
|
+
return obj
|
|
92
|
+
return None
|
|
93
|
+
|
|
94
|
+
# Enum
|
|
95
|
+
def AttributesLength(self):
|
|
96
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
|
|
97
|
+
if o != 0:
|
|
98
|
+
return self._tab.VectorLen(o)
|
|
99
|
+
return 0
|
|
100
|
+
|
|
101
|
+
# Enum
|
|
102
|
+
def AttributesIsNone(self):
|
|
103
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
|
|
104
|
+
return o == 0
|
|
105
|
+
|
|
106
|
+
# Enum
|
|
107
|
+
def Documentation(self, j):
|
|
108
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
|
|
109
|
+
if o != 0:
|
|
110
|
+
a = self._tab.Vector(o)
|
|
111
|
+
return self._tab.String(a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
|
|
112
|
+
return ""
|
|
113
|
+
|
|
114
|
+
# Enum
|
|
115
|
+
def DocumentationLength(self):
|
|
116
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
|
|
117
|
+
if o != 0:
|
|
118
|
+
return self._tab.VectorLen(o)
|
|
119
|
+
return 0
|
|
120
|
+
|
|
121
|
+
# Enum
|
|
122
|
+
def DocumentationIsNone(self):
|
|
123
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
|
|
124
|
+
return o == 0
|
|
125
|
+
|
|
126
|
+
# File that this Enum is declared in.
|
|
127
|
+
# Enum
|
|
128
|
+
def DeclarationFile(self):
|
|
129
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
|
|
130
|
+
if o != 0:
|
|
131
|
+
return self._tab.String(o + self._tab.Pos)
|
|
132
|
+
return None
|
|
133
|
+
|
|
134
|
+
def EnumStart(builder): builder.StartObject(7)
|
|
135
|
+
def Start(builder):
|
|
136
|
+
return EnumStart(builder)
|
|
137
|
+
def EnumAddName(builder, name): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0)
|
|
138
|
+
def AddName(builder, name):
|
|
139
|
+
return EnumAddName(builder, name)
|
|
140
|
+
def EnumAddValues(builder, values): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(values), 0)
|
|
141
|
+
def AddValues(builder, values):
|
|
142
|
+
return EnumAddValues(builder, values)
|
|
143
|
+
def EnumStartValuesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
|
|
144
|
+
def StartValuesVector(builder, numElems):
|
|
145
|
+
return EnumStartValuesVector(builder, numElems)
|
|
146
|
+
def EnumAddIsUnion(builder, isUnion): builder.PrependBoolSlot(2, isUnion, 0)
|
|
147
|
+
def AddIsUnion(builder, isUnion):
|
|
148
|
+
return EnumAddIsUnion(builder, isUnion)
|
|
149
|
+
def EnumAddUnderlyingType(builder, underlyingType): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(underlyingType), 0)
|
|
150
|
+
def AddUnderlyingType(builder, underlyingType):
|
|
151
|
+
return EnumAddUnderlyingType(builder, underlyingType)
|
|
152
|
+
def EnumAddAttributes(builder, attributes): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(attributes), 0)
|
|
153
|
+
def AddAttributes(builder, attributes):
|
|
154
|
+
return EnumAddAttributes(builder, attributes)
|
|
155
|
+
def EnumStartAttributesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
|
|
156
|
+
def StartAttributesVector(builder, numElems):
|
|
157
|
+
return EnumStartAttributesVector(builder, numElems)
|
|
158
|
+
def EnumAddDocumentation(builder, documentation): builder.PrependUOffsetTRelativeSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(documentation), 0)
|
|
159
|
+
def AddDocumentation(builder, documentation):
|
|
160
|
+
return EnumAddDocumentation(builder, documentation)
|
|
161
|
+
def EnumStartDocumentationVector(builder, numElems): return builder.StartVector(4, numElems, 4)
|
|
162
|
+
def StartDocumentationVector(builder, numElems):
|
|
163
|
+
return EnumStartDocumentationVector(builder, numElems)
|
|
164
|
+
def EnumAddDeclarationFile(builder, declarationFile): builder.PrependUOffsetTRelativeSlot(6, flatbuffers.number_types.UOffsetTFlags.py_type(declarationFile), 0)
|
|
165
|
+
def AddDeclarationFile(builder, declarationFile):
|
|
166
|
+
return EnumAddDeclarationFile(builder, declarationFile)
|
|
167
|
+
def EnumEnd(builder): return builder.EndObject()
|
|
168
|
+
def End(builder):
|
|
169
|
+
return EnumEnd(builder)
|
|
@@ -0,0 +1,96 @@
|
|
|
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
|
+
np = import_numpy()
|
|
8
|
+
|
|
9
|
+
class EnumVal(object):
|
|
10
|
+
__slots__ = ['_tab']
|
|
11
|
+
|
|
12
|
+
@classmethod
|
|
13
|
+
def GetRootAs(cls, buf, offset=0):
|
|
14
|
+
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
|
|
15
|
+
x = EnumVal()
|
|
16
|
+
x.Init(buf, n + offset)
|
|
17
|
+
return x
|
|
18
|
+
|
|
19
|
+
@classmethod
|
|
20
|
+
def GetRootAsEnumVal(cls, buf, offset=0):
|
|
21
|
+
"""This method is deprecated. Please switch to GetRootAs."""
|
|
22
|
+
return cls.GetRootAs(buf, offset)
|
|
23
|
+
@classmethod
|
|
24
|
+
def EnumValBufferHasIdentifier(cls, buf, offset, size_prefixed=False):
|
|
25
|
+
return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x42\x46\x42\x53", size_prefixed=size_prefixed)
|
|
26
|
+
|
|
27
|
+
# EnumVal
|
|
28
|
+
def Init(self, buf, pos):
|
|
29
|
+
self._tab = flatbuffers.table.Table(buf, pos)
|
|
30
|
+
|
|
31
|
+
# EnumVal
|
|
32
|
+
def Name(self):
|
|
33
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
|
34
|
+
if o != 0:
|
|
35
|
+
return self._tab.String(o + self._tab.Pos)
|
|
36
|
+
return None
|
|
37
|
+
|
|
38
|
+
# EnumVal
|
|
39
|
+
def Value(self):
|
|
40
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
|
|
41
|
+
if o != 0:
|
|
42
|
+
return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
|
|
43
|
+
return 0
|
|
44
|
+
|
|
45
|
+
# EnumVal
|
|
46
|
+
def UnionType(self):
|
|
47
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
|
|
48
|
+
if o != 0:
|
|
49
|
+
x = self._tab.Indirect(o + self._tab.Pos)
|
|
50
|
+
from reflection.Type import Type
|
|
51
|
+
obj = Type()
|
|
52
|
+
obj.Init(self._tab.Bytes, x)
|
|
53
|
+
return obj
|
|
54
|
+
return None
|
|
55
|
+
|
|
56
|
+
# EnumVal
|
|
57
|
+
def Documentation(self, j):
|
|
58
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
|
|
59
|
+
if o != 0:
|
|
60
|
+
a = self._tab.Vector(o)
|
|
61
|
+
return self._tab.String(a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
|
|
62
|
+
return ""
|
|
63
|
+
|
|
64
|
+
# EnumVal
|
|
65
|
+
def DocumentationLength(self):
|
|
66
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
|
|
67
|
+
if o != 0:
|
|
68
|
+
return self._tab.VectorLen(o)
|
|
69
|
+
return 0
|
|
70
|
+
|
|
71
|
+
# EnumVal
|
|
72
|
+
def DocumentationIsNone(self):
|
|
73
|
+
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
|
|
74
|
+
return o == 0
|
|
75
|
+
|
|
76
|
+
def EnumValStart(builder): builder.StartObject(5)
|
|
77
|
+
def Start(builder):
|
|
78
|
+
return EnumValStart(builder)
|
|
79
|
+
def EnumValAddName(builder, name): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0)
|
|
80
|
+
def AddName(builder, name):
|
|
81
|
+
return EnumValAddName(builder, name)
|
|
82
|
+
def EnumValAddValue(builder, value): builder.PrependInt64Slot(1, value, 0)
|
|
83
|
+
def AddValue(builder, value):
|
|
84
|
+
return EnumValAddValue(builder, value)
|
|
85
|
+
def EnumValAddUnionType(builder, unionType): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(unionType), 0)
|
|
86
|
+
def AddUnionType(builder, unionType):
|
|
87
|
+
return EnumValAddUnionType(builder, unionType)
|
|
88
|
+
def EnumValAddDocumentation(builder, documentation): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(documentation), 0)
|
|
89
|
+
def AddDocumentation(builder, documentation):
|
|
90
|
+
return EnumValAddDocumentation(builder, documentation)
|
|
91
|
+
def EnumValStartDocumentationVector(builder, numElems): return builder.StartVector(4, numElems, 4)
|
|
92
|
+
def StartDocumentationVector(builder, numElems):
|
|
93
|
+
return EnumValStartDocumentationVector(builder, numElems)
|
|
94
|
+
def EnumValEnd(builder): return builder.EndObject()
|
|
95
|
+
def End(builder):
|
|
96
|
+
return EnumValEnd(builder)
|