Class MemoryReadSet
- Namespace
- CStructSharp.Memory
- Assembly
- CStructSharp.dll
Immutable selected fixed-field intervals, with explicit elementwise or coalesced capture.
public sealed class MemoryReadSet
- Inheritance
-
MemoryReadSet
- Inherited Members
Remarks
Preparation retains schema decisions, never bytes or contexts. The root-relative scratch envelope is explicitly bounded; choose individual field reads for widely separated fields. A missing merged gap does not invalidate independently readable fields. Pointer traversal is deliberately excluded.
Constructors
MemoryReadSet(MemorySchema, string, IEnumerable<string>, int, int)
Prepares selected field intervals and a bounded scratch envelope.
public MemoryReadSet(MemorySchema schema, string typeId, IEnumerable<string> paths, int maxBufferBytes = 1048576, int maxGapBytes = 0)
Parameters
schemaMemorySchemaExact immutable schema identity.
typeIdstringRoot record type.
pathsIEnumerable<string>Fields in elementwise request order, at most 4096.
maxBufferBytesintMaximum root-relative scratch extent, at most 64 MiB.
maxGapBytesintMaximum extra gap read only in explicit Coalesced mode.
Exceptions
- ArgumentOutOfRangeException
Bounds, field count or envelope are exceeded.
- NotSupportedException
A selected path follows a pointer.
Properties
BufferLength
Gets the bounded owned scratch extent in bytes, including invalid gaps.
public int BufferLength { get; }
Property Value
Fields
Gets selected paths, offsets and types in requested order for compatibility reporting.
public IReadOnlyList<MemoryPath> Fields { get; }
Property Value
Schema
Gets the exact owning schema.
public MemorySchema Schema { get; }
Property Value
Methods
Capture(MemoryRegion, MemoryAccessContext, MemoryReadMode)
Captures selected bytes with independent validity and original logical coordinates.
public MemorySnapshot Capture(MemoryRegion region, MemoryAccessContext context, MemoryReadMode mode = MemoryReadMode.Elementwise)
Parameters
regionMemoryRegionPermitted storage beginning at the root. Only the selected envelope is required.
contextMemoryAccessContextShared transport budget and cancellation, including retries and cache hits.
modeMemoryReadModeExplicit transport shape; defaults to original field-by-field requests.
Returns
- MemorySnapshot
Owned bytes, known intervals and generation observations. No source ownership or atomicity is implied.
Exceptions
- ArgumentOutOfRangeException
The region cannot hold the selected envelope or mode is invalid.
- MemoryAccessException
The shared budget is exhausted.
- OperationCanceledException
Cancellation was requested.