Emit GetRootAs methods for all types in Go and Python

This commit is contained in:
Dan Ring
2015-11-21 19:49:33 -05:00
parent 5a401aef57
commit 1f8e3c13e6
7 changed files with 35 additions and 10 deletions

View File

@@ -7,6 +7,13 @@ import flatbuffers
class Stat(object):
__slots__ = ['_tab']
@classmethod
def GetRootAsStat(cls, buf, offset):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = Stat()
x.Init(buf, n + offset)
return x
# Stat
def Init(self, buf, pos):
self._tab = flatbuffers.table.Table(buf, pos)