• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# automatically generated by the FlatBuffers compiler, do not modify
2
3# namespace: NamespaceA
4
5import flatbuffers
6
7class TableInFirstNS(object):
8    __slots__ = ['_tab']
9
10    @classmethod
11    def GetRootAsTableInFirstNS(cls, buf, offset):
12        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13        x = TableInFirstNS()
14        x.Init(buf, n + offset)
15        return x
16
17    # TableInFirstNS
18    def Init(self, buf, pos):
19        self._tab = flatbuffers.table.Table(buf, pos)
20
21    # TableInFirstNS
22    def FooTable(self):
23        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
24        if o != 0:
25            x = self._tab.Indirect(o + self._tab.Pos)
26            from .TableInNestedNS import TableInNestedNS
27            obj = TableInNestedNS()
28            obj.Init(self._tab.Bytes, x)
29            return obj
30        return None
31
32    # TableInFirstNS
33    def FooEnum(self):
34        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
35        if o != 0:
36            return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
37        return 0
38
39    # TableInFirstNS
40    def FooStruct(self):
41        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
42        if o != 0:
43            x = o + self._tab.Pos
44            from .StructInNestedNS import StructInNestedNS
45            obj = StructInNestedNS()
46            obj.Init(self._tab.Bytes, x)
47            return obj
48        return None
49
50def TableInFirstNSStart(builder): builder.StartObject(3)
51def TableInFirstNSAddFooTable(builder, fooTable): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(fooTable), 0)
52def TableInFirstNSAddFooEnum(builder, fooEnum): builder.PrependInt8Slot(1, fooEnum, 0)
53def TableInFirstNSAddFooStruct(builder, fooStruct): builder.PrependStructSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(fooStruct), 0)
54def TableInFirstNSEnd(builder): return builder.EndObject()
55