C# Class Unity.Collections.NativeList

Afficher le fichier Open project: needle-mirror/com.unity.collections Class Usage Examples

Méthodes publiques

Méthode Description
Add ( ) : void

Adds an element to the list.

If the list has reached its current capacity, it copies the original, internal array to a new, larger array, and then deallocates the original.

AddNoResize ( value ) : void

Adds an element to the list.

If the list has reached its current capacity, internal array won't be resized, and exception will be thrown.

AddRangeNoResize ( NativeList list ) : void

Adds elements from a list to this list.

If the list has reached its current capacity, internal array won't be resized, and exception will be thrown.

AddRangeNoResize ( void* ptr, int length ) : void

Adds elements from a buffer to this list.

If the list has reached its current capacity, internal array won't be resized, and exception will be thrown.

GetUnsafeList ( ) : UnsafeList*

Return internal UnsafeList*

NativeList ( Allocator allocator ) : System

Constructs a new list using the specified type of memory allocation.

The list initially has a capacity of one. To avoid reallocating memory for the list, specify sufficient capacity up front.

NativeList ( int initialCapacity, Allocator allocator ) : System

Constructs a new list with the specified initial capacity and type of memory allocation.

this ( int index ) : T

Retrieve a member of the contaner by index.

Private Methods

Méthode Description
CreateStaticSafetyId ( ) : void
ElementAt ( int index ) : T

Initialize ( int initialCapacity, &allocator, int disposeSentinelStackDepth ) : void
NativeList ( int initialCapacity, Allocator allocator, int disposeSentinelStackDepth ) : System
New ( int initialCapacity, &allocator ) : NativeList
New ( int initialCapacity, &allocator, int disposeSentinelStackDepth ) : NativeList

Method Details

Add() public méthode

Adds an element to the list.
If the list has reached its current capacity, it copies the original, internal array to a new, larger array, and then deallocates the original.
public Add ( ) : void
Résultat void

AddNoResize() public méthode

Adds an element to the list.
If the list has reached its current capacity, internal array won't be resized, and exception will be thrown.
public AddNoResize ( value ) : void
value The value to be added at the end of the list.
Résultat void

AddRangeNoResize() public méthode

Adds elements from a list to this list.
If the list has reached its current capacity, internal array won't be resized, and exception will be thrown.
public AddRangeNoResize ( NativeList list ) : void
list NativeList Other container to copy elements from.
Résultat void

AddRangeNoResize() public méthode

Adds elements from a buffer to this list.
If the list has reached its current capacity, internal array won't be resized, and exception will be thrown.
Thrown if length is negative.
public AddRangeNoResize ( void* ptr, int length ) : void
ptr void* A pointer to the buffer.
length int The number of elements to add to the list.
Résultat void

GetUnsafeList() public méthode

Return internal UnsafeList*
public GetUnsafeList ( ) : UnsafeList*
Résultat UnsafeList*

NativeList() public méthode

Constructs a new list using the specified type of memory allocation.
The list initially has a capacity of one. To avoid reallocating memory for the list, specify sufficient capacity up front.
public NativeList ( Allocator allocator ) : System
allocator Allocator A member of the /// [Unity.Collections.Allocator](https://docs.unity3d.com/ScriptReference/Unity.Collections.Allocator.html) enumeration.
Résultat System

NativeList() public méthode

Constructs a new list with the specified initial capacity and type of memory allocation.
public NativeList ( int initialCapacity, Allocator allocator ) : System
initialCapacity int The initial capacity of the list. If the list grows larger than its capacity, /// the internal array is copied to a new, larger array.
allocator Allocator A member of the /// [Unity.Collections.Allocator](https://docs.unity3d.com/ScriptReference/Unity.Collections.Allocator.html) enumeration.
Résultat System

this() public méthode

Retrieve a member of the contaner by index.
Thrown if index is negative or >= to .
public this ( int index ) : T
index int The zero-based index into the list.
Résultat T