Search Results for

    Show / Hide Table of Contents

    Class Span

    Universal representation of a contiguous region of arbitrary memory.

    Inheritance
    Span
    Assembly: FlaxEngine.dll
    File: Engine/Core/Types/BaseTypes.h
    Syntax
    public class Span<T>
    Type Parameters
    T

    Constructors

    Span()

    Initializes a new instance of the Span class.

    Declaration
    public Span()

    Span(const T* data, int32 length)

    Initializes a new instance of the Span class.

    Declaration
    public Span(const T* data, int32 length)
    Parameters
    T data

    The data pointer to link.

    int32 length

    The data length.

    Fields

    _data

    Declaration
    protected T* _data
    Field Value
    T

    _length

    Declaration
    protected int32 _length
    Field Value
    int32

    Methods

    begin()

    Declaration
    public T* begin()
    Returns
    T

    end()

    Declaration
    public T* end()
    Returns
    T

    Get()

    Gets the pointer to the data.

    Declaration
    public T* Get()
    Returns
    T

    IsInvalid()

    Returns true if data is invalid.

    Declaration
    public bool IsInvalid() const
    Returns
    bool

    IsValid()

    Returns true if data is valid.

    Declaration
    public bool IsValid() const
    Returns
    bool

    Length()

    Gets length of the data.

    Declaration
    public int32 Length() const
    Returns
    int32

    operator[](int32 index)

    Gets or sets the element by index

    Declaration
    public T operator[](int32 index)
    Parameters
    int32 index

    The index.

    Returns
    T

    The item reference.

    Slice(int32 start)

    Constructs a slice out of the current span that begins at a specified index.

    Declaration
    public Span<T> Slice(int32 start)
    Parameters
    int32 start

    The zero-based index at which to begin the slice.

    Returns
    Span<T>

    A span that consists of all elements of the current span from start to the end of the span.

    Slice(int32 start, int32 length)

    Constructs a slice out of the current span starting at a specified index for a specified length.

    Declaration
    public Span<T> Slice(int32 start, int32 length)
    Parameters
    int32 start

    The zero-based index at which to begin this slice.

    int32 length

    The length for the result slice.

    Returns
    Span<T>

    A span that consists of length elements from the current span starting at start .

    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat