Table of Contents

Struct SwiftSparseMapState<T>

Namespace
SwiftCollections
Assembly
SwiftCollections.dll

Represents the immutable state of a sparse map, containing the dense keys and associated values.

[MemoryPackable(GenerateType.Object)]
public readonly struct SwiftSparseMapState<T> : IMemoryPackable<SwiftSparseMapState<T>>, IMemoryPackFormatterRegister

Type Parameters

T

The type of values stored in the sparse map.

Implements
IMemoryPackable<SwiftSparseMapState<T>>
IMemoryPackFormatterRegister
Inherited Members

Remarks

This structure is typically used to serialize or inspect the contents of a sparse map. The arrays are guaranteed to be non-null, but may be empty if the map contains no elements.

Constructors

SwiftSparseMapState(int[], T[])

Initializes a new instance of the SwiftSparseMapState class with the specified dense keys and values.

[JsonConstructor]
[MemoryPackConstructor]
public SwiftSparseMapState(int[] denseKeys, T[] denseValues)

Parameters

denseKeys int[]

An array of integers representing the dense keys to initialize the map with. If null, an empty array is used.

denseValues T[]

An array of values of type T corresponding to the dense keys. If null, an empty array is used.

Fields

DenseKeys

Gets the collection of dense keys associated with this instance.

[JsonInclude]
[MemoryPackInclude]
public readonly int[] DenseKeys

Field Value

int[]

DenseValues

Gets the array containing the dense values for this instance.

[JsonInclude]
[MemoryPackInclude]
public readonly T[] DenseValues

Field Value

T[]