1# automatically generated by the FlatBuffers compiler, do not modify 2 3# namespace: Example 4 5import flatbuffers 6 7class TestSimpleTableWithEnum(object): 8 __slots__ = ['_tab'] 9 10 @classmethod 11 def GetRootAsTestSimpleTableWithEnum(cls, buf, offset): 12 n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) 13 x = TestSimpleTableWithEnum() 14 x.Init(buf, n + offset) 15 return x 16 17 # TestSimpleTableWithEnum 18 def Init(self, buf, pos): 19 self._tab = flatbuffers.table.Table(buf, pos) 20 21 # TestSimpleTableWithEnum 22 def Color(self): 23 o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) 24 if o != 0: 25 return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos) 26 return 2 27 28def TestSimpleTableWithEnumStart(builder): builder.StartObject(1) 29def TestSimpleTableWithEnumAddColor(builder, color): builder.PrependInt8Slot(0, color, 2) 30def TestSimpleTableWithEnumEnd(builder): return builder.EndObject() 31