blob: af86203eeb856966a181eb7db8c96e1d6c1b62be [file] [log] [blame]
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001-- automatically generated by the FlatBuffers compiler, do not modify
2
3-- namespace: NamespaceB
4
5local flatbuffers = require('flatbuffers')
6
7local TableInNestedNS = {} -- the module
8local TableInNestedNS_mt = {} -- the class metatable
9
10function TableInNestedNS.New()
11 local o = {}
12 setmetatable(o, {__index = TableInNestedNS_mt})
13 return o
14end
15function TableInNestedNS.GetRootAsTableInNestedNS(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 = TableInNestedNS.New()
21 o:Init(buf, n + offset)
22 return o
23end
24function TableInNestedNS_mt:Init(buf, pos)
25 self.view = flatbuffers.view.New(buf, pos)
26end
27function TableInNestedNS_mt:Foo()
28 local o = self.view:Offset(4)
29 if o ~= 0 then
30 return self.view:Get(flatbuffers.N.Int32, o + self.view.pos)
31 end
32 return 0
33end
34function TableInNestedNS.Start(builder) builder:StartObject(1) end
35function TableInNestedNS.AddFoo(builder, foo) builder:PrependInt32Slot(0, foo, 0) end
36function TableInNestedNS.End(builder) return builder:EndObject() end
37
38return TableInNestedNS -- return the module