Represents a range with a start and end index. This type should be allocated on stack and passed to functions by value or by reference. Never use System::SmartPtr class to manage objects of this type.
More...
#include <range.h>
Inherits System::Details::BoxableObjectBase.
|
| static constexpr Range | get_All () noexcept |
| | Returns a Range that represents the whole collection. More...
|
| |
| static constexpr Range | StartAt (const Index &start) noexcept |
| | Creates a range that begins at the specified start index and extends to the end of the collection. More...
|
| |
| static constexpr Range | EndAt (const Index &end) noexcept |
| | Creates a range that begins at the start of the collection and ends at the specified end index. More...
|
| |
Represents a range with a start and end index. This type should be allocated on stack and passed to functions by value or by reference. Never use System::SmartPtr class to manage objects of this type.
◆ Range() [1/2]
| constexpr System::Range::Range |
( |
| ) |
|
|
inlineconstexprnoexcept |
Constructs an empty range.
◆ Range() [2/2]
| constexpr System::Range::Range |
( |
const Index & |
start, |
|
|
const Index & |
end |
|
) |
| |
|
inlineconstexprnoexcept |
Constructs a Range from the specified start and end indexes.
- Parameters
-
| start | The start index of the range. |
| end | The end index of the range. |
◆ EndAt()
| static constexpr Range System::Range::EndAt |
( |
const Index & |
end | ) |
|
|
inlinestaticconstexprnoexcept |
Creates a range that begins at the start of the collection and ends at the specified end index.
- Parameters
-
| end | The ending index of the range. |
- Returns
- A Range object that starts at the beginning of the collection and ends at
end.
◆ Equals()
| bool System::Range::Equals |
( |
const Range & |
other | ) |
const |
|
inline |
Determines whether the current range is equal to the specified range.
- Parameters
-
| other | The range to compare with. |
- Returns
- True if both ranges have the same start and end indexes, otherwise false.
◆ get_All()
| static constexpr Range System::Range::get_All |
( |
| ) |
|
|
inlinestaticconstexprnoexcept |
Returns a Range that represents the whole collection.
- Returns
- A Range object that selects all elements.
◆ get_End()
| const Index & System::Range::get_End |
( |
| ) |
const |
|
inlinenoexcept |
◆ get_Start()
| const Index & System::Range::get_Start |
( |
| ) |
const |
|
inlinenoexcept |
◆ GetHashCode()
| int32_t System::Range::GetHashCode |
( |
| ) |
const |
|
inline |
Returns a hash code for the current range.
- Returns
- A hash code computed from the start and end indexes.
◆ GetOffsetAndLength()
| System::ValueTuple< int32_t, int32_t > System::Range::GetOffsetAndLength |
( |
int32_t |
length | ) |
const |
|
inline |
Computes the zero-based start offset and length for the specified collection length.
- Parameters
-
| length | The length of the collection. |
- Returns
- The tuple containing zero-based index from the start of the collection and the number of elements selected by the range.
- Exceptions
-
| ArgumentOutOfRangeException | if the length is invalid or the start index is out of range. |
◆ StartAt()
| static constexpr Range System::Range::StartAt |
( |
const Index & |
start | ) |
|
|
inlinestaticconstexprnoexcept |
Creates a range that begins at the specified start index and extends to the end of the collection.
- Parameters
-
| start | The starting index of the range. |
- Returns
- A Range object that starts at
start and ends at the end of the collection.