...

Text file src/github.com/google/flatbuffers/tests/union_vector/HandFan.kt

Documentation: github.com/google/flatbuffers/tests/union_vector

     1// automatically generated by the FlatBuffers compiler, do not modify
     2
     3import com.google.flatbuffers.BaseVector
     4import com.google.flatbuffers.BooleanVector
     5import com.google.flatbuffers.ByteVector
     6import com.google.flatbuffers.Constants
     7import com.google.flatbuffers.DoubleVector
     8import com.google.flatbuffers.FlatBufferBuilder
     9import com.google.flatbuffers.FloatVector
    10import com.google.flatbuffers.LongVector
    11import com.google.flatbuffers.StringVector
    12import com.google.flatbuffers.Struct
    13import com.google.flatbuffers.Table
    14import com.google.flatbuffers.UnionVector
    15import java.nio.ByteBuffer
    16import java.nio.ByteOrder
    17import kotlin.math.sign
    18
    19@Suppress("unused")
    20class HandFan : Table() {
    21
    22    fun __init(_i: Int, _bb: ByteBuffer)  {
    23        __reset(_i, _bb)
    24    }
    25    fun __assign(_i: Int, _bb: ByteBuffer) : HandFan {
    26        __init(_i, _bb)
    27        return this
    28    }
    29    val length : Int
    30        get() {
    31            val o = __offset(4)
    32            return if(o != 0) bb.getInt(o + bb_pos) else 0
    33        }
    34    fun mutateLength(length: Int) : Boolean {
    35        val o = __offset(4)
    36        return if (o != 0) {
    37            bb.putInt(o + bb_pos, length)
    38            true
    39        } else {
    40            false
    41        }
    42    }
    43    companion object {
    44        fun validateVersion() = Constants.FLATBUFFERS_23_5_26()
    45        fun getRootAsHandFan(_bb: ByteBuffer): HandFan = getRootAsHandFan(_bb, HandFan())
    46        fun getRootAsHandFan(_bb: ByteBuffer, obj: HandFan): HandFan {
    47            _bb.order(ByteOrder.LITTLE_ENDIAN)
    48            return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb))
    49        }
    50        fun createHandFan(builder: FlatBufferBuilder, length: Int) : Int {
    51            builder.startTable(1)
    52            addLength(builder, length)
    53            return endHandFan(builder)
    54        }
    55        fun startHandFan(builder: FlatBufferBuilder) = builder.startTable(1)
    56        fun addLength(builder: FlatBufferBuilder, length: Int) = builder.addInt(0, length, 0)
    57        fun endHandFan(builder: FlatBufferBuilder) : Int {
    58            val o = builder.endTable()
    59            return o
    60        }
    61    }
    62}

View as plain text