Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame^] | 1 | // automatically generated by the FlatBuffers compiler, do not modify |
| 2 | |
| 3 | package NamespaceA |
| 4 | |
| 5 | import java.nio.* |
| 6 | import kotlin.math.sign |
| 7 | import com.google.flatbuffers.* |
| 8 | |
| 9 | @Suppress("unused") |
| 10 | @ExperimentalUnsignedTypes |
| 11 | class TableInFirstNS : Table() { |
| 12 | |
| 13 | fun __init(_i: Int, _bb: ByteBuffer) { |
| 14 | __reset(_i, _bb) |
| 15 | } |
| 16 | fun __assign(_i: Int, _bb: ByteBuffer) : TableInFirstNS { |
| 17 | __init(_i, _bb) |
| 18 | return this |
| 19 | } |
| 20 | val fooTable : NamespaceA.NamespaceB.TableInNestedNS? get() = fooTable(NamespaceA.NamespaceB.TableInNestedNS()) |
| 21 | fun fooTable(obj: NamespaceA.NamespaceB.TableInNestedNS) : NamespaceA.NamespaceB.TableInNestedNS? { |
| 22 | val o = __offset(4) |
| 23 | return if (o != 0) { |
| 24 | obj.__assign(__indirect(o + bb_pos), bb) |
| 25 | } else { |
| 26 | null |
| 27 | } |
| 28 | } |
| 29 | val fooEnum : Byte |
| 30 | get() { |
| 31 | val o = __offset(6) |
| 32 | return if(o != 0) bb.get(o + bb_pos) else 0 |
| 33 | } |
| 34 | fun mutateFooEnum(fooEnum: Byte) : Boolean { |
| 35 | val o = __offset(6) |
| 36 | return if (o != 0) { |
| 37 | bb.put(o + bb_pos, fooEnum) |
| 38 | true |
| 39 | } else { |
| 40 | false |
| 41 | } |
| 42 | } |
| 43 | val fooStruct : NamespaceA.NamespaceB.StructInNestedNS? get() = fooStruct(NamespaceA.NamespaceB.StructInNestedNS()) |
| 44 | fun fooStruct(obj: NamespaceA.NamespaceB.StructInNestedNS) : NamespaceA.NamespaceB.StructInNestedNS? { |
| 45 | val o = __offset(8) |
| 46 | return if (o != 0) { |
| 47 | obj.__assign(o + bb_pos, bb) |
| 48 | } else { |
| 49 | null |
| 50 | } |
| 51 | } |
| 52 | companion object { |
| 53 | fun validateVersion() = Constants.FLATBUFFERS_1_11_1() |
| 54 | fun getRootAsTableInFirstNS(_bb: ByteBuffer): TableInFirstNS = getRootAsTableInFirstNS(_bb, TableInFirstNS()) |
| 55 | fun getRootAsTableInFirstNS(_bb: ByteBuffer, obj: TableInFirstNS): TableInFirstNS { |
| 56 | _bb.order(ByteOrder.LITTLE_ENDIAN) |
| 57 | return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)) |
| 58 | } |
| 59 | fun startTableInFirstNS(builder: FlatBufferBuilder) = builder.startTable(3) |
| 60 | fun addFooTable(builder: FlatBufferBuilder, fooTable: Int) = builder.addOffset(0, fooTable, 0) |
| 61 | fun addFooEnum(builder: FlatBufferBuilder, fooEnum: Byte) = builder.addByte(1, fooEnum, 0) |
| 62 | fun addFooStruct(builder: FlatBufferBuilder, fooStruct: Int) = builder.addStruct(2, fooStruct, 0) |
| 63 | fun endTableInFirstNS(builder: FlatBufferBuilder) : Int { |
| 64 | val o = builder.endTable() |
| 65 | return o |
| 66 | } |
| 67 | } |
| 68 | } |