blob: cdecec674f8a262b6e45681711854f4303cf2c03 [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
Rob Elliott00a15db2023-08-17 14:27:06 +00006from flatbuffers.compat import import_numpy
7np = import_numpy()
Patrik Gustavsson8f1f9aa2021-06-28 07:41:58 +02008
9class CondIfAttribute(object):
10 __slots__ = ['_tab']
11
12 @classmethod
Rob Elliott00a15db2023-08-17 14:27:06 +000013 def GetRootAs(cls, buf, offset=0):
Patrik Gustavsson8f1f9aa2021-06-28 07:41:58 +020014 n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
15 x = CondIfAttribute()
16 x.Init(buf, n + offset)
17 return x
18
Rob Elliott00a15db2023-08-17 14:27:06 +000019 @classmethod
20 def GetRootAsCondIfAttribute(cls, buf, offset=0):
21 """This method is deprecated. Please switch to GetRootAs."""
22 return cls.GetRootAs(buf, offset)
23 @classmethod
24 def CondIfAttributeBufferHasIdentifier(cls, buf, offset, size_prefixed=False):
25 return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x54\x4F\x53\x41", size_prefixed=size_prefixed)
26
Patrik Gustavsson8f1f9aa2021-06-28 07:41:58 +020027 # CondIfAttribute
28 def Init(self, buf, pos):
29 self._tab = flatbuffers.table.Table(buf, pos)
30
31 # CondIfAttribute
32 def ThenBranch(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 # CondIfAttribute
39 def ElseBranch(self):
40 o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
41 if o != 0:
42 return self._tab.String(o + self._tab.Pos)
43 return None
44
Rob Elliott00a15db2023-08-17 14:27:06 +000045def CondIfAttributeStart(builder):
46 builder.StartObject(2)
47
48def Start(builder):
49 CondIfAttributeStart(builder)
50
51def CondIfAttributeAddThenBranch(builder, thenBranch):
52 builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(thenBranch), 0)
53
54def AddThenBranch(builder, thenBranch):
55 CondIfAttributeAddThenBranch(builder, thenBranch)
56
57def CondIfAttributeAddElseBranch(builder, elseBranch):
58 builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(elseBranch), 0)
59
60def AddElseBranch(builder, elseBranch):
61 CondIfAttributeAddElseBranch(builder, elseBranch)
62
63def CondIfAttributeEnd(builder):
64 return builder.EndObject()
65
66def End(builder):
67 return CondIfAttributeEnd(builder)