5b41f730adb20ea1f3ba43ed6fe44deef2c177ae
[platform/upstream/flatbuffers.git] / tests / namespace_test / NamespaceA / SecondTableInA.kt
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 SecondTableInA : Table() {
12
13     fun __init(_i: Int, _bb: ByteBuffer)  {
14         __reset(_i, _bb)
15     }
16     fun __assign(_i: Int, _bb: ByteBuffer) : SecondTableInA {
17         __init(_i, _bb)
18         return this
19     }
20     val referToC : NamespaceC.TableInC? get() = referToC(NamespaceC.TableInC())
21     fun referToC(obj: NamespaceC.TableInC) : NamespaceC.TableInC? {
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     companion object {
30         fun validateVersion() = Constants.FLATBUFFERS_1_12_0()
31         fun getRootAsSecondTableInA(_bb: ByteBuffer): SecondTableInA = getRootAsSecondTableInA(_bb, SecondTableInA())
32         fun getRootAsSecondTableInA(_bb: ByteBuffer, obj: SecondTableInA): SecondTableInA {
33             _bb.order(ByteOrder.LITTLE_ENDIAN)
34             return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb))
35         }
36         fun createSecondTableInA(builder: FlatBufferBuilder, referToCOffset: Int) : Int {
37             builder.startTable(1)
38             addReferToC(builder, referToCOffset)
39             return endSecondTableInA(builder)
40         }
41         fun startSecondTableInA(builder: FlatBufferBuilder) = builder.startTable(1)
42         fun addReferToC(builder: FlatBufferBuilder, referToC: Int) = builder.addOffset(0, referToC, 0)
43         fun endSecondTableInA(builder: FlatBufferBuilder) : Int {
44             val o = builder.endTable()
45             return o
46         }
47     }
48 }