Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


UnsafeParallelHashSet<T>

An unordered, expandable set of unique values.
Read time 1 minuteLast updated 18 days ago

Definition

public struct UnsafeParallelHashSet<T> : INativeDisposable, IDisposable, IEnumerable<T>, IEnumerable where T : unmanaged, IEquatable<T>

Static Fields

Value

Description

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

Constructors

Constructor

Description

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

Properties

Property

Description

CapacityThe number of values that fit in the current allocation.
IsCreatedWhether this set has been allocated (and not yet deallocated).
IsEmptyWhether this set is empty.

Methods

Method

Description

AddAdds a new item. If the item is already present in the collection, this method should throw, but currently does not! Instead, it returns false without replacing said item.
AsParallelWriterReturns a parallel writer.
AsReadOnlyReturns a readonly version of this UnsafeParallelHashSet instance.
ClearRemoves all values.
ContainsReturns true if a particular value is present.
CountReturns the current number of values in this set.
DisposeReleases all resources (memory).
GetEnumeratorReturns an enumerator over the values of this set.
RemoveRemoves a particular value.
ToNativeArrayReturns an array with a copy of this set's values (in no particular order).
TryAddAdds a new value. If the item is already present, this method returns false without replacing said item.

Structs

Struct

Description

UnsafeParallelHashSet<T>.EnumeratorAn enumerator over the values of a set.
UnsafeParallelHashSet<T>.ParallelWriterA parallel writer for an UnsafeParallelHashSet.
UnsafeParallelHashSet<T>.ReadOnlyA read-only alias for the value of a UnsafeParallelHashSet. Does not have its own allocated storage.