|
CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
|
Represents a sequence of elements that can be backed either by a single contiguous memory block or by a linked list of contiguous memory segments. More...
#include <read_only_sequence.h>
Inherits System::Details::BoxableObjectBase.
Public Types | |
| using | value_type = T |
| The element type. More... | |
Public Member Functions | |
| ReadOnlySequence ()=default | |
| Constructs an empty ReadOnlySequence. More... | |
| ReadOnlySequence (const ReadOnlyMemory< T > &memory) | |
| Constructs a single-segment sequence that wraps the specified contiguous memory. More... | |
| ReadOnlySequence (const SequencePosition &start, const SequencePosition &end) | |
| Constructs a multi-segment sequence from a range defined by a start and end position. More... | |
| ReadOnlySequence (const SharedPtr< ReadOnlySequenceSegment< T > > &startSegment, int32_t startIndex, const SharedPtr< ReadOnlySequenceSegment< T > > &endSegment, int32_t endIndex) | |
| Constructs a multi-segment sequence from a linked list of segments. More... | |
| bool | get_IsEmpty () const |
| Determines whether the sequence is empty. More... | |
| int64_t | get_Length () const |
| Gets the number of elements in the sequence. More... | |
| bool | get_IsSingleSegment () const |
| Determines whether the sequence consists of a single contiguous memory block. More... | |
| SequencePosition | get_Start () const |
| Gets the position of the first element in the sequence. More... | |
| SequencePosition | get_End () const |
| Gets the position one past the last element in the sequence. More... | |
| ReadOnlyMemory< T > | get_First () const |
| Gets the first memory block of the sequence. More... | |
| ReadOnlySpan< T > | get_FirstSpan () const |
| Gets the first memory block of the sequence as a read-only span. More... | |
| SequencePosition | GetPosition (int64_t offset) const |
| Gets the position at the specified zero-based offset from the start of the sequence. More... | |
| SequencePosition | GetPosition (int64_t offset, const SequencePosition &origin) const |
| Gets the position at the specified zero-based offset from the given origin position. More... | |
| ReadOnlySequence | Slice (int64_t start) const |
| Creates a slice of the sequence starting at the given offset. More... | |
| ReadOnlySequence | Slice (int64_t start, int64_t length) const |
| Creates a slice of the sequence defined by a start and length. More... | |
| ReadOnlySequence | Slice (const SequencePosition &start, const SequencePosition &end) const |
| Creates a slice of the sequence defined by a start and end position. More... | |
| bool | TryGet (SequencePosition &position, ReadOnlyMemory< T > &memory, bool advance) const |
| Retrieves the memory block that contains the given position. More... | |
| bool | Equals (const ReadOnlySequence &other) const |
| Determines whether the current sequence references the same range as the specified sequence. More... | |
| int32_t | GetHashCode () const |
| Returns a hash code for the current sequence. More... | |
| bool | operator== (const ReadOnlySequence &other) const |
| Determines whether the current sequence references the same range as the specified sequence. More... | |
| bool | operator!= (const ReadOnlySequence &other) const |
| Determines whether the current sequence references a different range than the specified sequence. More... | |
Static Public Member Functions | |
| static ReadOnlySequence | get_Empty () |
| Gets the default (empty) ReadOnlySequence instance. More... | |
Static Public Attributes | |
| static const ReadOnlySequence | Empty |
| The default (empty) ReadOnlySequence instance. More... | |
Represents a sequence of elements that can be backed either by a single contiguous memory block or by a linked list of contiguous memory segments.
| T | The type of elements in the sequence. |
| using System::Buffers::ReadOnlySequence< T >::value_type = T |
The element type.
|
default |
Constructs an empty ReadOnlySequence.
|
inline |
Constructs a single-segment sequence that wraps the specified contiguous memory.
| memory | The memory block to wrap as a single-segment sequence. |
|
inline |
Constructs a multi-segment sequence from a range defined by a start and end position.
| start | The position of the first element. |
| end | The position one past the last element. |
|
inline |
Constructs a multi-segment sequence from a linked list of segments.
| startSegment | The first segment of the sequence. |
| startIndex | The offset of the first element within startSegment. |
| endSegment | The last segment of the sequence. |
| endIndex | The offset one past the last element within endSegment. |
|
inline |
Determines whether the current sequence references the same range as the specified sequence.
| other | The sequence to compare with the current one. |
|
inlinestatic |
Gets the default (empty) ReadOnlySequence instance.
|
inline |
Gets the position one past the last element in the sequence.
|
inline |
Gets the first memory block of the sequence.
|
inline |
Gets the first memory block of the sequence as a read-only span.
|
inline |
Determines whether the sequence is empty.
|
inline |
Determines whether the sequence consists of a single contiguous memory block.
|
inline |
Gets the number of elements in the sequence.
|
inline |
Gets the position of the first element in the sequence.
|
inline |
Returns a hash code for the current sequence.
|
inline |
Gets the position at the specified zero-based offset from the start of the sequence.
| offset | The number of elements to advance. |
|
inline |
Gets the position at the specified zero-based offset from the given origin position.
| offset | The number of elements to advance. |
| origin | The position from which the offset is measured. |
|
inline |
Determines whether the current sequence references a different range than the specified sequence.
| other | The sequence to compare with the current one. |
|
inline |
Determines whether the current sequence references the same range as the specified sequence.
| other | The sequence to compare with the current one. |
|
inline |
Creates a slice of the sequence defined by a start and end position.
| start | The position of the first element of the slice. |
| end | The position one past the last element of the slice. |
|
inline |
Creates a slice of the sequence starting at the given offset.
| start | The offset of the first element of the slice. |
|
inline |
Creates a slice of the sequence defined by a start and length.
| start | The offset of the first element of the slice. |
| length | The number of elements in the slice. |
|
inline |
Retrieves the memory block that contains the given position.
| position | On input, a position identifying a segment. On output, updated to the position of the first element of the next segment (if advance is true), or left at the end of the returned memory otherwise. |
| memory | When this method returns, contains the memory block starting at the given position. |
| advance | True to advance the position to the next segment after reading. |
memory was populated; otherwise, false.
|
static |
The default (empty) ReadOnlySequence instance.
Definition of the static empty sequence member.