NativeFixedList
NameSpace: MagicLeap
Has List-like semantics (Capacity and Length) using a NativeArray as the backing store. The NativeArray is never resized. This is useful for times you don't know how big the array will be, but there is a definite upper bound. This list supports duck-typed foreach Enumerator semantics. More...
Inherits from:
IEquatable< NativeFixedList< T >>,
IDisposable
Detailed Description
package template <T > struct NativeFixedList : IEquatable< NativeFixedList< T >>
Public Fields
Capacity
public int Capacity { get; set; }
IsCreated
public bool IsCreated { get; set; }
Length
public int Length { get; set; }
this[int index]
public T this[int index] { get; set; }
Public Methods
void Add
public void Add(
T item
)
Parameters
Type | Name | Description |
---|---|---|
T | item |
void Clear
public void Clear()
void CopyTo
Copies the contents of this list to another NativeArray. destination must have the same Length as this list.
public void CopyTo(
NativeArray< T > destination
)
Parameters
Type | Name | Description |
---|---|---|
NativeArray< T > | destination | The destination array |
void Dispose
public void Dispose()
override bool Equals
public override bool Equals(
object obj
)
Parameters
Type | Name | Description |
---|---|---|
object | obj |
bool Equals
public bool Equals(
NativeFixedList< T > other
)
Parameters
Type | Name | Description |
---|---|---|
NativeFixedList< T > | other |
Enumerator GetEnumerator
public Enumerator GetEnumerator()
override int GetHashCode
public override int GetHashCode()
NativeFixedList
Allocates a new NativeFixedList with Capacity . Caller must Dispose the array when no longer needed.
public NativeFixedList(
int Capacity,
Allocator allocator
)
Parameters
Type | Name | Description |
---|---|---|
int | Capacity | |
Allocator | allocator |
NativeFixedList
Create a NativeFixedList from an existing NativeArray and a length. This NativeFixedList now owns the memory and should be Disposed when finished.
public NativeFixedList(
NativeArray< T > other,
int length
)
Parameters
Type | Name | Description |
---|---|---|
NativeArray< T > | other | The array to take ownership of |
int | length | The number of elements actually used by the NativeArray |
bool operator!=
public static bool operator!=(
NativeFixedList< T > lhs,
NativeFixedList< T > rhs
)
Parameters
Type | Name | Description |
---|---|---|
NativeFixedList< T > | lhs | |
NativeFixedList< T > | rhs |
bool operator==
public static bool operator==(
NativeFixedList< T > lhs,
NativeFixedList< T > rhs
)
Parameters
Type | Name | Description |
---|---|---|
NativeFixedList< T > | lhs | |
NativeFixedList< T > | rhs |
Public Attributes
m_NativeArray
public NativeArray< T > m_NativeArray;