HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
span_strided< T, Extent > Class Template Reference

#include <span.h>

Public Types

using element_type = T
 
using value_type = typename std::remove_cv< T >::type
 
using index_type = ptrdiff_t
 
using difference_type = ptrdiff_t
 
using stride_type = ptrdiff_t
 
using pointer = element_type *
 
using reference = element_type &
 
using iterator = element_type *
 
using const_iterator = const element_type *
 
using reverse_iterator = std::reverse_iterator< iterator >
 
using const_reverse_iterator = std::reverse_iterator< const_iterator >
 

Public Member Functions

constexpr span_strided () noexcept
 Default ctr – points to nothing. More...
 
constexpr span_strided (const span_strided &copy)
 Copy constructor. More...
 
constexpr span_strided (pointer data, index_type size, stride_type stride=1)
 Construct from T* and size, and optionally stride. More...
 
constexpr span_strided (T &data)
 Construct from a single T&. More...
 
template<size_t N>
constexpr span_strided (T(&data)[N])
 
OIIO_CONSTEXPR14 span_strided (std::vector< T > &v)
 Construct from std::vector<T>. More...
 
constexpr span_strided (const std::vector< value_type > &v)
 
constexpr span_strided (std::initializer_list< T > il)
 Construct an span from an initializer_list. More...
 
constexpr span_strided (span< T > av)
 Initialize from an span (stride will be 1). More...
 
span_stridedoperator= (const span_strided &copy)
 
constexpr index_type size () const noexcept
 
constexpr stride_type stride () const noexcept
 
constexpr reference operator[] (index_type idx) const
 
constexpr reference operator() (index_type idx) const
 
reference at (index_type idx) const
 
constexpr reference front () const noexcept
 
constexpr reference back () const noexcept
 
constexpr pointer data () const noexcept
 

Static Public Attributes

static constexpr index_type extent = Extent
 

Detailed Description

template<typename T, ptrdiff_t Extent = dynamic_extent>
class span_strided< T, Extent >

span_strided<T> : a non-owning, mutable reference to a contiguous array with known length and optionally non-default strides through the data. An span_strided<T> is mutable (the values in the array may be modified), whereas an span_strided<const T> is not mutable.

Definition at line 217 of file span.h.

Member Typedef Documentation

template<typename T, ptrdiff_t Extent = dynamic_extent>
using span_strided< T, Extent >::const_iterator = const element_type*

Definition at line 229 of file span.h.

template<typename T, ptrdiff_t Extent = dynamic_extent>
using span_strided< T, Extent >::const_reverse_iterator = std::reverse_iterator<const_iterator>

Definition at line 231 of file span.h.

template<typename T, ptrdiff_t Extent = dynamic_extent>
using span_strided< T, Extent >::difference_type = ptrdiff_t

Definition at line 224 of file span.h.

template<typename T, ptrdiff_t Extent = dynamic_extent>
using span_strided< T, Extent >::element_type = T

Definition at line 221 of file span.h.

template<typename T, ptrdiff_t Extent = dynamic_extent>
using span_strided< T, Extent >::index_type = ptrdiff_t

Definition at line 223 of file span.h.

template<typename T, ptrdiff_t Extent = dynamic_extent>
using span_strided< T, Extent >::iterator = element_type*

Definition at line 228 of file span.h.

template<typename T, ptrdiff_t Extent = dynamic_extent>
using span_strided< T, Extent >::pointer = element_type*

Definition at line 226 of file span.h.

template<typename T, ptrdiff_t Extent = dynamic_extent>
using span_strided< T, Extent >::reference = element_type&

Definition at line 227 of file span.h.

template<typename T, ptrdiff_t Extent = dynamic_extent>
using span_strided< T, Extent >::reverse_iterator = std::reverse_iterator<iterator>

Definition at line 230 of file span.h.

template<typename T, ptrdiff_t Extent = dynamic_extent>
using span_strided< T, Extent >::stride_type = ptrdiff_t

Definition at line 225 of file span.h.

template<typename T, ptrdiff_t Extent = dynamic_extent>
using span_strided< T, Extent >::value_type = typename std::remove_cv<T>::type

Definition at line 222 of file span.h.

Constructor & Destructor Documentation

