/// <summary> /// Dispatches all the edits in the snapshot to the appropriate <paramref name="visitor"/> methods. /// </summary> /// <param name="visitor">The visitor to dispatch to.</param> /// <remarks> /// There will be at most one edit per key/value store entry sharing the same key. The order of the edits in a snapshot is /// undefined and does not reflect the order in which edits took place. Snapshots reconcile edits to the same entries by /// only retaining the last edit for each key. /// </remarks> public void Accept(ISnapshotVisitor <TKey, TValue> visitor) { foreach (var edit in _edits) { edit.Accept(visitor); } }
/// <summary> /// Dispatches to the <see cref="ISnapshotVisitor{TKey, TValue}.Delete(TKey)"/> method on the <paramref name="visitor"/>. /// </summary> /// <param name="visitor">The visitor to dispatch to.</param> public override void Accept(ISnapshotVisitor <TKey, TValue> visitor) => visitor.Delete(_key);
/// <summary> /// Dispatches to the <see cref="ISnapshotVisitor{TKey, TValue}.AddOrUpdate(TKey, TValue)"/> method on the <paramref name="visitor"/>. /// </summary> /// <param name="visitor">The visitor to dispatch to.</param> public override void Accept(ISnapshotVisitor <TKey, TValue> visitor) => visitor.AddOrUpdate(_key, _value);
/// <summary> /// Dispatches to the <paramref name="visitor"/> method corresponding to the edit type. /// </summary> /// <param name="visitor">The visitor to dispatch to.</param> public abstract void Accept(ISnapshotVisitor <TKey, TValue> visitor);
public override IReadOnlyList <ISendable <ITransmittable> > Accept(ISnapshotVisitor <IReadOnlyList <ISendable <ITransmittable> > > visitor) => visitor.Visit(this);
public abstract IReadOnlyList <ISendable <ITransmittable> > Accept(ISnapshotVisitor <IReadOnlyList <ISendable <ITransmittable> > > visitor);
public SendableFactory(ILogger logger, ISnapshotVisitor <IReadOnlyList <ISendable <ITransmittable> > > snapshotVisitor) { _logger = logger; _snapshotVisitor = snapshotVisitor; }