Added missing Kotlin generated code change.

Change-Id: I7eeee6519b6dc619691437e44272cf5424d0d4ca
This commit is contained in:
Wouter van Oortmerssen 2019-07-25 11:08:06 -07:00
parent a0c0131e36
commit d4fa984f1d
1 changed files with 138 additions and 106 deletions

View File

@ -17,131 +17,159 @@ class MonsterExtra : Table() {
__init(_i, _bb) __init(_i, _bb)
return this return this
} }
val testfNan : Float val d0 : Double
get() { get() {
val o = __offset(4) val o = __offset(4)
return if(o != 0) bb.getFloat(o + bb_pos) else Float.NaN
}
fun mutateTestfNan(testfNan: Float) : Boolean {
val o = __offset(4)
return if (o != 0) {
bb.putFloat(o + bb_pos, testfNan)
true
} else {
false
}
}
val testfPinf : Float
get() {
val o = __offset(6)
return if(o != 0) bb.getFloat(o + bb_pos) else Float.POSITIVE_INFINITY
}
fun mutateTestfPinf(testfPinf: Float) : Boolean {
val o = __offset(6)
return if (o != 0) {
bb.putFloat(o + bb_pos, testfPinf)
true
} else {
false
}
}
val testfNinf : Float
get() {
val o = __offset(8)
return if(o != 0) bb.getFloat(o + bb_pos) else Float.NEGATIVE_INFINITY
}
fun mutateTestfNinf(testfNinf: Float) : Boolean {
val o = __offset(8)
return if (o != 0) {
bb.putFloat(o + bb_pos, testfNinf)
true
} else {
false
}
}
val testdNan : Double
get() {
val o = __offset(10)
return if(o != 0) bb.getDouble(o + bb_pos) else Double.NaN return if(o != 0) bb.getDouble(o + bb_pos) else Double.NaN
} }
fun mutateTestdNan(testdNan: Double) : Boolean { fun mutateD0(d0: Double) : Boolean {
val o = __offset(10) val o = __offset(4)
return if (o != 0) { return if (o != 0) {
bb.putDouble(o + bb_pos, testdNan) bb.putDouble(o + bb_pos, d0)
true true
} else { } else {
false false
} }
} }
val testdPinf : Double val d1 : Double
get() { get() {
val o = __offset(12) val o = __offset(6)
return if(o != 0) bb.getDouble(o + bb_pos) else Double.NaN
}
fun mutateD1(d1: Double) : Boolean {
val o = __offset(6)
return if (o != 0) {
bb.putDouble(o + bb_pos, d1)
true
} else {
false
}
}
val d2 : Double
get() {
val o = __offset(8)
return if(o != 0) bb.getDouble(o + bb_pos) else Double.POSITIVE_INFINITY return if(o != 0) bb.getDouble(o + bb_pos) else Double.POSITIVE_INFINITY
} }
fun mutateTestdPinf(testdPinf: Double) : Boolean { fun mutateD2(d2: Double) : Boolean {
val o = __offset(12) val o = __offset(8)
return if (o != 0) { return if (o != 0) {
bb.putDouble(o + bb_pos, testdPinf) bb.putDouble(o + bb_pos, d2)
true true
} else { } else {
false false
} }
} }
val testdNinf : Double val d3 : Double
get() { get() {
val o = __offset(14) val o = __offset(10)
return if(o != 0) bb.getDouble(o + bb_pos) else Double.NEGATIVE_INFINITY return if(o != 0) bb.getDouble(o + bb_pos) else Double.NEGATIVE_INFINITY
} }
fun mutateTestdNinf(testdNinf: Double) : Boolean { fun mutateD3(d3: Double) : Boolean {
val o = __offset(10)
return if (o != 0) {
bb.putDouble(o + bb_pos, d3)
true
} else {
false
}
}
val f0 : Float
get() {
val o = __offset(12)
return if(o != 0) bb.getFloat(o + bb_pos) else Float.NaN
}
fun mutateF0(f0: Float) : Boolean {
val o = __offset(12)
return if (o != 0) {
bb.putFloat(o + bb_pos, f0)
true
} else {
false
}
}
val f1 : Float
get() {
val o = __offset(14)
return if(o != 0) bb.getFloat(o + bb_pos) else Float.NaN
}
fun mutateF1(f1: Float) : Boolean {
val o = __offset(14) val o = __offset(14)
return if (o != 0) { return if (o != 0) {
bb.putDouble(o + bb_pos, testdNinf) bb.putFloat(o + bb_pos, f1)
true true
} else { } else {
false false
} }
} }
fun testfVec(j: Int) : Float { val f2 : Float
val o = __offset(16)
return if (o != 0) {
bb.getFloat(__vector(o) + j * 4)
} else {
0.0f
}
}
val testfVecLength : Int
get() { get() {
val o = __offset(16); return if (o != 0) __vector_len(o) else 0 val o = __offset(16)
return if(o != 0) bb.getFloat(o + bb_pos) else Float.POSITIVE_INFINITY
} }
val testfVecAsByteBuffer : ByteBuffer get() = __vector_as_bytebuffer(16, 4) fun mutateF2(f2: Float) : Boolean {
fun testfVecInByteBuffer(_bb: ByteBuffer) : ByteBuffer = __vector_in_bytebuffer(_bb, 16, 4)
fun mutateTestfVec(j: Int, testfVec: Float) : Boolean {
val o = __offset(16) val o = __offset(16)
return if (o != 0) { return if (o != 0) {
bb.putFloat(__vector(o) + j * 4, testfVec) bb.putFloat(o + bb_pos, f2)
true true
} else { } else {
false false
} }
} }
fun testdVec(j: Int) : Double { val f3 : Float
get() {
val o = __offset(18)
return if(o != 0) bb.getFloat(o + bb_pos) else Float.NEGATIVE_INFINITY
}
fun mutateF3(f3: Float) : Boolean {
val o = __offset(18) val o = __offset(18)
return if (o != 0) {
bb.putFloat(o + bb_pos, f3)
true
} else {
false
}
}
fun dvec(j: Int) : Double {
val o = __offset(20)
return if (o != 0) { return if (o != 0) {
bb.getDouble(__vector(o) + j * 8) bb.getDouble(__vector(o) + j * 8)
} else { } else {
0.0 0.0
} }
} }
val testdVecLength : Int val dvecLength : Int
get() { get() {
val o = __offset(18); return if (o != 0) __vector_len(o) else 0 val o = __offset(20); return if (o != 0) __vector_len(o) else 0
} }
val testdVecAsByteBuffer : ByteBuffer get() = __vector_as_bytebuffer(18, 8) val dvecAsByteBuffer : ByteBuffer get() = __vector_as_bytebuffer(20, 8)
fun testdVecInByteBuffer(_bb: ByteBuffer) : ByteBuffer = __vector_in_bytebuffer(_bb, 18, 8) fun dvecInByteBuffer(_bb: ByteBuffer) : ByteBuffer = __vector_in_bytebuffer(_bb, 20, 8)
fun mutateTestdVec(j: Int, testdVec: Double) : Boolean { fun mutateDvec(j: Int, dvec: Double) : Boolean {
val o = __offset(18) val o = __offset(20)
return if (o != 0) { return if (o != 0) {
bb.putDouble(__vector(o) + j * 8, testdVec) bb.putDouble(__vector(o) + j * 8, dvec)
true
} else {
false
}
}
fun fvec(j: Int) : Float {
val o = __offset(22)
return if (o != 0) {
bb.getFloat(__vector(o) + j * 4)
} else {
0.0f
}
}
val fvecLength : Int
get() {
val o = __offset(22); return if (o != 0) __vector_len(o) else 0
}
val fvecAsByteBuffer : ByteBuffer get() = __vector_as_bytebuffer(22, 4)
fun fvecInByteBuffer(_bb: ByteBuffer) : ByteBuffer = __vector_in_bytebuffer(_bb, 22, 4)
fun mutateFvec(j: Int, fvec: Float) : Boolean {
val o = __offset(22)
return if (o != 0) {
bb.putFloat(__vector(o) + j * 4, fvec)
true true
} else { } else {
false false
@ -155,43 +183,47 @@ class MonsterExtra : Table() {
return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)) return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb))
} }
fun MonsterExtraBufferHasIdentifier(_bb: ByteBuffer) : Boolean = __has_identifier(_bb, "MONE") fun MonsterExtraBufferHasIdentifier(_bb: ByteBuffer) : Boolean = __has_identifier(_bb, "MONE")
fun createMonsterExtra(builder: FlatBufferBuilder, testfNan: Float, testfPinf: Float, testfNinf: Float, testdNan: Double, testdPinf: Double, testdNinf: Double, testfVecOffset: Int, testdVecOffset: Int) : Int { fun createMonsterExtra(builder: FlatBufferBuilder, d0: Double, d1: Double, d2: Double, d3: Double, f0: Float, f1: Float, f2: Float, f3: Float, dvecOffset: Int, fvecOffset: Int) : Int {
builder.startTable(8) builder.startTable(10)
addTestdNinf(builder, testdNinf) addD3(builder, d3)
addTestdPinf(builder, testdPinf) addD2(builder, d2)
addTestdNan(builder, testdNan) addD1(builder, d1)
addTestdVec(builder, testdVecOffset) addD0(builder, d0)
addTestfVec(builder, testfVecOffset) addFvec(builder, fvecOffset)
addTestfNinf(builder, testfNinf) addDvec(builder, dvecOffset)
addTestfPinf(builder, testfPinf) addF3(builder, f3)
addTestfNan(builder, testfNan) addF2(builder, f2)
addF1(builder, f1)
addF0(builder, f0)
return endMonsterExtra(builder) return endMonsterExtra(builder)
} }
fun startMonsterExtra(builder: FlatBufferBuilder) = builder.startTable(8) fun startMonsterExtra(builder: FlatBufferBuilder) = builder.startTable(10)
fun addTestfNan(builder: FlatBufferBuilder, testfNan: Float) = builder.addFloat(0, testfNan, Double.NaN) fun addD0(builder: FlatBufferBuilder, d0: Double) = builder.addDouble(0, d0, Double.NaN)
fun addTestfPinf(builder: FlatBufferBuilder, testfPinf: Float) = builder.addFloat(1, testfPinf, Double.POSITIVE_INFINITY) fun addD1(builder: FlatBufferBuilder, d1: Double) = builder.addDouble(1, d1, Double.NaN)
fun addTestfNinf(builder: FlatBufferBuilder, testfNinf: Float) = builder.addFloat(2, testfNinf, Double.NEGATIVE_INFINITY) fun addD2(builder: FlatBufferBuilder, d2: Double) = builder.addDouble(2, d2, Double.POSITIVE_INFINITY)
fun addTestdNan(builder: FlatBufferBuilder, testdNan: Double) = builder.addDouble(3, testdNan, Double.NaN) fun addD3(builder: FlatBufferBuilder, d3: Double) = builder.addDouble(3, d3, Double.NEGATIVE_INFINITY)
fun addTestdPinf(builder: FlatBufferBuilder, testdPinf: Double) = builder.addDouble(4, testdPinf, Double.POSITIVE_INFINITY) fun addF0(builder: FlatBufferBuilder, f0: Float) = builder.addFloat(4, f0, Double.NaN)
fun addTestdNinf(builder: FlatBufferBuilder, testdNinf: Double) = builder.addDouble(5, testdNinf, Double.NEGATIVE_INFINITY) fun addF1(builder: FlatBufferBuilder, f1: Float) = builder.addFloat(5, f1, Double.NaN)
fun addTestfVec(builder: FlatBufferBuilder, testfVec: Int) = builder.addOffset(6, testfVec, 0) fun addF2(builder: FlatBufferBuilder, f2: Float) = builder.addFloat(6, f2, Double.POSITIVE_INFINITY)
fun createTestfVecVector(builder: FlatBufferBuilder, data: FloatArray) : Int { fun addF3(builder: FlatBufferBuilder, f3: Float) = builder.addFloat(7, f3, Double.NEGATIVE_INFINITY)
builder.startVector(4, data.size, 4) fun addDvec(builder: FlatBufferBuilder, dvec: Int) = builder.addOffset(8, dvec, 0)
for (i in data.size - 1 downTo 0) { fun createDvecVector(builder: FlatBufferBuilder, data: DoubleArray) : Int {
builder.addFloat(data[i])
}
return builder.endVector()
}
fun startTestfVecVector(builder: FlatBufferBuilder, numElems: Int) = builder.startVector(4, numElems, 4)
fun addTestdVec(builder: FlatBufferBuilder, testdVec: Int) = builder.addOffset(7, testdVec, 0)
fun createTestdVecVector(builder: FlatBufferBuilder, data: DoubleArray) : Int {
builder.startVector(8, data.size, 8) builder.startVector(8, data.size, 8)
for (i in data.size - 1 downTo 0) { for (i in data.size - 1 downTo 0) {
builder.addDouble(data[i]) builder.addDouble(data[i])
} }
return builder.endVector() return builder.endVector()
} }
fun startTestdVecVector(builder: FlatBufferBuilder, numElems: Int) = builder.startVector(8, numElems, 8) fun startDvecVector(builder: FlatBufferBuilder, numElems: Int) = builder.startVector(8, numElems, 8)
fun addFvec(builder: FlatBufferBuilder, fvec: Int) = builder.addOffset(9, fvec, 0)
fun createFvecVector(builder: FlatBufferBuilder, data: FloatArray) : Int {
builder.startVector(4, data.size, 4)
for (i in data.size - 1 downTo 0) {
builder.addFloat(data[i])
}
return builder.endVector()
}
fun startFvecVector(builder: FlatBufferBuilder, numElems: Int) = builder.startVector(4, numElems, 4)
fun endMonsterExtra(builder: FlatBufferBuilder) : Int { fun endMonsterExtra(builder: FlatBufferBuilder) : Int {
val o = builder.endTable() val o = builder.endTable()
return o return o