blob: b953c124c4b796195398be1b7c4c552c08f920fa [file] [log] [blame]
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001-- automatically generated by the FlatBuffers compiler, do not modify
2
3-- namespace: NamespaceA
4
5local flatbuffers = require('flatbuffers')
6
7local SecondTableInA = {} -- the module
8local SecondTableInA_mt = {} -- the class metatable
9
10function SecondTableInA.New()
11 local o = {}
12 setmetatable(o, {__index = SecondTableInA_mt})
13 return o
14end
15function SecondTableInA.GetRootAsSecondTableInA(buf, offset)
James Kuszmaul8e62b022022-03-22 09:33:25 -070016 if type(buf) == "string" then
17 buf = flatbuffers.binaryArray.New(buf)
18 end
Austin Schuhe89fa2d2019-08-14 20:24:23 -070019 local n = flatbuffers.N.UOffsetT:Unpack(buf, offset)
20 local o = SecondTableInA.New()
21 o:Init(buf, n + offset)
22 return o
23end
24function SecondTableInA_mt:Init(buf, pos)
25 self.view = flatbuffers.view.New(buf, pos)
26end
27function 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
35end
36function SecondTableInA.Start(builder) builder:StartObject(1) end
37function SecondTableInA.AddReferToC(builder, referToC) builder:PrependUOffsetTRelativeSlot(0, referToC, 0) end
38function SecondTableInA.End(builder) return builder:EndObject() end
39
40return SecondTableInA -- return the module