mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 20:15:34 +00:00
The code generator was assuming all declarations for the current file sit in the same namepace. Now uses the "on demand" namespace switching we had for the forward declarations. Also fixed a bug related to namespace lookup. Change-Id: Ib54a3efbc752cbb9590302fa0707c0c73448db3d Tested: on Linux.
28 lines
870 B
Python
28 lines
870 B
Python
# automatically generated, do not modify
|
|
|
|
# namespace: NamespaceA
|
|
|
|
import flatbuffers
|
|
|
|
class SecondTableInA(object):
|
|
__slots__ = ['_tab']
|
|
|
|
# SecondTableInA
|
|
def Init(self, buf, pos):
|
|
self._tab = flatbuffers.table.Table(buf, pos)
|
|
|
|
# SecondTableInA
|
|
def ReferToC(self):
|
|
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
|
|
if o != 0:
|
|
x = self._tab.Indirect(o + self._tab.Pos)
|
|
from .TableInC import TableInC
|
|
obj = TableInC()
|
|
obj.Init(self._tab.Bytes, x)
|
|
return obj
|
|
return None
|
|
|
|
def SecondTableInAStart(builder): builder.StartObject(1)
|
|
def SecondTableInAAddReferToC(builder, referToC): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(referToC), 0)
|
|
def SecondTableInAEnd(builder): return builder.EndObject()
|