Struct SparseSet
An adapter collection for external data arrays that allows constant-time insertion, deletion, and lookup by handle, as well as array-like iteration.
Namespace: GDX.Collections
Syntax
public struct SparseSet
Constructors
| Improve this Doc View SourceSparseSet(Int32)
Create a SparseSet with an initialCapacity
.
Declaration
public SparseSet(int initialCapacity)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | initialCapacity | The initial capacity of the sparse and dense int arrays. |
SparseSet(Int32, out UInt64[])
Create a SparseSet with an initialCapacity
.
Declaration
public SparseSet(int initialCapacity, out ulong[] versionArray)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | initialCapacity | The initial capacity of the sparse and dense int arrays. |
System.UInt64[] | versionArray | Array containing version numbers to check sparse references against. |
Fields
| Improve this Doc View SourceCount
How many indices are being used currently?
Declaration
public int Count
Field Value
Type | Description |
---|---|
System.Int32 |
DenseArray
Holds references to the sparse array for swapping indices.
Declaration
public int[] DenseArray
Field Value
Type | Description |
---|---|
System.Int32[] |
FreeIndex
The first free (currently unused) index in the sparse array.
Declaration
public int FreeIndex
Field Value
Type | Description |
---|---|
System.Int32 |
SparseArray
Holds references to dense array indices.
Declaration
public int[] SparseArray
Field Value
Type | Description |
---|---|
System.Int32[] |
Remarks
Its own indices are claimed and freed via a free-list.
Methods
| Improve this Doc View SourceAddUnchecked(out Int32, out Int32)
Adds a sparse/dense index pair to the set without checking if the set needs to expand.
Declaration
public void AddUnchecked(out int sparseIndex, out int denseIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sparseIndex | The sparse index allocated. |
System.Int32 | denseIndex | The dense index allocated. |
AddUnchecked(out Int32, out Int32, UInt64[], out UInt64)
Adds a sparse/dense index pair to the set without checking if the set needs to expand.
Declaration
public void AddUnchecked(out int sparseIndex, out int denseIndex, ulong[] versionArray, out ulong version)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sparseIndex | The sparse index allocated. |
System.Int32 | denseIndex | The dense index allocated. |
System.UInt64[] | versionArray | The array containing the version number to check against. |
System.UInt64 | version | Enables detection of use-after-free errors when using the sparse index as a reference. |
AddUnchecked<T0>(T0, T0[])
Adds to the set without checking if the set needs to expand.
Declaration
public int AddUnchecked<T0>(T0 obj0, T0[] array0)
Parameters
Type | Name | Description |
---|---|---|
T0 | obj0 | |
T0[] | array0 |
Returns
Type | Description |
---|---|
System.Int32 | The sparse index allocated |
Type Parameters
Name | Description |
---|---|
T0 |
AddUnchecked<T0, T1>(T0, T0[], T1, T1[])
Adds to the set without checking if the set needs to expand.
Declaration
public int AddUnchecked<T0, T1>(T0 obj0, T0[] array0, T1 obj1, T1[] array1)
Parameters
Type | Name | Description |
---|---|---|
T0 | obj0 | |
T0[] | array0 | |
T1 | obj1 | |
T1[] | array1 |
Returns
Type | Description |
---|---|
System.Int32 | The sparse index allocated |
Type Parameters
Name | Description |
---|---|
T0 | |
T1 |
AddUnchecked<T0, T1, T2>(T0, T0[], T1, T1[], T2, T2[])
Adds to the set without checking if the set needs to expand.
Declaration
public int AddUnchecked<T0, T1, T2>(T0 obj0, T0[] array0, T1 obj1, T1[] array1, T2 obj2, T2[] array2)
Parameters
Type | Name | Description |
---|---|---|
T0 | obj0 | |
T0[] | array0 | |
T1 | obj1 | |
T1[] | array1 | |
T2 | obj2 | |
T2[] | array2 |
Returns
Type | Description |
---|---|
System.Int32 | The sparse index allocated |
Type Parameters
Name | Description |
---|---|
T0 | |
T1 | |
T2 |
AddUnchecked<T0, T1, T2, T3>(T0, T0[], T1, T1[], T2, T2[], T3, T3[])
Adds to the set without checking if the set needs to expand.
Declaration
public int AddUnchecked<T0, T1, T2, T3>(T0 obj0, T0[] array0, T1 obj1, T1[] array1, T2 obj2, T2[] array2, T3 obj3, T3[] array3)
Parameters
Type | Name | Description |
---|---|---|
T0 | obj0 | |
T0[] | array0 | |
T1 | obj1 | |
T1[] | array1 | |
T2 | obj2 | |
T2[] | array2 | |
T3 | obj3 | |
T3[] | array3 |
Returns
Type | Description |
---|---|
System.Int32 | The sparse index allocated |
Type Parameters
Name | Description |
---|---|
T0 | |
T1 | |
T2 | |
T3 |
AddUnchecked<T0, T1, T2, T3, T4>(T0, T0[], T1, T1[], T2, T2[], T3, T3[], T4, T4[])
Adds to the set without checking if the set needs to expand.
Declaration
public int AddUnchecked<T0, T1, T2, T3, T4>(T0 obj0, T0[] array0, T1 obj1, T1[] array1, T2 obj2, T2[] array2, T3 obj3, T3[] array3, T4 obj4, T4[] array4)
Parameters
Type | Name | Description |
---|---|---|
T0 | obj0 | |
T0[] | array0 | |
T1 | obj1 | |
T1[] | array1 | |
T2 | obj2 | |
T2[] | array2 | |
T3 | obj3 | |
T3[] | array3 | |
T4 | obj4 | |
T4[] | array4 |
Returns
Type | Description |
---|---|
System.Int32 | The sparse index allocated |
Type Parameters
Name | Description |
---|---|
T0 | |
T1 | |
T2 | |
T3 | |
T4 |
AddUnchecked<T0, T1, T2, T3, T4, T5>(T0, T0[], T1, T1[], T2, T2[], T3, T3[], T4, T4[], T5, T5[])
Adds to the set without checking if the set needs to expand.
Declaration
public int AddUnchecked<T0, T1, T2, T3, T4, T5>(T0 obj0, T0[] array0, T1 obj1, T1[] array1, T2 obj2, T2[] array2, T3 obj3, T3[] array3, T4 obj4, T4[] array4, T5 obj5, T5[] array5)
Parameters
Type | Name | Description |
---|---|---|
T0 | obj0 | |
T0[] | array0 | |
T1 | obj1 | |
T1[] | array1 | |
T2 | obj2 | |
T2[] | array2 | |
T3 | obj3 | |
T3[] | array3 | |
T4 | obj4 | |
T4[] | array4 | |
T5 | obj5 | |
T5[] | array5 |
Returns
Type | Description |
---|---|
System.Int32 | The sparse index allocated |
Type Parameters
Name | Description |
---|---|
T0 | |
T1 | |
T2 | |
T3 | |
T4 | |
T5 |
AddUnchecked<T0, T1, T2, T3, T4, T5, T6>(T0, T0[], T1, T1[], T2, T2[], T3, T3[], T4, T4[], T5, T5[], T6, T6[])
Adds to the set without checking if the set needs to expand.
Declaration
public int AddUnchecked<T0, T1, T2, T3, T4, T5, T6>(T0 obj0, T0[] array0, T1 obj1, T1[] array1, T2 obj2, T2[] array2, T3 obj3, T3[] array3, T4 obj4, T4[] array4, T5 obj5, T5[] array5, T6 obj6, T6[] array6)
Parameters
Type | Name | Description |
---|---|---|
T0 | obj0 | |
T0[] | array0 | |
T1 | obj1 | |
T1[] | array1 | |
T2 | obj2 | |
T2[] | array2 | |
T3 | obj3 | |
T3[] | array3 | |
T4 | obj4 | |
T4[] | array4 | |
T5 | obj5 | |
T5[] | array5 | |
T6 | obj6 | |
T6[] | array6 |
Returns
Type | Description |
---|---|
System.Int32 | The sparse index allocated |
Type Parameters
Name | Description |
---|---|
T0 | |
T1 | |
T2 | |
T3 | |
T4 | |
T5 | |
T6 |
AddUnchecked<T0, T1, T2, T3, T4, T5, T6, T7>(T0, T0[], T1, T1[], T2, T2[], T3, T3[], T4, T4[], T5, T5[], T6, T6[], T7, T7[])
Adds to the set without checking if the set needs to expand.
Declaration
public int AddUnchecked<T0, T1, T2, T3, T4, T5, T6, T7>(T0 obj0, T0[] array0, T1 obj1, T1[] array1, T2 obj2, T2[] array2, T3 obj3, T3[] array3, T4 obj4, T4[] array4, T5 obj5, T5[] array5, T6 obj6, T6[] array6, T7 obj7, T7[] array7)
Parameters
Type | Name | Description |
---|---|---|
T0 | obj0 | |
T0[] | array0 | |
T1 | obj1 | |
T1[] | array1 | |
T2 | obj2 | |
T2[] | array2 | |
T3 | obj3 | |
T3[] | array3 | |
T4 | obj4 | |
T4[] | array4 | |
T5 | obj5 | |
T5[] | array5 | |
T6 | obj6 | |
T6[] | array6 | |
T7 | obj7 | |
T7[] | array7 |
Returns
Type | Description |
---|---|
System.Int32 | The sparse index allocated |
Type Parameters
Name | Description |
---|---|
T0 | |
T1 | |
T2 | |
T3 | |
T4 | |
T5 | |
T6 | |
T7 |
AddWithExpandCheck(Int32, out Int32, out Int32)
Adds a sparse/dense index pair to the set and expands the arrays if necessary.
Declaration
public bool AddWithExpandCheck(int expandBy, out int sparseIndex, out int denseIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | expandBy | How many indices to expand by. |
System.Int32 | sparseIndex | The sparse index allocated. |
System.Int32 | denseIndex | The dense index allocated. |
Returns
Type | Description |
---|---|
System.Boolean | True if the index pool expanded. |
AddWithExpandCheck(Int32, out Int32, out Int32, ref UInt64[], out UInt64)
Adds a sparse/dense index pair to the set and expands the arrays if necessary.
Declaration
public bool AddWithExpandCheck(int expandBy, out int sparseIndex, out int denseIndex, ref ulong[] versionArray, out ulong version)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | expandBy | How many indices to expand by. |
System.Int32 | sparseIndex | The sparse index allocated. |
System.Int32 | denseIndex | The dense index allocated. |
System.UInt64[] | versionArray | The array containing the version number to check against. |
System.UInt64 | version | Enables detection of use-after-free errors when using the sparse index as a reference. |
Returns
Type | Description |
---|---|
System.Boolean | True if the index pool expanded. |
AddWithExpandCheck<T0>(T0, ref T0[], out Int32, Int32)
Adds a sparse/dense index pair to the set and expands the arrays if necessary.
Declaration
public bool AddWithExpandCheck<T0>(T0 obj0, ref T0[] array0, out int lookupIndex, int howMuchToExpand = 16)
Parameters
Type | Name | Description |
---|---|---|
T0 | obj0 | |
T0[] | array0 | |
System.Int32 | lookupIndex | |
System.Int32 | howMuchToExpand |
Returns
Type | Description |
---|---|
System.Boolean | True if the index pool expanded. |
Type Parameters
Name | Description |
---|---|
T0 |
AddWithExpandCheck<T0, T1>(T0, ref T0[], T1, ref T1[], out Int32, Int32)
Adds a sparse/dense index pair to the set and expands the arrays if necessary.
Declaration
public bool AddWithExpandCheck<T0, T1>(T0 obj0, ref T0[] array0, T1 obj1, ref T1[] array1, out int lookupIndex, int howMuchToExpand = 16)
Parameters
Type | Name | Description |
---|---|---|
T0 | obj0 | |
T0[] | array0 | |
T1 | obj1 | |
T1[] | array1 | |
System.Int32 | lookupIndex | |
System.Int32 | howMuchToExpand |
Returns
Type | Description |
---|---|
System.Boolean | True if the index pool expanded. |
Type Parameters
Name | Description |
---|---|
T0 | |
T1 |
AddWithExpandCheck<T0, T1, T2>(T0, ref T0[], T1, ref T1[], T2, ref T2[], out Int32, Int32)
Adds a sparse/dense index pair to the set and expands the arrays if necessary.
Declaration
public bool AddWithExpandCheck<T0, T1, T2>(T0 obj0, ref T0[] array0, T1 obj1, ref T1[] array1, T2 obj2, ref T2[] array2, out int lookupIndex, int howMuchToExpand = 16)
Parameters
Type | Name | Description |
---|---|---|
T0 | obj0 | |
T0[] | array0 | |
T1 | obj1 | |
T1[] | array1 | |
T2 | obj2 | |
T2[] | array2 | |
System.Int32 | lookupIndex | |
System.Int32 | howMuchToExpand |
Returns
Type | Description |
---|---|
System.Boolean | True if the index pool expanded. |
Type Parameters
Name | Description |
---|---|
T0 | |
T1 | |
T2 |
AddWithExpandCheck<T0, T1, T2, T3>(T0, ref T0[], T1, ref T1[], T2, ref T2[], T3, ref T3[], out Int32, Int32)
Adds a sparse/dense index pair to the set and expands the arrays if necessary.
Declaration
public bool AddWithExpandCheck<T0, T1, T2, T3>(T0 obj0, ref T0[] array0, T1 obj1, ref T1[] array1, T2 obj2, ref T2[] array2, T3 obj3, ref T3[] array3, out int lookupIndex, int howMuchToExpand = 16)
Parameters
Type | Name | Description |
---|---|---|
T0 | obj0 | |
T0[] | array0 | |
T1 | obj1 | |
T1[] | array1 | |
T2 | obj2 | |
T2[] | array2 | |
T3 | obj3 | |
T3[] | array3 | |
System.Int32 | lookupIndex | |
System.Int32 | howMuchToExpand |
Returns
Type | Description |
---|---|
System.Boolean | True if the index pool expanded. |
Type Parameters
Name | Description |
---|---|
T0 | |
T1 | |
T2 | |
T3 |
AddWithExpandCheck<T0, T1, T2, T3, T4>(T0, ref T0[], T1, ref T1[], T2, ref T2[], T3, ref T3[], T4, ref T4[], out Int32, Int32)
Adds a sparse/dense index pair to the set and expands the arrays if necessary.
Declaration
public bool AddWithExpandCheck<T0, T1, T2, T3, T4>(T0 obj0, ref T0[] array0, T1 obj1, ref T1[] array1, T2 obj2, ref T2[] array2, T3 obj3, ref T3[] array3, T4 obj4, ref T4[] array4, out int lookupIndex, int howMuchToExpand = 16)
Parameters
Type | Name | Description |
---|---|---|
T0 | obj0 | |
T0[] | array0 | |
T1 | obj1 | |
T1[] | array1 | |
T2 | obj2 | |
T2[] | array2 | |
T3 | obj3 | |
T3[] | array3 | |
T4 | obj4 | |
T4[] | array4 | |
System.Int32 | lookupIndex | |
System.Int32 | howMuchToExpand |
Returns
Type | Description |
---|---|
System.Boolean | True if the index pool expanded. |
Type Parameters
Name | Description |
---|---|
T0 | |
T1 | |
T2 | |
T3 | |
T4 |
AddWithExpandCheck<T0, T1, T2, T3, T4, T5>(T0, ref T0[], T1, ref T1[], T2, ref T2[], T3, ref T3[], T4, ref T4[], T5, ref T5[], out Int32, Int32)
Adds a sparse/dense index pair to the set and expands the arrays if necessary.
Declaration
public bool AddWithExpandCheck<T0, T1, T2, T3, T4, T5>(T0 obj0, ref T0[] array0, T1 obj1, ref T1[] array1, T2 obj2, ref T2[] array2, T3 obj3, ref T3[] array3, T4 obj4, ref T4[] array4, T5 obj5, ref T5[] array5, out int lookupIndex, int howMuchToExpand = 16)
Parameters
Type | Name | Description |
---|---|---|
T0 | obj0 | |
T0[] | array0 | |
T1 | obj1 | |
T1[] | array1 | |
T2 | obj2 | |
T2[] | array2 | |
T3 | obj3 | |
T3[] | array3 | |
T4 | obj4 | |
T4[] | array4 | |
T5 | obj5 | |
T5[] | array5 | |
System.Int32 | lookupIndex | |
System.Int32 | howMuchToExpand |
Returns
Type | Description |
---|---|
System.Boolean | True if the index pool expanded. |
Type Parameters
Name | Description |
---|---|
T0 | |
T1 | |
T2 | |
T3 | |
T4 | |
T5 |
AddWithExpandCheck<T0, T1, T2, T3, T4, T5, T6>(T0, ref T0[], T1, ref T1[], T2, ref T2[], T3, ref T3[], T4, ref T4[], T5, ref T5[], T6, ref T6[], out Int32, Int32)
Adds a sparse/dense index pair to the set and expands the arrays if necessary.
Declaration
public bool AddWithExpandCheck<T0, T1, T2, T3, T4, T5, T6>(T0 obj0, ref T0[] array0, T1 obj1, ref T1[] array1, T2 obj2, ref T2[] array2, T3 obj3, ref T3[] array3, T4 obj4, ref T4[] array4, T5 obj5, ref T5[] array5, T6 obj6, ref T6[] array6, out int lookupIndex, int howMuchToExpand = 16)
Parameters
Type | Name | Description |
---|---|---|
T0 | obj0 | |
T0[] | array0 | |
T1 | obj1 | |
T1[] | array1 | |
T2 | obj2 | |
T2[] | array2 | |
T3 | obj3 | |
T3[] | array3 | |
T4 | obj4 | |
T4[] | array4 | |
T5 | obj5 | |
T5[] | array5 | |
T6 | obj6 | |
T6[] | array6 | |
System.Int32 | lookupIndex | |
System.Int32 | howMuchToExpand |
Returns
Type | Description |
---|---|
System.Boolean | True if the index pool expanded. |
Type Parameters
Name | Description |
---|---|
T0 | |
T1 | |
T2 | |
T3 | |
T4 | |
T5 | |
T6 |
AddWithExpandCheck<T0, T1, T2, T3, T4, T5, T6, T7>(T0, ref T0[], T1, ref T1[], T2, ref T2[], T3, ref T3[], T4, ref T4[], T5, ref T5[], T6, ref T6[], T7, ref T7[], out Int32, Int32)
Adds a sparse/dense index pair to the set and expands the arrays if necessary.
Declaration
public bool AddWithExpandCheck<T0, T1, T2, T3, T4, T5, T6, T7>(T0 obj0, ref T0[] array0, T1 obj1, ref T1[] array1, T2 obj2, ref T2[] array2, T3 obj3, ref T3[] array3, T4 obj4, ref T4[] array4, T5 obj5, ref T5[] array5, T6 obj6, ref T6[] array6, T7 obj7, ref T7[] array7, out int lookupIndex, int howMuchToExpand = 16)
Parameters
Type | Name | Description |
---|---|---|
T0 | obj0 | |
T0[] | array0 | |
T1 | obj1 | |
T1[] | array1 | |
T2 | obj2 | |
T2[] | array2 | |
T3 | obj3 | |
T3[] | array3 | |
T4 | obj4 | |
T4[] | array4 | |
T5 | obj5 | |
T5[] | array5 | |
T6 | obj6 | |
T6[] | array6 | |
T7 | obj7 | |
T7[] | array7 | |
System.Int32 | lookupIndex | |
System.Int32 | howMuchToExpand |
Returns
Type | Description |
---|---|
System.Boolean | True if the index pool expanded. |
Type Parameters
Name | Description |
---|---|
T0 | |
T1 | |
T2 | |
T3 | |
T4 | |
T5 | |
T6 | |
T7 |
Clear()
Clear the dense and sparse arrays.
Declaration
public void Clear()
Clear(UInt64[])
Clear the dense and sparse arrays.
Declaration
public void Clear(ulong[] versionArray)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64[] | versionArray | Array containing version numbers to check against. |
ClearWithVersionArrayReset(UInt64[])
Clear the dense and sparse arrays and reset the version array. Note: Only clear the version array if you are sure there are no outstanding dependencies on version numbers.
Declaration
public void ClearWithVersionArrayReset(ulong[] versionArray)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64[] | versionArray | Array containing version numbers to check against. |
Expand(Int32)
Reallocate the dense and sparse arrays with additional capacity.
Declaration
public void Expand(int extraCapacity)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | extraCapacity | How many indices to expand the dense and sparse arrays by. |
Expand(Int32, ref UInt64[])
Reallocate the dense and sparse arrays with additional capacity.
Declaration
public void Expand(int extraCapacity, ref ulong[] versionArray)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | extraCapacity | How many indices to expand the dense and sparse arrays by. |
System.UInt64[] | versionArray | Array containing version numbers to check against. |
GetDenseIndexUnchecked(Int32)
Gets the value of the sparse array at the given index without any data validation.
Declaration
public int GetDenseIndexUnchecked(int sparseIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sparseIndex | The index to check in the sparse array. |
Returns
Type | Description |
---|---|
System.Int32 | The dense index at the given sparse index. |
GetDenseIndexWithBoundsAndVersionCheck(Int32, UInt64, UInt64[])
Gets the value of the sparse array at the given index, or -1 if the given sparse index is invalid..
Declaration
public int GetDenseIndexWithBoundsAndVersionCheck(int sparseIndex, ulong version, ulong[] versionArray)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sparseIndex | The index in the sparse array to check against. |
System.UInt64 | version | The version number associated with the sparse index. |
System.UInt64[] | versionArray | The array containing the version number to check against. |
Returns
Type | Description |
---|---|
System.Int32 | The dense index pointed to by the current sparse index, or -1 if invalid. |
GetDenseIndexWithBoundsCheck(Int32)
Gets the value of the sparse array at the given index, or -1 if the dense and sparse indices don't point to each other or if the dense index is outside the dense bounds.
Declaration
public int GetDenseIndexWithBoundsCheck(int sparseIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sparseIndex | The index in the sparse array to check against. |
Returns
Type | Description |
---|---|
System.Int32 | The dense index pointed to by the current sparse index, or -1 if invalid. |
GetDenseIndexWithVersionCheck(Int32, UInt64, UInt64[])
Gets the value of the sparse array at the given index, or -1 if the version number does not match.
Declaration
public int GetDenseIndexWithVersionCheck(int sparseIndex, ulong version, ulong[] versionArray)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sparseIndex | The index in the sparse array to check against. |
System.UInt64 | version | The version number associated with the sparse index. |
System.UInt64[] | versionArray | The array containing the version number to check against. |
Returns
Type | Description |
---|---|
System.Int32 | The dense index pointed to by the current sparse index, or -1 if invalid. |
RemoveUnchecked(Int32)
Removes the associated sparse/dense index pair from active use.
Declaration
public void RemoveUnchecked(int sparseIndexToRemove)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sparseIndexToRemove | The sparse index to remove. |
RemoveUnchecked(Int32, out Int32, out Int32)
Removes the associated sparse/dense index pair from active use. Out parameters used to manage parallel data arrays.
Declaration
public void RemoveUnchecked(int sparseIndexToRemove, out int indexToSwapFrom, out int indexToSwapTo)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sparseIndexToRemove | The sparse index to remove. |
System.Int32 | indexToSwapFrom | Set the data array value at this index to default after swapping with the data array value at indexToSwapTo. |
System.Int32 | indexToSwapTo | Replace the data array value at this index with the data array value at indexToSwapFrom. |
RemoveUnchecked(Int32, UInt64[], out Int32, out Int32)
Removes the associated sparse/dense index pair from active use and increments the version. Out parameters used to manage parallel data arrays.
Declaration
public void RemoveUnchecked(int sparseIndexToRemove, ulong[] versionArray, out int indexToSwapFrom, out int indexToSwapTo)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sparseIndexToRemove | The sparse index to remove. |
System.UInt64[] | versionArray | The array where version numbers to check against are stored. |
System.Int32 | indexToSwapFrom | Set the data array value at this index to default after swapping with the data array value at indexToSwapTo. |
System.Int32 | indexToSwapTo | Replace the data array value at this index with the data array value at indexToSwapFrom. |
RemoveUnchecked<T0>(Int32, T0[])
Declaration
public void RemoveUnchecked<T0>(int sparseIndexToRemove, T0[] array0)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sparseIndexToRemove | |
T0[] | array0 |
Type Parameters
Name | Description |
---|---|
T0 |
RemoveUnchecked<T0, T1>(Int32, T0[], T1[])
Declaration
public void RemoveUnchecked<T0, T1>(int sparseIndexToRemove, T0[] array0, T1[] array1)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sparseIndexToRemove | |
T0[] | array0 | |
T1[] | array1 |
Type Parameters
Name | Description |
---|---|
T0 | |
T1 |
RemoveUnchecked<T0, T1, T2>(Int32, T0[], T1[], T2[])
Declaration
public void RemoveUnchecked<T0, T1, T2>(int sparseIndexToRemove, T0[] array0, T1[] array1, T2[] array2)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sparseIndexToRemove | |
T0[] | array0 | |
T1[] | array1 | |
T2[] | array2 |
Type Parameters
Name | Description |
---|---|
T0 | |
T1 | |
T2 |
RemoveUnchecked<T0, T1, T2, T3>(Int32, T0[], T1[], T2[], T3[])
Declaration
public void RemoveUnchecked<T0, T1, T2, T3>(int sparseIndexToRemove, T0[] array0, T1[] array1, T2[] array2, T3[] array3)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sparseIndexToRemove | |
T0[] | array0 | |
T1[] | array1 | |
T2[] | array2 | |
T3[] | array3 |
Type Parameters
Name | Description |
---|---|
T0 | |
T1 | |
T2 | |
T3 |
RemoveUnchecked<T0, T1, T2, T3, T4>(Int32, T0[], T1[], T2[], T3[], T4[])
Declaration
public void RemoveUnchecked<T0, T1, T2, T3, T4>(int sparseIndexToRemove, T0[] array0, T1[] array1, T2[] array2, T3[] array3, T4[] array4)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sparseIndexToRemove | |
T0[] | array0 | |
T1[] | array1 | |
T2[] | array2 | |
T3[] | array3 | |
T4[] | array4 |
Type Parameters
Name | Description |
---|---|
T0 | |
T1 | |
T2 | |
T3 | |
T4 |
RemoveUnchecked<T0, T1, T2, T3, T4, T5>(Int32, T0[], T1[], T2[], T3[], T4[], T5[])
Declaration
public void RemoveUnchecked<T0, T1, T2, T3, T4, T5>(int sparseIndexToRemove, T0[] array0, T1[] array1, T2[] array2, T3[] array3, T4[] array4, T5[] array5)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sparseIndexToRemove | |
T0[] | array0 | |
T1[] | array1 | |
T2[] | array2 | |
T3[] | array3 | |
T4[] | array4 | |
T5[] | array5 |
Type Parameters
Name | Description |
---|---|
T0 | |
T1 | |
T2 | |
T3 | |
T4 | |
T5 |
RemoveUnchecked<T0, T1, T2, T3, T4, T5, T6>(Int32, T0[], T1[], T2[], T3[], T4[], T5[], T6[])
Declaration
public void RemoveUnchecked<T0, T1, T2, T3, T4, T5, T6>(int sparseIndexToRemove, T0[] array0, T1[] array1, T2[] array2, T3[] array3, T4[] array4, T5[] array5, T6[] array6)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sparseIndexToRemove | |
T0[] | array0 | |
T1[] | array1 | |
T2[] | array2 | |
T3[] | array3 | |
T4[] | array4 | |
T5[] | array5 | |
T6[] | array6 |
Type Parameters
Name | Description |
---|---|
T0 | |
T1 | |
T2 | |
T3 | |
T4 | |
T5 | |
T6 |
RemoveUnchecked<T0, T1, T2, T3, T4, T5, T6, T7>(Int32, T0[], T1[], T2[], T3[], T4[], T5[], T6[], T7[])
Declaration
public void RemoveUnchecked<T0, T1, T2, T3, T4, T5, T6, T7>(int sparseIndexToRemove, T0[] array0, T1[] array1, T2[] array2, T3[] array3, T4[] array4, T5[] array5, T6[] array6, T7[] array7)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sparseIndexToRemove | |
T0[] | array0 | |
T1[] | array1 | |
T2[] | array2 | |
T3[] | array3 | |
T4[] | array4 | |
T5[] | array5 | |
T6[] | array6 | |
T7[] | array7 |
Type Parameters
Name | Description |
---|---|
T0 | |
T1 | |
T2 | |
T3 | |
T4 | |
T5 | |
T6 | |
T7 |
RemoveUncheckedFromDenseIndex(Int32)
Removes the associated sparse/dense index pair from active use.
Declaration
public void RemoveUncheckedFromDenseIndex(int denseIndexToRemove)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | denseIndexToRemove | The dense index associated with the sparse index to remove. |
RemoveUncheckedFromDenseIndex(Int32, out Int32)
Removes the associated sparse/dense index pair from active use. Out parameter used to manage parallel data arrays.
Declaration
public void RemoveUncheckedFromDenseIndex(int denseIndexToRemove, out int indexToSwapFrom)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | denseIndexToRemove | The sparse index to remove. |
System.Int32 | indexToSwapFrom | Set the data array value at this index to default after swapping with the data array value at denseIndexToRemove. |
RemoveUncheckedFromDenseIndex(Int32, UInt64[])
Removes the associated sparse/dense index pair from active use.
Declaration
public void RemoveUncheckedFromDenseIndex(int denseIndexToRemove, ulong[] versionArray)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | denseIndexToRemove | The dense index associated with the sparse index to remove. |
System.UInt64[] | versionArray | The array where version numbers to check against are stored. |
RemoveUncheckedFromDenseIndex(Int32, UInt64[], out Int32)
Removes the associated sparse/dense index pair from active use. Out parameter used to manage parallel data arrays.
Declaration
public void RemoveUncheckedFromDenseIndex(int denseIndexToRemove, ulong[] versionArray, out int indexToSwapFrom)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | denseIndexToRemove | The sparse index to remove. |
System.UInt64[] | versionArray | The array where version numbers to check against are stored. |
System.Int32 | indexToSwapFrom | Set the data array value at this index to default after swapping with the data array value at denseIndexToRemove. |
RemoveWithBoundsAndVersionChecks(ref Int32, UInt64, UInt64[], out Int32, out Int32)
Removes the allocated entry corresponding to the sparse index.
Declaration
public bool RemoveWithBoundsAndVersionChecks(ref int sparseIndexToRemove, ulong version, ulong[] versionArray, out int dataIndexToSwapFrom, out int dataIndexToSwapTo)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sparseIndexToRemove | The sparse index corresponding to the entry to remove. |
System.UInt64 | version | The version number of the int used to access the sparse index. Used to guard against erroneously accessing freed indices currently in use with an outdated reference. |
System.UInt64[] | versionArray | The array where version numbers to check against are stored. |
System.Int32 | dataIndexToSwapFrom | Set the data array value at this index to default after swapping with the data array value at dataIndexToSwapTo. |
System.Int32 | dataIndexToSwapTo | Replace the data array value at this index with the data array value at indexToSwapFrom. |
Returns
Type | Description |
---|---|
System.Boolean | True if the entry was valid and thus removed. |
RemoveWithBoundsCheck(ref Int32, out Int32, out Int32)
Frees the allocated entry corresponding to the sparse index. WARNING: Will not protect against accidentally removing twice if the index in question was recycled between Remove calls.
The sparse index corresponding to the entry to remove. Replace the data array value at this index with the data array value at indexToSwapFrom. Set the data array value at this index to default after swapping with the data array value at dataIndexToSwapTo.Declaration
public bool RemoveWithBoundsCheck(ref int sparseIndexToRemove, out int dataIndexToSwapFrom, out int dataIndexToSwapTo)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sparseIndexToRemove | |
System.Int32 | dataIndexToSwapFrom | |
System.Int32 | dataIndexToSwapTo |
Returns
Type | Description |
---|---|
System.Boolean | True if the entry was valid and thus removed. |
RemoveWithVersionCheck(Int32, UInt64, UInt64[], out Int32, out Int32)
Removes the allocated entry corresponding to the sparse index. Indicates which dense indices were swapped as a result of removing the entry.
Declaration
public bool RemoveWithVersionCheck(int sparseIndexToRemove, ulong version, ulong[] versionArray, out int dataIndexToSwapFrom, out int dataIndexToSwapTo)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sparseIndexToRemove | The sparse index to remove. |
System.UInt64 | version | The version number of the int used to access the sparse index. Used to guard against accessing indices that have been removed and reused. |
System.UInt64[] | versionArray | The array where version numbers to check against are stored. |
System.Int32 | dataIndexToSwapFrom | Set the data array value at this index to default after swapping with the data array value at dataIndexToSwapTo. |
System.Int32 | dataIndexToSwapTo | Replace the data array value at this index with the data array value at indexToSwapFrom. |
Returns
Type | Description |
---|---|
System.Boolean | Whether or not the remove attempt succeeded. |
Reserve(Int32)
Declaration
public void Reserve(int numberToReserve)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | numberToReserve |
Reserve(Int32, ref UInt64[])
Declaration
public void Reserve(int numberToReserve, ref ulong[] versionArray)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | numberToReserve | |
System.UInt64[] | versionArray |