Struct Locus
Where a finding is, in every addressing scheme that applies to it.
public readonly struct Locus : IEquatable<Locus>
- Implements
- Inherited Members
Remarks
Deliberately over-specified. A page index is what a storage engineer needs; an archetype and entity id is what the application owner needs; the Workbench File Map addresses cells by physical page index. Reporting only one forces every consumer to re-derive the others — and re-derivation on a damaged database is exactly what cannot be trusted.
Constructors
Locus(int, int, StorageSegmentKind, string, string, long, int, ulong)
Creates a locus. Pass None / null / 0 for components that do not apply.
public Locus(int filePageIndex = -1, int segmentRootPage = -1, StorageSegmentKind kind = StorageSegmentKind.Other, string archetypeName = null, string componentName = null, long chunkId = 0, int slot = -1, ulong entityId = 0)
Parameters
filePageIndexintPhysical file-page index, or None.
segmentRootPageintRoot page of the owning logical segment, or None.
kindStorageSegmentKindKind of the owning segment.
archetypeNamestringSchema-level archetype name when resolvable.
componentNamestringSchema-level component name when resolvable.
chunkIdlongChunk id within the owning chunk-based segment, or
0.slotintSlot index within a cluster chunk, or None.
entityIdulongRaw entity id when the finding is entity-scoped, or
0.
Fields
None
Sentinel for an addressing component that does not apply to a finding.
public const int None = -1
Field Value
Properties
ArchetypeName
Schema-level archetype name, when the scan could resolve one.
public string ArchetypeName { get; }
Property Value
ChunkId
Chunk id within the owning chunk-based segment, or 0.
public long ChunkId { get; }
Property Value
ComponentName
Schema-level component name, when the scan could resolve one.
public string ComponentName { get; }
Property Value
Database
A locus that names the database as a whole. Use this rather than default: a default-initialised struct
reads every component as 0, which renders as "page 0" and points a reader at the meta page.
public static Locus Database { get; }
Property Value
EntityId
Raw entity id when the finding is entity-scoped, or 0.
public ulong EntityId { get; }
Property Value
FilePageIndex
Physical file-page index, or None when the finding is not page-scoped.
public int FilePageIndex { get; }
Property Value
Kind
Kind of the owning logical segment.
public StorageSegmentKind Kind { get; }
Property Value
SegmentRootPage
Root page of the owning logical segment, or None.
public int SegmentRootPage { get; }
Property Value
Slot
Slot index within a cluster chunk, or None.
public int Slot { get; }
Property Value
Methods
Equals(object)
public override bool Equals(object obj)
Parameters
objobject
Returns
Equals(Locus)
public bool Equals(Locus other)
Parameters
otherLocus
Returns
GetHashCode()
public override int GetHashCode()
Returns
ToString()
Renders the locus as a compact, human-readable path — only the components that apply.
public override string ToString()
Returns
Operators
operator ==(Locus, Locus)
Equality operator.
public static bool operator ==(Locus left, Locus right)
Parameters
Returns
operator !=(Locus, Locus)
Inequality operator.
public static bool operator !=(Locus left, Locus right)