All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.it.unibo.tuprolog.solve.concurrent.AtomicInt.kt Maven / Gradle / Ivy

Go to download

Experimental, state-machine-based implementation of an OR-Concurrent, Prolog-like logic solver, based on Kotlin coroutines

There is a newer version: 1.0.4
Show newest version
package it.unibo.tuprolog.solve.concurrent

import kotlin.js.JsName
import kotlin.jvm.JvmStatic

interface AtomicInt {
    @JsName("value")
    var value: Int

    @JsName("plusAssign")
    operator fun plusAssign(delta: Int)

    @JsName("minusAssign")
    operator fun minusAssign(delta: Int)

    @JsName("incAndGet")
    fun incAndGet(delta: Int = 1): Int

    @JsName("decAndGet")
    fun decAndGet(delta: Int = 1): Int

    companion object {

        @JsName("zero")
        @JvmStatic
        fun zero(): AtomicInt = atomicInt(0)

        @JsName("of")
        @JvmStatic
        fun of(value: Int): AtomicInt = atomicInt(value)
    }
}

internal expect fun atomicInt(value: Int): AtomicInt




© 2015 - 2025 Weber Informatics LLC | Privacy Policy