Merge commit '0f6aab9da6fe982218a01f4a5b896e65fcced437' as 'third_party/flatbuffers'

This commit is contained in:
Siarhei Fedartsou
2024-06-22 13:33:34 +02:00
1814 changed files with 326902 additions and 0 deletions
@@ -0,0 +1,17 @@
--[[ MyGame.OtherNameSpace.FromInclude
Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop.
flatc version: 24.3.25
Declared by : //include_test/sub/include_test2.fbs
Rooting type : MyGame.Example.Monster (//monster_test.fbs)
--]]
local FromInclude = {
IncludeVal = 0,
}
return FromInclude
@@ -0,0 +1,12 @@
#[ MyGame.OtherNameSpace.FromInclude
Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop.
flatc version: 24.3.25
Declared by :
Rooting type : MyGame.Example.Monster ()
]#
type FromInclude*{.pure.} = enum
IncludeVal = 0.int64,
@@ -0,0 +1,51 @@
--[[ MyGame.OtherNameSpace.TableB
Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop.
flatc version: 24.3.25
Declared by : //include_test/sub/include_test2.fbs
Rooting type : MyGame.Example.Monster (//monster_test.fbs)
--]]
local __TableA = require('TableA')
local flatbuffers = require('flatbuffers')
local TableB = {}
local mt = {}
function TableB.New()
local o = {}
setmetatable(o, {__index = mt})
return o
end
function mt:Init(buf, pos)
self.view = flatbuffers.view.New(buf, pos)
end
function mt:A()
local o = self.view:Offset(4)
if o ~= 0 then
local x = self.view:Indirect(self.view.pos + o)
local obj = __TableA.New()
obj:Init(self.view.bytes, x)
return obj
end
end
function TableB.Start(builder)
builder:StartObject(1)
end
function TableB.AddA(builder, a)
builder:PrependStructSlot(0, a, 0)
end
function TableB.End(builder)
return builder:EndObject()
end
return TableB
@@ -0,0 +1,25 @@
#[ MyGame.OtherNameSpace.TableB
Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop.
flatc version: 24.3.25
Declared by :
Rooting type : MyGame.Example.Monster ()
]#
import ../../TableA as TableA
import flatbuffers
import std/options
type TableB* = object of FlatObj
func a*(self: TableB): Option[TableA.TableA] =
let o = self.tab.Offset(4)
if o != 0:
return some(TableA.TableA(tab: Vtable(Bytes: self.tab.Bytes, Pos: self.tab.Pos + o)))
proc TableBstart*(builder: var Builder) =
builder.StartObject(1)
proc TableBadda*(builder: var Builder, a: uoffset) =
builder.PrependStructSlot(0, a, default(uoffset))
proc TableBend*(builder: var Builder): uoffset =
return builder.EndObject()
@@ -0,0 +1,22 @@
// automatically generated by the FlatBuffers compiler, do not modify
package MyGame.OtherNameSpace;
import java.nio.*;
import java.lang.*;
import java.util.*;
import com.google.flatbuffers.*;
public class TableBT {
private TableAT a;
public TableAT getA() { return a; }
public void setA(TableAT a) { this.a = a; }
public TableBT() {
this.a = null;
}
}
@@ -0,0 +1,38 @@
--[[ MyGame.OtherNameSpace.Unused
Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop.
flatc version: 24.3.25
Declared by : //include_test/sub/include_test2.fbs
Rooting type : MyGame.Example.Monster (//monster_test.fbs)
--]]
local flatbuffers = require('flatbuffers')
local Unused = {}
local mt = {}
function Unused.New()
local o = {}
setmetatable(o, {__index = mt})
return o
end
function mt:Init(buf, pos)
self.view = flatbuffers.view.New(buf, pos)
end
function mt:A()
return self.view:Get(flatbuffers.N.Int32, self.view.pos + 0)
end
function Unused.CreateUnused(builder, a)
builder:Prep(4, 4)
builder:PrependInt32(a)
return builder:Offset()
end
return Unused
@@ -0,0 +1,21 @@
#[ MyGame.OtherNameSpace.Unused
Automatically generated by the FlatBuffers compiler, do not modify.
Or modify. I'm a message, not a cop.
flatc version: 24.3.25
Declared by :
Rooting type : MyGame.Example.Monster ()
]#
import flatbuffers
type Unused* = object of FlatObj
func a*(self: Unused): int32 =
return Get[int32](self.tab, self.tab.Pos + 0)
func `a=`*(self: var Unused, n: int32): bool =
return self.tab.Mutate(self.tab.Pos + 0, n)
proc UnusedCreate*(self: var Builder, a: int32): uoffset =
self.Prep(4, 4)
self.Prepend(a)
return self.Offset()
@@ -0,0 +1,22 @@
// automatically generated by the FlatBuffers compiler, do not modify
package MyGame.OtherNameSpace;
import java.nio.*;
import java.lang.*;
import java.util.*;
import com.google.flatbuffers.*;
public class UnusedT {
private int a;
public int getA() { return a; }
public void setA(int a) { this.a = a; }
public UnusedT() {
this.a = 0;
}
}