Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 1 | -- automatically generated by the FlatBuffers compiler, do not modify |
| 2 | |
| 3 | -- namespace: NamespaceA |
| 4 | |
| 5 | local flatbuffers = require('flatbuffers') |
| 6 | |
| 7 | local SecondTableInA = {} -- the module |
| 8 | local SecondTableInA_mt = {} -- the class metatable |
| 9 | |
| 10 | function SecondTableInA.New() |
| 11 | local o = {} |
| 12 | setmetatable(o, {__index = SecondTableInA_mt}) |
| 13 | return o |
| 14 | end |
| 15 | function SecondTableInA.GetRootAsSecondTableInA(buf, offset) |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame^] | 16 | if type(buf) == "string" then |
| 17 | buf = flatbuffers.binaryArray.New(buf) |
| 18 | end |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 19 | local n = flatbuffers.N.UOffsetT:Unpack(buf, offset) |
| 20 | local o = SecondTableInA.New() |
| 21 | o:Init(buf, n + offset) |
| 22 | return o |
| 23 | end |
| 24 | function SecondTableInA_mt:Init(buf, pos) |
| 25 | self.view = flatbuffers.view.New(buf, pos) |
| 26 | end |
| 27 | function SecondTableInA_mt:ReferToC() |
| 28 | local o = self.view:Offset(4) |
| 29 | if o ~= 0 then |
| 30 | local x = self.view:Indirect(o + self.view.pos) |
| 31 | local obj = require('NamespaceC.TableInC').New() |
| 32 | obj:Init(self.view.bytes, x) |
| 33 | return obj |
| 34 | end |
| 35 | end |
| 36 | function SecondTableInA.Start(builder) builder:StartObject(1) end |
| 37 | function SecondTableInA.AddReferToC(builder, referToC) builder:PrependUOffsetTRelativeSlot(0, referToC, 0) end |
| 38 | function SecondTableInA.End(builder) return builder:EndObject() end |
| 39 | |
| 40 | return SecondTableInA -- return the module |