Interface IGorgonReadOnlyArray<T>
Defines an array that is read only.
Inherited Members
Namespace: Gorgon.Collections
Assembly: Gorgon.Core.dll
Syntax
public interface IGorgonReadOnlyArray<T> : IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable, IEquatable<IReadOnlyList<T>> where T : IEquatable<T>
Type Parameters
Name | Description |
---|---|
T | The type of data in the array. |
Properties
| Edit this page View SourceIsDirty
Property to return whether the array is in a dirty state.
Declaration
bool IsDirty { get; }
Property Value
Type | Description |
---|---|
bool |
Length
Property to return the length of the array.
Declaration
int Length { get; }
Property Value
Type | Description |
---|---|
int |
Methods
| Edit this page View SourceAsMemory()
Function to return read only memory for a slice of the array.
Declaration
ReadOnlyMemory<T> AsMemory()
Returns
Type | Description |
---|---|
ReadOnlyMemory<T> | The read only memory for the array slice. |
AsMemory(int, int)
Function to return read only memory for a slice of the array.
Declaration
ReadOnlyMemory<T> AsMemory(int start, int count)
Parameters
Type | Name | Description |
---|---|---|
int | start | The starting index for the array. |
int | count | The number of items to slice. |
Returns
Type | Description |
---|---|
ReadOnlyMemory<T> | The read only memory for the array slice. |
AsSpan()
Function to return a read only span for the array.
Declaration
ReadOnlySpan<T> AsSpan()
Returns
Type | Description |
---|---|
ReadOnlySpan<T> | The read only span for the array. |
AsSpan(int, int)
Function to return a read only span for a slice of the array.
Declaration
ReadOnlySpan<T> AsSpan(int start, int count)
Parameters
Type | Name | Description |
---|---|---|
int | start | The starting index for the array. |
int | count | The number of items to slice. |
Returns
Type | Description |
---|---|
ReadOnlySpan<T> | The read only span for the array slice. |
DirtyEquals(IGorgonReadOnlyArray<T>, int)
Indicates whether the current object is equal to another object of the same type.
Declaration
bool DirtyEquals(IGorgonReadOnlyArray<T> other, int offset = 0)
Parameters
Type | Name | Description |
---|---|---|
IGorgonReadOnlyArray<T> | other | An object to compare with this object. |
int | offset | [Optional] The offset in this array to start comparing from. |
Returns
Type | Description |
---|---|
bool | true if the current object is equal to the |
GetDirtyItems(bool)
Function to retrieve the dirty items in this list.
Declaration
ref readonly (int Start, int Count) GetDirtyItems(bool peek = false)
Parameters
Type | Name | Description |
---|---|---|
bool | peek | [Optional] true if the dirty state should not be modified by calling this method, or false if it should be. |
Returns
Type | Description |
---|---|
(int Start, int Count) | A tuple containing the starting index and the number of items. |
Remarks
This will return a tuple that contains the start index, and count of the items that have been changed in this collection.
If the peek
parameter is set to true, then the state of this collection is not changed when retrieving the modified objects. Otherwise, the state will be reset and a
subsequent call to this method will result in a tuple that does not contain any changed values (i.e. the start and count will be 0) until the collection is modified again.