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
TKeyThe key for an independently mutable resource.
TSnapshotThe 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
keyTKey
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
transactionTransactionContextkeyTKey
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
keyTKeysnapshotTSnapshot
RestoreSnapshot(TKey, in TSnapshot)
Restores the specified key from a captured snapshot.
protected abstract void RestoreSnapshot(TKey key, in TSnapshot snapshot)
Parameters
keyTKeysnapshotTSnapshot