Sequence Iteration and Access in C#

These properties and methods expose the tile-based iteration model used by the runtime Sequence class.

Use them when you need direct element access, bulk extraction into arrays, or explicit control over sequence traversal.

For an overview see page The C# Sequence Class

Operations

TileItems
Returns the values cached in the current tile.
FirstPosition / LastPosition / NextPosition
Report the absolute positions covered by the current tile and the next unread element.
ElementType / ElementSize
Describe the runtime element type stored in the sequence.
NextTile()
Loads the next tile of elements into TileItems.
ItemRepeatCount(int i)
Returns the repeat count for the i-th RLE item in the current tile.
RLEDecode()
Expands a run-length encoded sequence.
Sequence.IsRLE(Connection con)
Reports whether the runtime supports RLE sequences.
Get(Array buffer)
Copies as many elements as fit into the provided managed array.
Next(...)
Reads the next value using one of the typed overloads or the object-returning Next() method.

Example

This example iterates through two aligned sequences using the typed Next(out ...) overloads.

    uint day;
    float high;

    using (Sequence dayIterator = quote.Day)
    using (Sequence highIterator = quote.High)
    {
        while (dayIterator.Next(out day) && highIterator.Next(out high))
        {
            printf("%s[%u]: %f\n", __arglist(quote.Symbol, day, (double)high));
        }
    }