blob: bb4fef04f6921216efc017c7ef7c6c6d22460e4d [file] [log] [blame]
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001-- automatically generated by the FlatBuffers compiler, do not modify
2
3-- namespace: NamespaceC
4
5local flatbuffers = require('flatbuffers')
6
7local TableInC = {} -- the module
8local TableInC_mt = {} -- the class metatable
9
10function TableInC.New()
11 local o = {}
12 setmetatable(o, {__index = TableInC_mt})
13 return o
14end
15function TableInC.GetRootAsTableInC(buf, offset)
16 local n = flatbuffers.N.UOffsetT:Unpack(buf, offset)
17 local o = TableInC.New()
18 o:Init(buf, n + offset)
19 return o
20end
21function TableInC_mt:Init(buf, pos)
22 self.view = flatbuffers.view.New(buf, pos)
23end
24function TableInC_mt:ReferToA1()
25 local o = self.view:Offset(4)
26 if o ~= 0 then
27 local x = self.view:Indirect(o + self.view.pos)
28 local obj = require('NamespaceA.TableInFirstNS').New()
29 obj:Init(self.view.bytes, x)
30 return obj
31 end
32end
33function TableInC_mt:ReferToA2()
34 local o = self.view:Offset(6)
35 if o ~= 0 then
36 local x = self.view:Indirect(o + self.view.pos)
37 local obj = require('NamespaceA.SecondTableInA').New()
38 obj:Init(self.view.bytes, x)
39 return obj
40 end
41end
42function TableInC.Start(builder) builder:StartObject(2) end
43function TableInC.AddReferToA1(builder, referToA1) builder:PrependUOffsetTRelativeSlot(0, referToA1, 0) end
44function TableInC.AddReferToA2(builder, referToA2) builder:PrependUOffsetTRelativeSlot(1, referToA2, 0) end
45function TableInC.End(builder) return builder:EndObject() end
46
47return TableInC -- return the module