mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-08 14:15:17 +00:00
21 lines
622 B
Python
21 lines
622 B
Python
# automatically generated by the FlatBuffers compiler, do not modify
|
|
|
|
# namespace: union_name_test
|
|
|
|
class my_test_union(object):
|
|
NONE = 0
|
|
Foo = 1
|
|
Bar = 2
|
|
|
|
def MyTestUnionCreator(unionType, table):
|
|
from flatbuffers.table import Table
|
|
if not isinstance(table, Table):
|
|
return None
|
|
if unionType == my_test_union.Foo:
|
|
import union_name_test.Foo
|
|
return union_name_test.Foo.FooT.InitFromBuf(table.Bytes, table.Pos)
|
|
if unionType == my_test_union.Bar:
|
|
import union_name_test.Bar
|
|
return union_name_test.Bar.BarT.InitFromBuf(table.Bytes, table.Pos)
|
|
return None
|