Embedded Template Library  1.0
etl::span< T, EXTENT > Class Template Reference

Array view. More...

#include <span.h>

Public Types

typedef T element_type
 
typedef etl::remove_cv< T >::type value_type
 
typedef size_t size_type
 
typedef T & reference
 
typedef const T & const_reference
 
typedef T * pointer
 
typedef const T * const_pointer
 
typedef T * iterator
 
typedef const T * const_iterator
 
typedef ETL_OR_STD::reverse_iterator< iterator > reverse_iterator
 
typedef ETL_OR_STD::reverse_iterator< const_iterator > const_reverse_iterator
 

Public Member Functions

ETL_CONSTEXPR span () ETL_NOEXCEPT
 Default constructor.
 
template<typename TSpan >
ETL_CONSTEXPR span (TSpan &a) ETL_NOEXCEPT
 
template<typename TSpan >
ETL_CONSTEXPR span (const TSpan &a) ETL_NOEXCEPT
 
template<typename TIterator >
ETL_CONSTEXPR span (const TIterator begin_, const TIterator end_)
 Construct from iterators.
 
template<typename TIterator , typename TSize >
ETL_CONSTEXPR span (const TIterator begin_, const TSize size_) ETL_NOEXCEPT
 Construct from pointer + size.
 
template<const size_t ARRAY_SIZE>
ETL_CONSTEXPR span (element_type(&begin_)[ARRAY_SIZE]) ETL_NOEXCEPT
 Construct from C array.
 
ETL_CONSTEXPR span (const span &other) ETL_NOEXCEPT
 Copy constructor.
 
ETL_CONSTEXPR reference front () const ETL_NOEXCEPT
 Returns a reference to the first element.
 
ETL_CONSTEXPR reference back () const ETL_NOEXCEPT
 Returns a reference to the last element.
 
ETL_CONSTEXPR pointer data () const ETL_NOEXCEPT
 Returns a pointer to the first element of the internal storage.
 
ETL_CONSTEXPR iterator begin () const ETL_NOEXCEPT
 Returns an iterator to the beginning of the span.
 
ETL_CONSTEXPR iterator end () const ETL_NOEXCEPT
 Returns an iterator to the end of the span.
 
ETL_CONSTEXPR reverse_iterator rbegin () const ETL_NOEXCEPT
 
ETL_CONSTEXPR reverse_iterator rend () const ETL_NOEXCEPT
 Returns a reverse iterator to the end of the span.
 
ETL_CONSTEXPR bool empty () const ETL_NOEXCEPT
 Returns true if the span size is zero.
 
ETL_CONSTEXPR size_t size () const ETL_NOEXCEPT
 Returns the size of the span.
 
ETL_CONSTEXPR size_t size_bytes () const ETL_NOEXCEPT
 Returns the size of the span in bytes.
 
ETL_CONSTEXPR size_t max_size () const ETL_NOEXCEPT
 Returns the maximum possible size of the span.
 
ETL_CONSTEXPR14 spanoperator= (const span &other) ETL_NOEXCEPT
 Assign from a span.
 
ETL_CONSTEXPR reference operator[] (const size_t i) const
 Returns a reference to the indexed value.
 
template<const size_t COUNT>
ETL_CONSTEXPR etl::span< element_type, COUNT > first () const
 Obtains a span that is a view over the first COUNT elements of this span.
 
ETL_CONSTEXPR etl::span< element_type, etl::dynamic_extent > first (size_t count) const
 Obtains a span that is a view over the first count elements of this span.
 
template<const size_t COUNT>
ETL_CONSTEXPR etl::span< element_type, COUNT > last () const
 Obtains a span that is a view over the last COUNT elements of this span.
 
ETL_CONSTEXPR etl::span< element_type, etl::dynamic_extent > last (size_t count) const
 Obtains a span that is a view over the last count elements of this span.
 
template<const size_t OFFSET, const size_t COUNT = etl::dynamic_extent>
ETL_CONSTEXPR etl::enable_if< COUNT==etl::dynamic_extent, etl::span< element_type,((EXTENT !=etl::dynamic_extent) ? EXTENT - OFFSET :etl::dynamic_extent)> >::type subspan () const
 
template<const size_t OFFSET, const size_t COUNT = etl::dynamic_extent>
ETL_CONSTEXPR etl::enable_if< COUNT !=etl::dynamic_extent, etl::span< element_type, COUNT > >::type subspan () const
 
ETL_CONSTEXPR14 etl::span< element_type, etl::dynamic_extent > subspan (size_t offset, size_t count=etl::dynamic_extent) const
 Obtains a span that is a view from 'offset' over the next 'count' elements of this span.
 

Static Public Attributes

static ETL_CONSTANT size_t extent = EXTENT
 

Detailed Description

template<typename T, const size_t EXTENT = etl::dynamic_extent>
class etl::span< T, EXTENT >

Array view.

Constructor & Destructor Documentation

◆ span() [1/2]

template<typename T , const size_t EXTENT = etl::dynamic_extent>
template<typename TSpan >
ETL_CONSTEXPR etl::span< T, EXTENT >::span ( TSpan &  a)
inline

Construct from std::array or etl::array or other type that supports data() and size() member functions.

◆ span() [2/2]

template<typename T , const size_t EXTENT = etl::dynamic_extent>
template<typename TSpan >
ETL_CONSTEXPR etl::span< T, EXTENT >::span ( const TSpan &  a)
inline

Construct from std::array or etl::array or other type that supports data() and size() member functions.

Member Function Documentation

◆ subspan() [1/2]

template<typename T , const size_t EXTENT = etl::dynamic_extent>
template<const size_t OFFSET, const size_t COUNT = etl::dynamic_extent>
ETL_CONSTEXPR etl::enable_if<COUNT == etl::dynamic_extent, etl::span<element_type, ((EXTENT != etl::dynamic_extent) ? EXTENT - OFFSET : etl::dynamic_extent)> >::type etl::span< T, EXTENT >::subspan ( ) const
inline

Obtains a span that is a view from OFFSET over the next COUNT elements of this span. Enabled for COUNT == etl::dynamic_extent

◆ subspan() [2/2]

template<typename T , const size_t EXTENT = etl::dynamic_extent>
template<const size_t OFFSET, const size_t COUNT = etl::dynamic_extent>
ETL_CONSTEXPR etl::enable_if<COUNT != etl::dynamic_extent, etl::span<element_type, COUNT> >::type etl::span< T, EXTENT >::subspan ( ) const
inline

Obtains a span that is a view from OFFSET over the next COUNT elements of this span. Enabled for COUNT != etl::dynamic_extent


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