blob: f54a44a8b16c46dcf62d8135b37a80d62d2eaf2c [file] [log] [blame]
Patrik Gustavsson8f1f9aa2021-06-28 07:41:58 +02001# automatically generated by the FlatBuffers compiler, do not modify
2
3# namespace: tosa
4
5import flatbuffers
6
7class TosaGraph(object):
8 __slots__ = ['_tab']
9
10 @classmethod
11 def GetRootAsTosaGraph(cls, buf, offset):
12 n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
13 x = TosaGraph()
14 x.Init(buf, n + offset)
15 return x
16
17 # TosaGraph
18 def Init(self, buf, pos):
19 self._tab = flatbuffers.table.Table(buf, pos)
20
21 # TosaGraph
22 def Version(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 .Version import Version
27 obj = Version()
28 obj.Init(self._tab.Bytes, x)
29 return obj
30 return None
31
32 # TosaGraph
33 def Blocks(self, j):
34 o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
35 if o != 0:
36 x = self._tab.Vector(o)
37 x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
38 x = self._tab.Indirect(x)
39 from .TosaBasicBlock import TosaBasicBlock
40 obj = TosaBasicBlock()
41 obj.Init(self._tab.Bytes, x)
42 return obj
43 return None
44
45 # TosaGraph
46 def BlocksLength(self):
47 o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
48 if o != 0:
49 return self._tab.VectorLen(o)
50 return 0
51
52def TosaGraphStart(builder): builder.StartObject(2)
53def TosaGraphAddVersion(builder, version): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(version), 0)
54def TosaGraphAddBlocks(builder, blocks): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(blocks), 0)
55def TosaGraphStartBlocksVector(builder, numElems): return builder.StartVector(4, numElems, 4)
56def TosaGraphEnd(builder): return builder.EndObject()