Table of Contents

Struct SwiftTicket

Namespace
SwiftCollections
Assembly
SwiftCollections.dll

Identifies an allocation in its originating ticket map by index and generation.

public readonly struct SwiftTicket : IEquatable<SwiftTicket>
Implements
Inherited Members

Remarks

A SwiftTicket consists of an integer index and an unsigned generation value. This combination helps detect stale references when slots are reused. Tickets carry no collection identity; use them only with their originating map. Generation counters are finite.

Constructors

SwiftTicket(int, uint)

Initializes a new instance of the SwiftTicket class with the specified index and generation values.

public SwiftTicket(int index, uint generation)

Parameters

index int

The zero-based index that identifies the ticket. Must be greater than or equal to 0.

generation uint

The generation value associated with the ticket. Used to distinguish between different versions of the same index.

Fields

Generation

Gets the generation number associated with this instance.

public readonly uint Generation

Field Value

uint

Index

Gets the zero-based index associated with this instance.

public readonly int Index

Field Value

int

Methods

Equals(SwiftTicket)

public bool Equals(SwiftTicket other)

Parameters

other SwiftTicket

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

Returns a string that represents the current ticket, including its index and generation values.

public override string ToString()

Returns

string

A string in the format "Ticket({Index}:{Generation})" that identifies the ticket by its index and generation.

Operators

operator ==(SwiftTicket, SwiftTicket)

Determines whether two SwiftTicket instances are equal.

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

Parameters

left SwiftTicket
right SwiftTicket

Returns

bool

operator !=(SwiftTicket, SwiftTicket)

Determines whether two SwiftTicket instances are not equal.

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

Parameters

left SwiftTicket
right SwiftTicket

Returns

bool