// automatically generated by the FlatBuffers compiler, do not modify @file:OptIn(kotlin.ExperimentalUnsignedTypes::class) package link.roadio.riff.state.fbs import com.google.flatbuffers.kotlin.* import kotlin.jvm.JvmInline @Suppress("unused") class FileRef : Table() { fun init(i: Int, buffer: ReadWriteBuffer) : FileRef = reset(i, buffer) val kind : link.roadio.riff.state.fbs.FileKind get() = lookupField(4, link.roadio.riff.state.fbs.FileKind(0u) ) { link.roadio.riff.state.fbs.FileKind(bb.getUByte(it + bufferPos)) } val profileSlot : UByte get() = lookupField(6, 0u ) { bb.getUByte(it + bufferPos) } val generation : ULong get() = lookupField(8, 0UL ) { bb.getULong(it + bufferPos) } val objectId : ULong? get() = lookupField(10, null ) { bb.getULong(it + bufferPos) } val byteLength : ULong get() = lookupField(12, 0UL ) { bb.getULong(it + bufferPos) } val xxh364 : String? get() = lookupField(14, null ) { string(it + bufferPos) } fun xxh364AsBuffer() : ReadBuffer = vectorAsBuffer(bb, 14, 1) companion object { fun validateVersion() = VERSION_2_0_8 fun asRoot(buffer: ReadWriteBuffer) : FileRef = asRoot(buffer, FileRef()) fun asRoot(buffer: ReadWriteBuffer, obj: FileRef) : FileRef = obj.init(buffer.getInt(buffer.limit) + buffer.limit, buffer) fun createFileRef(builder: FlatBufferBuilder, kind: link.roadio.riff.state.fbs.FileKind, profileSlot: UByte, generation: ULong, objectId: ULong?, byteLength: ULong, xxh364Offset: Offset) : Offset { builder.startTable(6) addByteLength(builder, byteLength) objectId?.run { addObjectId(builder, objectId) } addGeneration(builder, generation) addXxh364(builder, xxh364Offset) addProfileSlot(builder, profileSlot) addKind(builder, kind) return endFileRef(builder) } fun startFileRef(builder: FlatBufferBuilder) = builder.startTable(6) fun addKind(builder: FlatBufferBuilder, kind: link.roadio.riff.state.fbs.FileKind) = builder.add(0, kind.value, 0u) fun addProfileSlot(builder: FlatBufferBuilder, profileSlot: UByte) = builder.add(1, profileSlot, 0u) fun addGeneration(builder: FlatBufferBuilder, generation: ULong) = builder.add(2, generation, 0UL) fun addObjectId(builder: FlatBufferBuilder, objectId: ULong) = builder.add(3, objectId, null) fun addByteLength(builder: FlatBufferBuilder, byteLength: ULong) = builder.add(4, byteLength, 0UL) fun addXxh364(builder: FlatBufferBuilder, xxh364: Offset) = builder.add(5, xxh364, 0) fun endFileRef(builder: FlatBufferBuilder) : Offset { val o: Offset = builder.endTable() builder.required(o, 14, "xxh3_64") return o } } } typealias FileRefOffsetArray = OffsetArray inline fun FileRefOffsetArray(size: Int, crossinline call: (Int) -> Offset): FileRefOffsetArray = FileRefOffsetArray(IntArray(size) { call(it).value })