Fix meta node listeners and attachements

This commit is contained in:
Alexander Nozik 2021-08-15 13:20:54 +03:00
parent a71bb732da
commit 0ad6852e36
3 changed files with 7 additions and 3 deletions

View File

@ -11,6 +11,7 @@
### Fixed
- MutableMetaImpl attachment and checks
- Listeners in observable meta are replaced by lists
### Security
## [0.5.0]

View File

@ -48,7 +48,7 @@ public interface ObservableMutableMeta : ObservableMeta, MutableMeta, MutableTyp
}
internal abstract class AbstractObservableMeta : ObservableMeta {
private val listeners = ArrayList<MetaListener>()
private val listeners: MutableList<MetaListener> = mutableListOf()
override fun invalidate(name: Name) {
listeners.forEach { it.callback(this, name) }

View File

@ -1,6 +1,9 @@
package space.kscience.dataforge.meta
import space.kscience.dataforge.meta.descriptors.*
import space.kscience.dataforge.meta.descriptors.Described
import space.kscience.dataforge.meta.descriptors.MetaDescriptor
import space.kscience.dataforge.meta.descriptors.get
import space.kscience.dataforge.meta.descriptors.validate
import space.kscience.dataforge.misc.DFExperimental
import space.kscience.dataforge.names.*
import space.kscience.dataforge.values.Value
@ -64,7 +67,7 @@ public open class Scheme : Described, MetaRepr, MutableMetaProvider, Configurabl
override fun toMeta(): Laminate = Laminate(meta, descriptor?.defaultNode)
private val listeners = HashSet<MetaListener>()
private val listeners: MutableList<MetaListener> = mutableListOf()
private inner class SchemeMeta(val pathName: Name) : ObservableMutableMeta {
override var value: Value?