Table of Contents

Class KeyedSnapshotJournal<TKey, TSnapshot>

Namespace
Shard.Gameplay.Universe.Transactions
Assembly
Shard.Gameplay.Universe.dll

A journal that records one baseline for each key at each active transaction depth.

public abstract class KeyedSnapshotJournal<TKey, TSnapshot> where TKey : notnull

Type Parameters

TKey

The key for an independently mutable resource.

TSnapshot

The snapshot type that stores the state for one key.

Inheritance
KeyedSnapshotJournal<TKey, TSnapshot>
Inherited Members

Constructors

KeyedSnapshotJournal()

protected KeyedSnapshotJournal()

Methods

CaptureSnapshot(TKey)

Captures the current state of the specified key.

protected abstract TSnapshot CaptureSnapshot(TKey key)

Parameters

key TKey

Returns

TSnapshot

PublishCommittedState()

Publishes committed state after the root transaction commits.

protected virtual void PublishCommittedState()

RecordSnapshot(TransactionContext, TKey)

Records the state of a key before its first mutation at the current transaction depth.

protected void RecordSnapshot(TransactionContext transaction, TKey key)

Parameters

transaction TransactionContext
key TKey

ReleaseSnapshot(TKey, in TSnapshot)

Releases a captured snapshot after the journal no longer needs it.

protected virtual void ReleaseSnapshot(TKey key, in TSnapshot snapshot)

Parameters

key TKey
snapshot TSnapshot

RestoreSnapshot(TKey, in TSnapshot)

Restores the specified key from a captured snapshot.

protected abstract void RestoreSnapshot(TKey key, in TSnapshot snapshot)

Parameters

key TKey
snapshot TSnapshot