blob: 154067bffb8bac5a35bcce0b6b756035e5939784 [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 Test = {} -- the module
8local Test_mt = {} -- the class metatable
9
10function Test.New()
11 local o = {}
12 setmetatable(o, {__index = Test_mt})
13 return o
14end
15function Test_mt:Init(buf, pos)
16 self.view = flatbuffers.view.New(buf, pos)
17end
18function Test_mt:A()
19 return self.view:Get(flatbuffers.N.Int16, self.view.pos + 0)
20end
21function Test_mt:B()
22 return self.view:Get(flatbuffers.N.Int8, self.view.pos + 2)
23end
24function Test.CreateTest(builder, a, b)
25 builder:Prep(2, 4)
26 builder:Pad(1)
27 builder:PrependInt8(b)
28 builder:PrependInt16(a)
29 return builder:Offset()
30end
31
32return Test -- return the module