Class MemorySnapshot
- Namespace
- CStructSharp.Memory
- Assembly
- CStructSharp.dll
Owned selected storage with explicit validity and observed source generation.
public sealed class MemorySnapshot
- Inheritance
-
MemorySnapshot
- Inherited Members
Remarks
Unselected storage is presentation padding and cannot supply evidence. Equal generation observations are not a promise of an atomic snapshot for live sources. The captured owned bytes themselves remain stable.
Properties
Bytes
Gets owned stable bytes, including explicitly invalid presentation padding.
public ReadOnlyMemory<byte> Bytes { get; }
Property Value
GenerationAfter
Gets the source generation observed after reads.
public long GenerationAfter { get; }
Property Value
GenerationBefore
Gets the source generation observed before reads.
public long GenerationBefore { get; }
Property Value
Region
Gets original source identity and logical origin, without taking source ownership.
public MemoryRegion Region { get; }
Property Value
Schema
Gets the exact schema instance owning the prepared fields.
public MemorySchema Schema { get; }
Property Value
Validity
Gets confirmed readable intervals. Padding and failed bytes are never known zeroes.
public MemoryValidity Validity { get; }
Property Value
Methods
TryRead<T>(MemoryFieldReader<T>, MemoryAccessContext, out T)
Decodes a prepared field from known captured bytes, rejecting a different schema instance.
public bool TryRead<T>(MemoryFieldReader<T> reader, MemoryAccessContext context, out T value)
Parameters
readerMemoryFieldReader<T>Reader bound to the capture's identical schema.
contextMemoryAccessContextShared local decoding budget and cancellation.
valueTDecoded value, or default for unavailable storage.
Returns
- bool
Whether all required field bytes were captured.
Type Parameters
TExact managed field result.
Exceptions
- ArgumentException
The reader belongs to another schema.