Skip to content

Commit

Permalink
Rename interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Iliya-usov authored and ForNeVeR committed Jul 28, 2023
1 parent 98ba9d4 commit 56582ef
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ import com.jetbrains.rd.util.Logger
import com.jetbrains.rd.util.error
import com.jetbrains.rd.util.lifetime.*

interface IAppendOnlyViewableConcurrentSet<T> : Iterable<T> {
interface IViewableConcurrentSet<T> : Iterable<T> {
val size: Int

fun add(value: T): Boolean
fun contains(value: T): Boolean
fun view(lifetime: Lifetime, action: (Lifetime, T) -> Unit)
}

interface IAppendOnlyViewableConcurrentSet<T> : IViewableConcurrentSet<T> {
fun add(value: T): Boolean

/**
* Adds all the elements of the specified collection to this collection.
Expand All @@ -24,17 +28,13 @@ interface IAppendOnlyViewableConcurrentSet<T> : Iterable<T> {

return added
}

fun contains(value: T): Boolean

fun view(lifetime: Lifetime, action: (Lifetime, T) -> Unit)
}

interface IViewableConcurrentSet<T> : IAppendOnlyViewableConcurrentSet<T> {
interface IMutableViewableConcurrentSet<T> : IAppendOnlyViewableConcurrentSet<T> {
fun remove(value: T): Boolean
}

class ConcurrentViewableSet<T> : IViewableConcurrentSet<T> {
class ConcurrentViewableSet<T> : IMutableViewableConcurrentSet<T> {
private val signal = Signal<VersionedData<T>>()
private var map = LinkedHashMap<T, LifetimeDefinition>()
private val locker = Any()
Expand Down

0 comments on commit 56582ef

Please sign in to comment.