Class MemorySelection
- Namespace
- CStructSharp.Memory
- Assembly
- CStructSharp.dll
The result of resolving a path: which bytes were selected, what type they hold, and which field (and bit slice) named them.
public sealed record MemorySelection : IEquatable<MemorySelection>
- Inheritance
-
MemorySelection
- Implements
- Inherited Members
Remarks
A selection is a location, not a value. It is what an address display needs ("field pid of the record at
0x1000 is at 0x1000, four bytes") and what patch planning needs, and it can be produced without decoding the
record. For a bitfield the region covers the whole storage unit and Field identifies the bits
within it. Resolving may already have read intermediate pointers on the way here, but the final selected value
is never decoded.
Container is the record that contains the selected member. It differs from the root region once a path has entered a nested record or followed a pointer, and it is what a relative-pointer resolver uses as its base.
Constructors
MemorySelection(MemoryRegion, MemoryTypeDefinition, MemoryField?, string?, MemoryRegion?)
The result of resolving a path: which bytes were selected, what type they hold, and which field (and bit slice) named them.
public MemorySelection(MemoryRegion Region, MemoryTypeDefinition Type, MemoryField? Field, string? ParentTypeId, MemoryRegion? Container = null)
Parameters
RegionMemoryRegionFinite logical storage selected by the path.
TypeMemoryTypeDefinitionType describing the selected bytes.
FieldMemoryFieldMember descriptor, including an optional bit slice; null for a root or an array element.
ParentTypeIdstringID of the containing record's type, or null for a root.
ContainerMemoryRegionRegion of the containing record, used to interpret relative pointers; null at a root.
Remarks
A selection is a location, not a value. It is what an address display needs ("field pid of the record at
0x1000 is at 0x1000, four bytes") and what patch planning needs, and it can be produced without decoding the
record. For a bitfield the region covers the whole storage unit and Field identifies the bits
within it. Resolving may already have read intermediate pointers on the way here, but the final selected value
is never decoded.
Container is the record that contains the selected member. It differs from the root region once a path has entered a nested record or followed a pointer, and it is what a relative-pointer resolver uses as its base.
Properties
Container
Region of the containing record, used to interpret relative pointers; null at a root.
public MemoryRegion? Container { get; init; }
Property Value
Field
Member descriptor, including an optional bit slice; null for a root or an array element.
public MemoryField? Field { get; init; }
Property Value
ParentTypeId
ID of the containing record's type, or null for a root.
public string? ParentTypeId { get; init; }
Property Value
Region
Finite logical storage selected by the path.
public MemoryRegion Region { get; init; }
Property Value
Type
Type describing the selected bytes.
public MemoryTypeDefinition Type { get; init; }
Property Value
Methods
Deconstruct(out MemoryRegion, out MemoryTypeDefinition, out MemoryField?, out string?, out MemoryRegion?)
public void Deconstruct(out MemoryRegion Region, out MemoryTypeDefinition Type, out MemoryField? Field, out string? ParentTypeId, out MemoryRegion? Container)
Parameters
RegionMemoryRegionTypeMemoryTypeDefinitionFieldMemoryFieldParentTypeIdstringContainerMemoryRegion
Equals(MemorySelection?)
public bool Equals(MemorySelection? other)
Parameters
otherMemorySelection
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
ToString()
public override string ToString()
Returns
Operators
operator ==(MemorySelection?, MemorySelection?)
public static bool operator ==(MemorySelection? left, MemorySelection? right)
Parameters
leftMemorySelectionrightMemorySelection
Returns
operator !=(MemorySelection?, MemorySelection?)
public static bool operator !=(MemorySelection? left, MemorySelection? right)
Parameters
leftMemorySelectionrightMemorySelection