Table of Contents

Struct Locus

Namespace
Typhon.Engine
Assembly
Typhon.Engine.dll

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

filePageIndex int

Physical file-page index, or None.

segmentRootPage int

Root page of the owning logical segment, or None.

kind StorageSegmentKind

Kind of the owning segment.

archetypeName string

Schema-level archetype name when resolvable.

componentName string

Schema-level component name when resolvable.

chunkId long

Chunk id within the owning chunk-based segment, or 0.

slot int

Slot index within a cluster chunk, or None.

entityId ulong

Raw 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

int

Properties

ArchetypeName

Schema-level archetype name, when the scan could resolve one.

public string ArchetypeName { get; }

Property Value

string

ChunkId

Chunk id within the owning chunk-based segment, or 0.

public long ChunkId { get; }

Property Value

long

ComponentName

Schema-level component name, when the scan could resolve one.

public string ComponentName { get; }

Property Value

string

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

Locus

EntityId

Raw entity id when the finding is entity-scoped, or 0.

public ulong EntityId { get; }

Property Value

ulong

FilePageIndex

Physical file-page index, or None when the finding is not page-scoped.

public int FilePageIndex { get; }

Property Value

int

Kind

Kind of the owning logical segment.

public StorageSegmentKind Kind { get; }

Property Value

StorageSegmentKind

SegmentRootPage

Root page of the owning logical segment, or None.

public int SegmentRootPage { get; }

Property Value

int

Slot

Slot index within a cluster chunk, or None.

public int Slot { get; }

Property Value

int

Methods

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

Equals(Locus)

public bool Equals(Locus other)

Parameters

other Locus

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

Renders the locus as a compact, human-readable path — only the components that apply.

public override string ToString()

Returns

string

Operators

operator ==(Locus, Locus)

Equality operator.

public static bool operator ==(Locus left, Locus right)

Parameters

left Locus

Left operand.

right Locus

Right operand.

Returns

bool

operator !=(Locus, Locus)

Inequality operator.

public static bool operator !=(Locus left, Locus right)

Parameters

left Locus

Left operand.

right Locus

Right operand.

Returns

bool