• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1-- automatically generated by the FlatBuffers compiler, do not modify
2
3-- namespace: Example
4
5local flatbuffers = require('flatbuffers')
6
7local StructOfStructs = {} -- the module
8local StructOfStructs_mt = {} -- the class metatable
9
10function StructOfStructs.New()
11    local o = {}
12    setmetatable(o, {__index = StructOfStructs_mt})
13    return o
14end
15function StructOfStructs_mt:Init(buf, pos)
16    self.view = flatbuffers.view.New(buf, pos)
17end
18function StructOfStructs_mt:A(obj)
19    obj:Init(self.view.bytes, self.view.pos + 0)
20    return obj
21end
22function StructOfStructs_mt:B(obj)
23    obj:Init(self.view.bytes, self.view.pos + 8)
24    return obj
25end
26function StructOfStructs_mt:C(obj)
27    obj:Init(self.view.bytes, self.view.pos + 12)
28    return obj
29end
30function StructOfStructs.CreateStructOfStructs(builder, a_id, a_distance, b_a, b_b, c_id, c_distance)
31    builder:Prep(4, 20)
32    builder:Prep(4, 8)
33    builder:PrependUint32(c_distance)
34    builder:PrependUint32(c_id)
35    builder:Prep(2, 4)
36    builder:Pad(1)
37    builder:PrependInt8(b_b)
38    builder:PrependInt16(b_a)
39    builder:Prep(4, 8)
40    builder:PrependUint32(a_distance)
41    builder:PrependUint32(a_id)
42    return builder:Offset()
43end
44
45return StructOfStructs -- return the module