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
capacityintsizeOfTValueintalignOfTValueintminGrowthuinthandleAllocationHandleallocationOptionAllocationOption
Fields
MINIMAL_CAPACITY
public const int MINIMAL_CAPACITY = 64
Field Value
Properties
Buffer
public readonly byte* Buffer { get; }
Property Value
- byte*
Capacity
public readonly int Capacity { get; }
Property Value
Count
public readonly int Count { get; }
Property Value
IsCreated
public readonly bool IsCreated { get; }
Property Value
IsEmpty
public readonly bool IsEmpty { get; }
Property Value
Methods
Add(scoped in TKey)
public int Add(scoped in TKey key)
Parameters
keyTKey
Returns
Clear()
public void Clear()
CountValuesForKey(scoped in TKey)
public int CountValuesForKey(scoped in TKey key)
Parameters
keyTKey
Returns
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
keyTKey
Returns
FindNext(int, scoped in TKey)
public int FindNext(int entryIdx, scoped in TKey key)
Parameters
entryIdxintkeyTKey
Returns
GetKeyValueArrays<TValue>(AllocationHandle)
public UnsafeArray<KeyValuePair<TKey, TValue>> GetKeyValueArrays<TValue>(AllocationHandle allocator) where TValue : unmanaged
Parameters
allocatorAllocationHandle
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
keyTKeyexistsbool
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
keyTKeyexistsbool
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
Returns
MoveNextSearch(ref int, ref int, out int)
public bool MoveNextSearch(ref int bucketIndex, ref int nextIndex, out int index)
Parameters
Returns
RemoveAll(scoped in TKey)
public int RemoveAll(scoped in TKey key)
Parameters
keyTKey
Returns
Resize(int)
public void Resize(int newCapacity)
Parameters
newCapacityint
TrimExcess()
public void TrimExcess()
TryAdd(scoped in TKey)
public int TryAdd(scoped in TKey key)
Parameters
keyTKey
Returns
TryGetValue<TValue>(scoped in TKey, out TValue)
public bool TryGetValue<TValue>(scoped in TKey key, out TValue item) where TValue : unmanaged
Parameters
keyTKeyitemTValue
Returns
Type Parameters
TValue
TryRemove(scoped in TKey)
public int TryRemove(scoped in TKey key)
Parameters
keyTKey