Table of Contents

Struct HashMapHelper<TKey>

Namespace
Misaki.HighPerformance.LowLevel.Collections
Assembly
Misaki.HighPerformance.LowLevel.dll
public struct HashMapHelper<TKey> : IDisposable where TKey : unmanaged, IEquatable<TKey>

Type Parameters

TKey
Implements
Inherited Members

Constructors

HashMapHelper(int, int, int, uint, AllocationHandle, AllocationOption)

public HashMapHelper(int capacity, int sizeOfTValue, int alignOfTValue, uint minGrowth, AllocationHandle handle, AllocationOption allocationOption)

Parameters

capacity int
sizeOfTValue int
alignOfTValue int
minGrowth uint
handle AllocationHandle
allocationOption AllocationOption

Fields

MINIMAL_CAPACITY

public const int MINIMAL_CAPACITY = 64

Field Value

int

Properties

Buffer

public readonly byte* Buffer { get; }

Property Value

byte*

Capacity

public readonly int Capacity { get; }

Property Value

int

Count

public readonly int Count { get; }

Property Value

int

IsCreated

public readonly bool IsCreated { get; }

Property Value

bool

IsEmpty

public readonly bool IsEmpty { get; }

Property Value

bool

Methods

Add(scoped in TKey)

public int Add(scoped in TKey key)

Parameters

key TKey

Returns

int

Clear()

public void Clear()

CountValuesForKey(scoped in TKey)

public int CountValuesForKey(scoped in TKey key)

Parameters

key TKey

Returns

int

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Find(scoped in TKey)

public int Find(scoped in TKey key)

Parameters

key TKey

Returns

int

FindNext(int, scoped in TKey)

public int FindNext(int entryIdx, scoped in TKey key)

Parameters

entryIdx int
key TKey

Returns

int

GetKeyValueArrays<TValue>(AllocationHandle)

public UnsafeArray<KeyValuePair<TKey, TValue>> GetKeyValueArrays<TValue>(AllocationHandle allocator) where TValue : unmanaged

Parameters

allocator AllocationHandle

Returns

UnsafeArray<KeyValuePair<TKey, TValue>>

Type Parameters

TValue

GetValueRefOrAddDefault<TValue>(scoped in TKey, out bool)

public ref TValue GetValueRefOrAddDefault<TValue>(scoped in TKey key, out bool exists) where TValue : unmanaged

Parameters

key TKey
exists bool

Returns

TValue

Type Parameters

TValue

GetValueRef<TValue>(scoped in TKey, out bool)

public ref TValue GetValueRef<TValue>(scoped in TKey key, out bool exists) where TValue : unmanaged

Parameters

key TKey
exists bool

Returns

TValue

Type Parameters

TValue

MoveNext(ref int, ref int, out int)

public bool MoveNext(ref int bucketIndex, ref int nextIndex, out int index)

Parameters

bucketIndex int
nextIndex int
index int

Returns

bool

MoveNextSearch(ref int, ref int, out int)

public bool MoveNextSearch(ref int bucketIndex, ref int nextIndex, out int index)

Parameters

bucketIndex int
nextIndex int
index int

Returns

bool

RemoveAll(scoped in TKey)

public int RemoveAll(scoped in TKey key)

Parameters

key TKey

Returns

int

Resize(int)

public void Resize(int newCapacity)

Parameters

newCapacity int

TrimExcess()

public void TrimExcess()

TryAdd(scoped in TKey)

public int TryAdd(scoped in TKey key)

Parameters

key TKey

Returns

int

TryGetValue<TValue>(scoped in TKey, out TValue)

public bool TryGetValue<TValue>(scoped in TKey key, out TValue item) where TValue : unmanaged

Parameters

key TKey
item TValue

Returns

bool

Type Parameters

TValue

TryRemove(scoped in TKey)

public int TryRemove(scoped in TKey key)

Parameters

key TKey

Returns

int