Gorgon
Show / Hide Table of Contents

Interface IGorgonReadOnlyArray<T>

Defines an array that is read only.

Inherited Members
IReadOnlyList<T>.this[int]
IReadOnlyCollection<T>.Count
IEnumerable<T>.GetEnumerator()
IEquatable<IReadOnlyList<T>>.Equals(IReadOnlyList<T>)
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 Source

IsDirty

Property to return whether the array is in a dirty state.

Declaration
bool IsDirty { get; }
Property Value
Type Description
bool
| Edit this page View Source

Length

Property to return the length of the array.

Declaration
int Length { get; }
Property Value
Type Description
int

Methods

| Edit this page View Source

AsMemory()

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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 other parameter; otherwise, false.

| Edit this page View Source

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.

Extension Methods

GorgonDebugExtensions.ValidateObject<T>(T, string)
GorgonTreeLinqExtensions.TraverseDepthFirst<T>(IEnumerable<T>, Func<T, IEnumerable<T>>)
GorgonTreeLinqExtensions.Traverse<T>(IEnumerable<T>, Func<T, IEnumerable<T>>)
GorgonIReadOnlyListExtensions.Contains<T>(IReadOnlyList<T>, T)
GorgonIReadOnlyListExtensions.CopyTo<T>(IReadOnlyList<T>, T[])
GorgonIReadOnlyListExtensions.FirstIndexOf<T>(IReadOnlyList<T>, Predicate<T>)
GorgonIReadOnlyListExtensions.IndexOf<T>(IReadOnlyList<T>, T)
GorgonIReadOnlyListExtensions.LastIndexOf<T>(IReadOnlyList<T>, Predicate<T>)
GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author