template<typename T, ptrdiff_t Extent = dynamic_extent>
constexpr span_strided< T, Extent >::span_strided ( )
inlinenoexcept

Default ctr – points to nothing.

Definition at line 235 of file span.h.

template<typename T, ptrdiff_t Extent = dynamic_extent>
constexpr span_strided< T, Extent >::span_strided ( const span_strided< T, Extent > &  copy)
inline

Copy constructor.

Definition at line 238 of file span.h.

template<typename T, ptrdiff_t Extent = dynamic_extent>
constexpr span_strided< T, Extent >::span_strided ( pointer  data,
index_type  size,
stride_type  stride = 1 
)
inline

Construct from T* and size, and optionally stride.

Definition at line 242 of file span.h.

template<typename T, ptrdiff_t Extent = dynamic_extent>
constexpr span_strided< T, Extent >::span_strided ( T data)
inline

Construct from a single T&.

Definition at line 246 of file span.h.

template<typename T, ptrdiff_t Extent = dynamic_extent>
template<size_t N>
constexpr span_strided< T, Extent >::span_strided ( T(&)  data[N])
inline

Construct from a fixed-length C array. Template magic automatically finds the length from the declared type of the array.

Definition at line 251 of file span.h.

template<typename T, ptrdiff_t Extent = dynamic_extent>
OIIO_CONSTEXPR14 span_strided< T, Extent >::span_strided ( std::vector< T > &  v)
inline

Construct from std::vector<T>.

Definition at line 254 of file span.h.

template<typename T, ptrdiff_t Extent = dynamic_extent>
constexpr span_strided< T, Extent >::span_strided ( const std::vector< value_type > &  v)
inline

Construct from const std::vector<T>. This turns const std::vector<T> into an span_strided<const T> (the span_strided isn't const, but the data it points to will be).

Definition at line 260 of file span.h.

template<typename T, ptrdiff_t Extent = dynamic_extent>
constexpr span_strided< T, Extent >::span_strided ( std::initializer_list< T il)
inline

Construct an span from an initializer_list.

Definition at line 264 of file span.h.

template<typename T, ptrdiff_t Extent = dynamic_extent>
constexpr span_strided< T, Extent >::span_strided ( span< T av)
inline

Initialize from an span (stride will be 1).

Definition at line 268 of file span.h.

Member Function Documentation

template<typename T, ptrdiff_t Extent = dynamic_extent>
reference span_strided< T, Extent >::at ( index_type  idx) const
inline

Definition at line 288 of file span.h.

template<typename T, ptrdiff_t Extent = dynamic_extent>
constexpr reference span_strided< T, Extent >::back ( void  ) const
inlinenoexcept

Definition at line 294 of file span.h.

template<typename T, ptrdiff_t Extent = dynamic_extent>
constexpr pointer span_strided< T, Extent >::data ( ) const
inlinenoexcept

Definition at line 295 of file span.h.

template<typename T, ptrdiff_t Extent = dynamic_extent>
constexpr reference span_strided< T, Extent >::front ( void  ) const
inlinenoexcept

Definition at line 293 of file span.h.

template<typename T, ptrdiff_t Extent = dynamic_extent>
constexpr reference span_strided< T, Extent >::operator() ( index_type  idx) const
inline

Definition at line 285 of file span.h.

template<typename T, ptrdiff_t Extent = dynamic_extent>
span_strided& span_strided< T, Extent >::operator= ( const span_strided< T, Extent > &  copy)
inline

Definition at line 272 of file span.h.

template<typename T, ptrdiff_t Extent = dynamic_extent>
constexpr reference span_strided< T, Extent >::operator[] ( index_type  idx) const
inline

Definition at line 282 of file span.h.

template<typename T, ptrdiff_t Extent = dynamic_extent>
constexpr index_type span_strided< T, Extent >::size ( void  ) const
inlinenoexcept

Definition at line 279 of file span.h.

template<typename T, ptrdiff_t Extent = dynamic_extent>
constexpr stride_type span_strided< T, Extent >::stride ( ) const
inlinenoexcept

Definition at line 280 of file span.h.

Member Data Documentation

template<typename T, ptrdiff_t Extent = dynamic_extent>
constexpr index_type span_strided< T, Extent >::extent = Extent
static

Definition at line 232 of file span.h.


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