Table of Contents

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

schema MemorySchema

Exact immutable schema identity.

typeId string

Root record type.

paths IEnumerable<string>

Fields in elementwise request order, at most 4096.

maxBufferBytes int

Maximum root-relative scratch extent, at most 64 MiB.

maxGapBytes int

Maximum 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

int

Fields

Gets selected paths, offsets and types in requested order for compatibility reporting.

public IReadOnlyList<MemoryPath> Fields { get; }

Property Value

IReadOnlyList<MemoryPath>

Schema

Gets the exact owning schema.

public MemorySchema Schema { get; }

Property Value

MemorySchema

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

region MemoryRegion

Permitted storage beginning at the root. Only the selected envelope is required.

context MemoryAccessContext

Shared transport budget and cancellation, including retries and cache hits.

mode MemoryReadMode

Explicit 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.