MIP_SDK  latest-2-g34f3e39
MicroStrain Communications Library for embedded systems
Public Types | Public Member Functions | Static Public Attributes | List of all members
microstrain::Span< T, Extent > Struct Template Reference

Implementation of std::span from C++20. More...

#include <span.hpp>

Public Types

using element_type = T
 
using value_type = typename std::remove_cv< T >::type
 
using difference_type = ptrdiff_t
 
using pointer = T *
 
using reference = T &
 
using const_pointer = const T *
 
using const_reference = const T &
 

Public Member Functions

constexpr Span (pointer ptr)
 
constexpr pointer begin () const noexcept
 
constexpr pointer end () const noexcept
 
constexpr element_type front () const noexcept
 
constexpr element_type back () const noexcept
 
constexpr reference operator[] (size_t idx) noexcept
 
constexpr const_reference operator[] (size_t idx) const noexcept
 
constexpr pointer data () const noexcept
 
constexpr size_t size () const noexcept
 
constexpr bool empty () const noexcept
 
constexpr Span< T, DYNAMIC_EXTENT > subspan (size_t index, size_t length) const
 
constexpr Span< T, DYNAMIC_EXTENT > subspan (size_t index) const
 
template<size_t Offset, size_t Count = DYNAMIC_EXTENT>
constexpr Span< T, Count==DYNAMIC_EXTENT ? DYNAMIC_EXTENT :Extent-Count > subspan () const
 

Static Public Attributes

static constexpr size_t extent = Extent
 

Detailed Description

template<class T, size_t Extent = DYNAMIC_EXTENT>
struct microstrain::Span< T, Extent >

Implementation of std::span from C++20.

This class represents a pointer and length. It provides the minimum functionality required by this SDK while trying to be interchangeable with std::span.

https://en.cppreference.com/w/cpp/container/span

See C++ Standard Support

Member Typedef Documentation

◆ const_pointer

template<class T , size_t Extent = DYNAMIC_EXTENT>
using microstrain::Span< T, Extent >::const_pointer = const T*

◆ const_reference

template<class T , size_t Extent = DYNAMIC_EXTENT>
using microstrain::Span< T, Extent >::const_reference = const T&

◆ difference_type

template<class T , size_t Extent = DYNAMIC_EXTENT>
using microstrain::Span< T, Extent >::difference_type = ptrdiff_t

◆ element_type

template<class T , size_t Extent = DYNAMIC_EXTENT>
using microstrain::Span< T, Extent >::element_type = T

◆ pointer

template<class T , size_t Extent = DYNAMIC_EXTENT>
using microstrain::Span< T, Extent >::pointer = T*

◆ reference

template<class T , size_t Extent = DYNAMIC_EXTENT>
using microstrain::Span< T, Extent >::reference = T&

◆ value_type

template<class T , size_t Extent = DYNAMIC_EXTENT>
using microstrain::Span< T, Extent >::value_type = typename std::remove_cv<T>::type

Constructor & Destructor Documentation

◆ Span()

template<class T , size_t Extent = DYNAMIC_EXTENT>
constexpr microstrain::Span< T, Extent >::Span ( pointer  ptr)
inlineconstexpr

Member Function Documentation

◆ back()

template<class T , size_t Extent = DYNAMIC_EXTENT>
constexpr element_type microstrain::Span< T, Extent >::back ( ) const
inlineconstexprnoexcept

◆ begin()

template<class T , size_t Extent = DYNAMIC_EXTENT>
constexpr pointer microstrain::Span< T, Extent >::begin ( ) const
inlineconstexprnoexcept

◆ data()

template<class T , size_t Extent = DYNAMIC_EXTENT>
constexpr pointer microstrain::Span< T, Extent >::data ( ) const
inlineconstexprnoexcept

◆ empty()

template<class T , size_t Extent = DYNAMIC_EXTENT>
constexpr bool microstrain::Span< T, Extent >::empty ( ) const
inlineconstexprnoexcept

◆ end()

template<class T , size_t Extent = DYNAMIC_EXTENT>
constexpr pointer microstrain::Span< T, Extent >::end ( ) const
inlineconstexprnoexcept

◆ front()

template<class T , size_t Extent = DYNAMIC_EXTENT>
constexpr element_type microstrain::Span< T, Extent >::front ( ) const
inlineconstexprnoexcept

◆ operator[]() [1/2]

template<class T , size_t Extent = DYNAMIC_EXTENT>
constexpr const_reference microstrain::Span< T, Extent >::operator[] ( size_t  idx) const
inlineconstexprnoexcept

◆ operator[]() [2/2]

template<class T , size_t Extent = DYNAMIC_EXTENT>
constexpr reference microstrain::Span< T, Extent >::operator[] ( size_t  idx)
inlineconstexprnoexcept

◆ size()

template<class T , size_t Extent = DYNAMIC_EXTENT>
constexpr size_t microstrain::Span< T, Extent >::size ( ) const
inlineconstexprnoexcept

◆ subspan() [1/3]

template<class T , size_t Extent = DYNAMIC_EXTENT>
template<size_t Offset, size_t Count = DYNAMIC_EXTENT>
constexpr Span<T, Count == DYNAMIC_EXTENT ? DYNAMIC_EXTENT : Extent-Count> microstrain::Span< T, Extent >::subspan ( ) const
inlineconstexpr

◆ subspan() [2/3]

template<class T , size_t Extent = DYNAMIC_EXTENT>
constexpr Span<T, DYNAMIC_EXTENT> microstrain::Span< T, Extent >::subspan ( size_t  index) const
inlineconstexpr

◆ subspan() [3/3]

template<class T , size_t Extent = DYNAMIC_EXTENT>
constexpr Span<T, DYNAMIC_EXTENT> microstrain::Span< T, Extent >::subspan ( size_t  index,
size_t  length 
) const
inlineconstexpr

Member Data Documentation

◆ extent

template<class T , size_t Extent = DYNAMIC_EXTENT>
constexpr size_t microstrain::Span< T, Extent >::extent = Extent
staticconstexpr

The documentation for this struct was generated from the following file: