Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


NativeParallelHashMap<TKey, TValue>

An unordered, expandable associative array.
Read time 2 minutesLast updated 7 days ago

Definition

public struct NativeParallelHashMap<TKey, TValue> : INativeDisposable, IDisposable, IEnumerable<KeyValue<TKey, TValue>>, IEnumerable where TKey : unmanaged, IEquatable<TKey> where TValue : unmanaged

Static Fields

Value

Description

MaxCapacityThe maximum number of elements this type of container can hold.

Constructors

Constructor

Description

NativeParallelHashMap`2(System.Int32,Unity.Collections.AllocatorManager.AllocatorHandle)Initializes and returns an instance of NativeParallelHashMap.

Properties

Property

Description

CapacityThe number of key-value pairs that fit in the current allocation.
IsCreatedWhether this hash map has been allocated (and not yet deallocated).
IsEmptyWhether this hash map is empty.
this[]Gets and sets values by key.

Methods

Method

Description

AddAdds a new key-value pair.
AsParallelWriterReturns a parallel writer for this hash map.
AsReadOnlyReturns a readonly version of this NativeParallelHashMap instance.
ClearRemoves all key-value pairs.
ContainsKeyReturns true if a given key is present in this hash map.
CountThe current number of key-value pairs in this hash map.
DisposeReleases all resources (memory and safety handles).
GetEnumeratorReturns an enumerator over the key-value pairs of this hash map.
GetKeyArrayReturns an array with a copy of all this hash map's keys (in no particular order).
GetKeyValueArraysReturns a NativeKeyValueArrays with a copy of all this hash map's keys and values.
GetValueArrayReturns an array with a copy of all this hash map's values (in no particular order).
RemoveRemoves a key-value pair.
TryAddAdds a new key-value pair.
TryGetValueReturns the value associated with a key.

Structs

Struct

Description

NativeParallelHashMap<TKey, TValue>.EnumeratorAn enumerator over the key-value pairs of a hash map.
NativeParallelHashMap<TKey, TValue>.ParallelWriterA parallel writer for a NativeParallelHashMap.
NativeParallelHashMap<TKey, TValue>.ReadOnlyA read-only alias for the value of a NativeParallelHashMap. Does not have its own allocated storage.