TwoWayMutableProjection

class TwoWayMutableProjection<M, T, C>(    projection: TwoWayProjection<M, T, C>,     changeSerializer: KSerializer<C>,     eventSerializer: KSerializer<T>,     format: BinaryFormat) : MutableProjection<M>

An implementation of a MutableProjection which wraps a TwoWayProjection with some dedicated serializers. This lets consumers of MutableProjection offer a higher-level API which works on generic types, rather than sequences of bytes.

Parameters

projection

the backing TwoWayProjection.

changeSerializer

the KSerializer for the changes.

eventSerializer

the KSerializer for the events.

format

the BinaryFormat to use to store events.

M

the type of the model.

T

the type of the events.

C

the type of the changes.

Constructors

Link copied to clipboard
fun <M, T, C> TwoWayMutableProjection(    projection: TwoWayProjection<M, T, C>,     changeSerializer: KSerializer<C>,     eventSerializer: KSerializer<T>,     format: BinaryFormat)

Functions

Link copied to clipboard
open override fun backward(    model: M,     identifier: EventIdentifier,     data: MutableByteGapBuffer,     from: Int,     until: Int,     changeData: MutableByteGapBuffer,     changeFrom: Int,     changeUntil: Int): M
Link copied to clipboard
open override fun ChangeScope.forward(    model: M,     identifier: EventIdentifier,     data: MutableByteGapBuffer,     from: Int,     until: Int): M