Struct FixedListFloat128
An unmanaged, resizable list of float that does not allocate memory. It is 128 bytes in size, and contains all the memory it needs.
Namespace: Unity.Collections
Syntax
public struct FixedListFloat128 : INativeList<float>, IEnumerable<float>, IEnumerable, IEquatable<FixedListFloat32>, IComparable<FixedListFloat32>, IEquatable<FixedListFloat64>, IComparable<FixedListFloat64>, IEquatable<FixedListFloat128>, IComparable<FixedListFloat128>, IEquatable<FixedListFloat512>, IComparable<FixedListFloat512>, IEquatable<FixedListFloat4096>, IComparable<FixedListFloat4096>
Constructors
FixedListFloat128(FixedListFloat32)
Constructs a new FixedListFloat128 that is a copy of a FixedListFloat32.
Declaration
public FixedListFloat128(in FixedListFloat32 other)
Parameters
Type | Name | Description |
---|---|---|
FixedListFloat32 | other | The FixedListFloat32 to copy |
FixedListFloat128(FixedListFloat4096)
Constructs a new FixedListFloat128 that is a copy of a FixedListFloat4096.
Declaration
public FixedListFloat128(in FixedListFloat4096 other)
Parameters
Type | Name | Description |
---|---|---|
FixedListFloat4096 | other | The FixedListFloat4096 to copy |
FixedListFloat128(FixedListFloat512)
Constructs a new FixedListFloat128 that is a copy of a FixedListFloat512.
Declaration
public FixedListFloat128(in FixedListFloat512 other)
Parameters
Type | Name | Description |
---|---|---|
FixedListFloat512 | other | The FixedListFloat512 to copy |
FixedListFloat128(FixedListFloat64)
Constructs a new FixedListFloat128 that is a copy of a FixedListFloat64.
Declaration
public FixedListFloat128(in FixedListFloat64 other)
Parameters
Type | Name | Description |
---|---|---|
FixedListFloat64 | other | The FixedListFloat64 to copy |
Properties
Capacity
The number of items that can fit in the list.
Declaration
public int Capacity { get; set; }
Property Value
Type | Description |
---|---|
Int32 | The number of items that the list can hold. |
Implements
Remarks
Capacity specifies the number of items the list can currently hold. You can not change Capacity to fit more or fewer items.
IsEmpty
Reports whether container is empty.
Declaration
public bool IsEmpty { get; }
Property Value
Type | Description |
---|---|
Boolean | True if this container empty. |
Implements
Item[Int32]
Retrieve a member of the list by index.
Declaration
public float this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The zero-based index into the list. |
Property Value
Type | Description |
---|---|
Single | The list item at the specified index. |
Implements
Exceptions
Type | Condition |
---|---|
IndexOutOfRangeException | Thrown if index is negative or >= to Length. |
Length
The current number of items in the list.
Declaration
public int Length { get; set; }
Property Value
Type | Description |
---|---|
Int32 | The item length. |
Implements
Methods
Add(Single)
Adds an element to the list.
Declaration
public void Add(in float item)
Parameters
Type | Name | Description |
---|---|---|
Single | item | The float to be added at the end of the list. |
Exceptions
Type | Condition |
---|---|
IndexOutOfRangeException | Thrown if list is already full. See Capacity. |
AddNoResize(Single)
Adds an element to the list.
Declaration
public void AddNoResize(float item)
Parameters
Type | Name | Description |
---|---|---|
Single | item | The float to be added at the end of the list. |
Exceptions
Type | Condition |
---|---|
IndexOutOfRangeException | Thrown if list is already full. See Capacity. |
AddRange(Void*, Int32)
Adds elements from a buffer to this list.
Declaration
public void AddRange(void *ptr, int length)
Parameters
Type | Name | Description |
---|---|---|
Void* | ptr | A pointer to the buffer. |
Int32 | length | The number of elements to add to the list. |
AddRangeNoResize(Void*, Int32)
Adds elements from a buffer to this list.
Declaration
public void AddRangeNoResize(void *ptr, int length)
Parameters
Type | Name | Description |
---|---|---|
Void* | ptr | A pointer to the buffer. |
Int32 | length | The number of elements to add to the list. |
Clear()
Clears the list.
Declaration
public void Clear()
Implements
CompareTo(FixedListFloat128)
Compares this instance with a specified FixedListFloat128 and indicates whether this instance precedes, follows, or appears in the same position in the sort order as the specified FixedListFloat128.
Declaration
public int CompareTo(FixedListFloat128 other)
Parameters
Type | Name | Description |
---|---|---|
FixedListFloat128 | other | The specified FixedListFloat128 to compare with |
Returns
Type | Description |
---|---|
Int32 |
CompareTo(FixedListFloat32)
Compares this instance with a specified FixedListFloat32 and indicates whether this instance precedes, follows, or appears in the same position in the sort order as the specified FixedListFloat32.
Declaration
public int CompareTo(FixedListFloat32 other)
Parameters
Type | Name | Description |
---|---|---|
FixedListFloat32 | other | The specified FixedListFloat32 to compare with |
Returns
Type | Description |
---|---|
Int32 |
CompareTo(FixedListFloat4096)
Compares this instance with a specified FixedListFloat4096 and indicates whether this instance precedes, follows, or appears in the same position in the sort order as the specified FixedListFloat4096.
Declaration
public int CompareTo(FixedListFloat4096 other)
Parameters
Type | Name | Description |
---|---|---|
FixedListFloat4096 | other | The specified FixedListFloat4096 to compare with |
Returns
Type | Description |
---|---|
Int32 |
CompareTo(FixedListFloat512)
Compares this instance with a specified FixedListFloat512 and indicates whether this instance precedes, follows, or appears in the same position in the sort order as the specified FixedListFloat512.
Declaration
public int CompareTo(FixedListFloat512 other)
Parameters
Type | Name | Description |
---|---|---|
FixedListFloat512 | other | The specified FixedListFloat512 to compare with |
Returns
Type | Description |
---|---|
Int32 |
CompareTo(FixedListFloat64)
Compares this instance with a specified FixedListFloat64 and indicates whether this instance precedes, follows, or appears in the same position in the sort order as the specified FixedListFloat64.
Declaration
public int CompareTo(FixedListFloat64 other)
Parameters
Type | Name | Description |
---|---|---|
FixedListFloat64 | other | The specified FixedListFloat64 to compare with |
Returns
Type | Description |
---|---|
Int32 |
Contains(Single)
Determines whether an element is in the FixedListFloat128.
Declaration
public bool Contains(float item)
Parameters
Type | Name | Description |
---|---|---|
Single | item | The object to locate in the FixedListFloat128. |
Returns
Type | Description |
---|---|
Boolean |
ElementAt(Int32)
Declaration
public float ElementAt(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index |
Returns
Type | Description |
---|---|
Single |
Implements
Equals(Object)
Compares this instance with a specified object and indicates whether this instance is equal to the specified object.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj | The specified object to compare with for equality |
Returns
Type | Description |
---|---|
Boolean |
Overrides
Equals(FixedListFloat128)
Compares this instance with a specified FixedListFloat128 and indicates whether this instance is equal to the specified FixedListFloat128.
Declaration
public bool Equals(FixedListFloat128 other)
Parameters
Type | Name | Description |
---|---|---|
FixedListFloat128 | other | The specified FixedListFloat128 to compare with for equality |
Returns
Type | Description |
---|---|
Boolean |
Equals(FixedListFloat32)
Compares this instance with a specified FixedListFloat32 and indicates whether this instance is equal to the specified FixedListFloat32.
Declaration
public bool Equals(FixedListFloat32 other)
Parameters
Type | Name | Description |
---|---|---|
FixedListFloat32 | other | The specified FixedListFloat32 to compare with for equality |
Returns
Type | Description |
---|---|
Boolean |
Equals(FixedListFloat4096)
Compares this instance with a specified FixedListFloat4096 and indicates whether this instance is equal to the specified FixedListFloat4096.
Declaration
public bool Equals(FixedListFloat4096 other)
Parameters
Type | Name | Description |
---|---|---|
FixedListFloat4096 | other | The specified FixedListFloat4096 to compare with for equality |
Returns
Type | Description |
---|---|
Boolean |
Equals(FixedListFloat512)
Compares this instance with a specified FixedListFloat512 and indicates whether this instance is equal to the specified FixedListFloat512.
Declaration
public bool Equals(FixedListFloat512 other)
Parameters
Type | Name | Description |
---|---|---|
FixedListFloat512 | other | The specified FixedListFloat512 to compare with for equality |
Returns
Type | Description |
---|---|
Boolean |
Equals(FixedListFloat64)
Compares this instance with a specified FixedListFloat64 and indicates whether this instance is equal to the specified FixedListFloat64.
Declaration
public bool Equals(FixedListFloat64 other)
Parameters
Type | Name | Description |
---|---|---|
FixedListFloat64 | other | The specified FixedListFloat64 to compare with for equality |
Returns
Type | Description |
---|---|
Boolean |
GetEnumerator()
Returns an enumerator that iterates through a container.
Declaration
public FixedListFloat128.Enumerator GetEnumerator()
Returns
Type | Description |
---|---|
FixedListFloat128.Enumerator | An IEnumerator object that can be used to iterate through the container. |
GetHashCode()
Computes a hash code summary of the FixedListFloat128.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 |
Overrides
IndexOf(Single)
Searches for the specified float and returns the zero-based index of the first occurrence within the entire FixedListFloat128.
Declaration
public int IndexOf(float item)
Parameters
Type | Name | Description |
---|---|---|
Single | item | The float to locate in the FixedListFloat128. |
Returns
Type | Description |
---|---|
Int32 |
Insert(Int32, Single)
Inserts a single element into a FixedListFloat128 at a specified zero-based index.
Declaration
public void Insert(int index, float item)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The zero-based index at which the new element should be inserted. |
Single | item | The element to insert |
InsertRangeWithBeginEnd(Int32, Int32)
Inserts a number of items into a FixedListFloat128 at a specified zero-based index.
Declaration
public void InsertRangeWithBeginEnd(int begin, int end)
Parameters
Type | Name | Description |
---|---|---|
Int32 | begin | The zero-based index at which the new elements should be inserted. |
Int32 | end | The zero-based index just after where the elements should be removed. |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown if end argument is less than begin argument. |
ArgumentOutOfRangeException | Thrown if begin or end arguments are not positive or out of bounds. |
Remove(Single)
Searches for the specified float from the begining of the FixedListFloat128 forward, removes it if possible, and returns true if the float was successfully removed.
Declaration
public bool Remove(float item)
Parameters
Type | Name | Description |
---|---|---|
Single | item | The float to locate in the FixedListFloat128 |
Returns
Type | Description |
---|---|
Boolean | Returns true if item is removed. |
RemoveAt(Int32)
Removes the float at the specified index, and copies all subsequent elements backward to fill the hole so created.
Declaration
public void RemoveAt(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The zero-based index at which to remove the float |
RemoveAtSwapBack(Int32)
Truncates the list by replacing the item at the specified index with the last item in the list. The list is shortened by one.
Declaration
public void RemoveAtSwapBack(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The index of the item to delete. |
RemoveRangeSwapBackWithBeginEnd(Int32, Int32)
Truncates the list by replacing the item at the specified index range with the items from the end the list. The list is shortened by number of elements in range.
Declaration
public void RemoveRangeSwapBackWithBeginEnd(int begin, int end)
Parameters
Type | Name | Description |
---|---|---|
Int32 | begin | The first index of the item to remove. |
Int32 | end | The index past-the-last item to remove. |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown if end argument is less than begin argument. |
ArgumentOutOfRangeException | Thrown if begin or end arguments are not positive or out of bounds. |
RemoveRangeWithBeginEnd(Int32, Int32)
Truncates the list by removing the items at the specified index range, and shifting all remaining items to replace removed items. The list is shortened by number of elements in range.
Declaration
public void RemoveRangeWithBeginEnd(int begin, int end)
Parameters
Type | Name | Description |
---|---|---|
Int32 | begin | The first index of the item to remove. |
Int32 | end | The index past-the-last item to remove. |
Remarks
This method of removing item(s) is useful only in case when list is ordered and user wants to preserve order
in list after removal In majority of cases is not important and user should use more performant RemoveRangeSwapBackWithBeginEnd
.
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown if end argument is less than begin argument. |
ArgumentOutOfRangeException | Thrown if begin or end arguments are not positive or out of bounds. |
RemoveSwapBack(Single)
Removes the first occurrence of an item from the FixedListFloat128 and replaces it with the last element, which can be much faster than copying down all subsequent elements.
Declaration
public bool RemoveSwapBack(float item)
Parameters
Type | Name | Description |
---|---|---|
Single | item | The elements to remove from the FixedListFloat128. |
Returns
Type | Description |
---|---|
Boolean | Returns true if item is removed. |
Sort()
Sorts the elements in this FixedListFloat128 in ascending order.
Declaration
public void Sort()
Sort<U>(U)
Sorts the elements in this FixedListFloat128 using a custom comparison function.
Declaration
public void Sort<U>(U comp)
where U : IComparer<float>
Parameters
Type | Name | Description |
---|---|---|
U | comp | A comparison function that indicates whether one element in the array is less than, equal to, or greater than another element. |
Type Parameters
Name | Description |
---|---|
U | The comparer type. |
ToArray()
Creates a managed Array of float that is a copy of this FixedListFloat128.
Declaration
public float[] ToArray()
Returns
Type | Description |
---|---|
Single[] |
ToNativeArray(Allocator)
Creates an unmanaged NativeArrayfloat that is a copy of this FixedListFloat128.
Declaration
public NativeArray<float> ToNativeArray(Allocator allocator)
Parameters
Type | Name | Description |
---|---|---|
Allocator | allocator | A member of the Unity.Collections.Allocator enumeration. |
Returns
Type | Description |
---|---|
NativeArray<Single> |
Operators
Equality(FixedListFloat128, FixedListFloat128)
Determines whether a FixedListFloat128 and FixedListFloat128 have the same value.
Declaration
public static bool operator ==(in FixedListFloat128 a, in FixedListFloat128 b)
Parameters
Type | Name | Description |
---|---|---|
FixedListFloat128 | a | The FixedListFloat128 to compare for equality |
FixedListFloat128 | b | The FixedListFloat128 to compare for equality |
Returns
Type | Description |
---|---|
Boolean |
Equality(FixedListFloat128, FixedListFloat32)
Determines whether a FixedListFloat128 and FixedListFloat32 have the same value.
Declaration
public static bool operator ==(in FixedListFloat128 a, in FixedListFloat32 b)
Parameters
Type | Name | Description |
---|---|---|
FixedListFloat128 | a | The FixedListFloat128 to compare for equality |
FixedListFloat32 | b | The FixedListFloat32 to compare for equality |
Returns
Type | Description |
---|---|
Boolean |
Equality(FixedListFloat128, FixedListFloat4096)
Determines whether a FixedListFloat128 and FixedListFloat4096 have the same value.
Declaration
public static bool operator ==(in FixedListFloat128 a, in FixedListFloat4096 b)
Parameters
Type | Name | Description |
---|---|---|
FixedListFloat128 | a | The FixedListFloat128 to compare for equality |
FixedListFloat4096 | b | The FixedListFloat4096 to compare for equality |
Returns
Type | Description |
---|---|
Boolean |
Equality(FixedListFloat128, FixedListFloat512)
Determines whether a FixedListFloat128 and FixedListFloat512 have the same value.
Declaration
public static bool operator ==(in FixedListFloat128 a, in FixedListFloat512 b)
Parameters
Type | Name | Description |
---|---|---|
FixedListFloat128 | a | The FixedListFloat128 to compare for equality |
FixedListFloat512 | b | The FixedListFloat512 to compare for equality |
Returns
Type | Description |
---|---|
Boolean |
Equality(FixedListFloat128, FixedListFloat64)
Determines whether a FixedListFloat128 and FixedListFloat64 have the same value.
Declaration
public static bool operator ==(in FixedListFloat128 a, in FixedListFloat64 b)
Parameters
Type | Name | Description |
---|---|---|
FixedListFloat128 | a | The FixedListFloat128 to compare for equality |
FixedListFloat64 | b | The FixedListFloat64 to compare for equality |
Returns
Type | Description |
---|---|
Boolean |
Implicit(FixedListFloat32 to FixedListFloat128)
Implicitly converts a FixedListFloat32 to a FixedListFloat128.
Declaration
public static implicit operator FixedListFloat128(in FixedListFloat32 other)
Parameters
Type | Name | Description |
---|---|---|
FixedListFloat32 | other | The FixedListFloat32 to copy |
Returns
Type | Description |
---|---|
FixedListFloat128 |
Implicit(FixedListFloat4096 to FixedListFloat128)
Implicitly converts a FixedListFloat4096 to a FixedListFloat128.
Declaration
public static implicit operator FixedListFloat128(in FixedListFloat4096 other)
Parameters
Type | Name | Description |
---|---|---|
FixedListFloat4096 | other | The FixedListFloat4096 to copy |
Returns
Type | Description |
---|---|
FixedListFloat128 |
Implicit(FixedListFloat512 to FixedListFloat128)
Implicitly converts a FixedListFloat512 to a FixedListFloat128.
Declaration
public static implicit operator FixedListFloat128(in FixedListFloat512 other)
Parameters
Type | Name | Description |
---|---|---|
FixedListFloat512 | other | The FixedListFloat512 to copy |
Returns
Type | Description |
---|---|
FixedListFloat128 |
Implicit(FixedListFloat64 to FixedListFloat128)
Implicitly converts a FixedListFloat64 to a FixedListFloat128.
Declaration
public static implicit operator FixedListFloat128(in FixedListFloat64 other)
Parameters
Type | Name | Description |
---|---|---|
FixedListFloat64 | other | The FixedListFloat64 to copy |
Returns
Type | Description |
---|---|
FixedListFloat128 |
Inequality(FixedListFloat128, FixedListFloat128)
Determines whether a FixedListFloat128 and FixedListFloat128 have different values.
Declaration
public static bool operator !=(in FixedListFloat128 a, in FixedListFloat128 b)
Parameters
Type | Name | Description |
---|---|---|
FixedListFloat128 | a | The FixedListFloat128 to compare for inequality |
FixedListFloat128 | b | The FixedListFloat128 to compare for inequality |
Returns
Type | Description |
---|---|
Boolean |
Inequality(FixedListFloat128, FixedListFloat32)
Determines whether a FixedListFloat128 and FixedListFloat32 have different values.
Declaration
public static bool operator !=(in FixedListFloat128 a, in FixedListFloat32 b)
Parameters
Type | Name | Description |
---|---|---|
FixedListFloat128 | a | The FixedListFloat128 to compare for inequality |
FixedListFloat32 | b | The FixedListFloat32 to compare for inequality |
Returns
Type | Description |
---|---|
Boolean |
Inequality(FixedListFloat128, FixedListFloat4096)
Determines whether a FixedListFloat128 and FixedListFloat4096 have different values.
Declaration
public static bool operator !=(in FixedListFloat128 a, in FixedListFloat4096 b)
Parameters
Type | Name | Description |
---|---|---|
FixedListFloat128 | a | The FixedListFloat128 to compare for inequality |
FixedListFloat4096 | b | The FixedListFloat4096 to compare for inequality |
Returns
Type | Description |
---|---|
Boolean |
Inequality(FixedListFloat128, FixedListFloat512)
Determines whether a FixedListFloat128 and FixedListFloat512 have different values.
Declaration
public static bool operator !=(in FixedListFloat128 a, in FixedListFloat512 b)
Parameters
Type | Name | Description |
---|---|---|
FixedListFloat128 | a | The FixedListFloat128 to compare for inequality |
FixedListFloat512 | b | The FixedListFloat512 to compare for inequality |
Returns
Type | Description |
---|---|
Boolean |
Inequality(FixedListFloat128, FixedListFloat64)
Determines whether a FixedListFloat128 and FixedListFloat64 have different values.
Declaration
public static bool operator !=(in FixedListFloat128 a, in FixedListFloat64 b)
Parameters
Type | Name | Description |
---|---|---|
FixedListFloat128 | a | The FixedListFloat128 to compare for inequality |
FixedListFloat64 | b | The FixedListFloat64 to compare for inequality |
Returns
Type | Description |
---|---|
Boolean |