WPILibC++ 2025.1.1
|
This is a simple rotated span view. More...
#include <wpi/rotated_span.h>
Classes | |
class | iterator |
Public Types | |
using | element_type = T |
using | value_type = std::remove_cv_t<T> |
using | size_type = size_t |
using | difference_type = std::ptrdiff_t |
using | pointer = T* |
using | const_pointer = const T* |
using | reference = element_type& |
using | const_reference = const element_type& |
using | reverse_iterator = std::reverse_iterator<iterator> |
Public Member Functions | |
constexpr | rotated_span () noexcept=default |
constexpr | rotated_span (std::span< T, Extent > data, int rotation=0) |
template<std::contiguous_iterator It> | |
constexpr | explicit (extent !=std::dynamic_extent) rotated_span(It first |
constexpr size_type int std::sized_sentinel_for< It > End constexpr | explicit (extent !=std::dynamic_extent) rotated_span(It first |
constexpr size_type int std::sized_sentinel_for< It > End constexpr End int size_t ArrayExtent constexpr | rotated_span (std::array< Tp, ArrayExtent > &arr, int rotation=0) noexcept |
template<typename Tp , size_t ArrayExtent> | |
constexpr | rotated_span (const std::array< Tp, ArrayExtent > &arr, int rotation=0) noexcept |
template<typename OType , size_t OExtent> requires (Extent == std::dynamic_extent || OExtent == std::dynamic_extent || Extent == OExtent) | |
constexpr | explicit (extent !=std::dynamic_extent &&OExtent==std::dynamic_extent) rotated_span(const rotated_span< OType |
constexpr | rotated_span (rotated_span &&) noexcept=default |
constexpr rotated_span & | operator= (rotated_span &&) noexcept=default |
~rotated_span () noexcept=default | |
constexpr std::span< T, Extent > | data () const noexcept |
constexpr size_type | offset () const noexcept |
constexpr size_type | size () const noexcept |
constexpr size_type | size_bytes () const noexcept |
constexpr bool | empty () const noexcept |
constexpr reference | front () const noexcept |
constexpr reference | back () const noexcept |
constexpr reference | operator[] (size_type idx) const noexcept |
constexpr iterator | begin () const noexcept |
constexpr iterator | end () const noexcept |
constexpr reverse_iterator | rbegin () const noexcept |
constexpr reverse_iterator | rend () const noexcept |
constexpr rotated_span | rotate (int amt) const noexcept |
Public Attributes | |
constexpr size_type | count |
constexpr size_type int | rotation |
constexpr size_type int std::sized_sentinel_for< It > End constexpr End | last |
constexpr size_type int std::sized_sentinel_for< It > End constexpr End int | rotation |
constexpr OExtent & | other |
constexpr OExtent int rotation | noexcept: m_data{other.m_data} |
constexpr OExtent int rotation | m_offset |
Static Public Attributes | |
static constexpr size_t | extent = Extent |
This is a simple rotated span view.
Indexed/iterated access provides a continuous view of the underlying span that wraps at the span size. An internal offset determines the starting location.
Constructors take a "rotation" value–if positive, the offset is the same as the rotation; if negative, the offset is set relative to the end of the array.
For example, given an array of 5 values, providing a rotation value of 2 will result in an index of 0 accessing underlying span index 2, index 2 accessing underlying span index 4, and index 4 accessing underlying span index 1.
Similarly, providing a rotation value of -2 will result in index 0 accessing underlying span index 3 (5-2), index 2 accessing underlying span index 0, and index 4 accessing underlying span index 2.
T | element type |
Extent | static sized extent, or std::dynamic_extent |
using wpi::rotated_span< T, Extent >::const_pointer = const T* |
using wpi::rotated_span< T, Extent >::const_reference = const element_type& |
using wpi::rotated_span< T, Extent >::difference_type = std::ptrdiff_t |
using wpi::rotated_span< T, Extent >::element_type = T |
using wpi::rotated_span< T, Extent >::pointer = T* |
using wpi::rotated_span< T, Extent >::reference = element_type& |
using wpi::rotated_span< T, Extent >::reverse_iterator = std::reverse_iterator<iterator> |
using wpi::rotated_span< T, Extent >::size_type = size_t |
using wpi::rotated_span< T, Extent >::value_type = std::remove_cv_t<T> |
|
constexprdefaultnoexcept |
|
inlineconstexpr |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
constexprdefaultnoexcept |
|
defaultnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
constexpr |
|
constexpr |
|
constexpr |
|
inlinenodiscardconstexprnoexcept |
|
inlineconstexprnoexcept |
|
constexprdefaultnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
size_type wpi::rotated_span< T, Extent >::count |
|
staticconstexpr |
size_type int std::sized_sentinel_for< It > End constexpr End wpi::rotated_span< T, Extent >::last |
OExtent int rotation wpi::rotated_span< T, Extent >::m_offset |
OExtent int rotation wpi::rotated_span< T, Extent >::noexcept |
OExtent& wpi::rotated_span< T, Extent >::other |
size_type int wpi::rotated_span< T, Extent >::rotation |
size_type int std::sized_sentinel_for< It > End constexpr End int wpi::rotated_span< T, Extent >::rotation |