blob: 32c8251d79faaffd724d065708acca87e8af51a0 [file] [log] [blame]
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001-- automatically generated by the FlatBuffers compiler, do not modify
2
3-- namespace: Example
4
5local flatbuffers = require('flatbuffers')
6
7local TestSimpleTableWithEnum = {} -- the module
8local TestSimpleTableWithEnum_mt = {} -- the class metatable
9
10function TestSimpleTableWithEnum.New()
11 local o = {}
12 setmetatable(o, {__index = TestSimpleTableWithEnum_mt})
13 return o
14end
15function TestSimpleTableWithEnum.GetRootAsTestSimpleTableWithEnum(buf, offset)
16 local n = flatbuffers.N.UOffsetT:Unpack(buf, offset)
17 local o = TestSimpleTableWithEnum.New()
18 o:Init(buf, n + offset)
19 return o
20end
21function TestSimpleTableWithEnum_mt:Init(buf, pos)
22 self.view = flatbuffers.view.New(buf, pos)
23end
24function TestSimpleTableWithEnum_mt:Color()
25 local o = self.view:Offset(4)
26 if o ~= 0 then
27 return self.view:Get(flatbuffers.N.Uint8, o + self.view.pos)
28 end
29 return 2
30end
31function TestSimpleTableWithEnum.Start(builder) builder:StartObject(1) end
32function TestSimpleTableWithEnum.AddColor(builder, color) builder:PrependUint8Slot(0, color, 2) end
33function TestSimpleTableWithEnum.End(builder) return builder:EndObject() end
34
35return TestSimpleTableWithEnum -- return the module