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 size_type = oiio_span_size_type
 
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, size_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])
 
template<class Allocator >
OIIO_CONSTEXPR14 span_strided (std::vector< T, Allocator > &v)
 Construct from std::vector<T>. More...
 
template<class Allocator >
constexpr span_strided (const std::vector< value_type, Allocator > &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 size_type size () const noexcept
 
constexpr stride_type stride () const noexcept
 
constexpr reference operator[] (size_type idx) const
 
constexpr reference operator() (size_type idx) const
 
reference at (size_type idx) const
 
constexpr reference front () const noexcept
 
constexpr reference back () const noexcept
 
constexpr pointer data () const noexcept
 

Static Public Attributes

static constexpr size_type extent = Extent
 

Detailed Description

template<typename T, oiio_span_size_type 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 254 of file span.h.

Member Typedef Documentation

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

Definition at line 269 of file span.h.

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

Definition at line 271 of file span.h.

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

Definition at line 261 of file span.h.

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

Definition at line 258 of file span.h.

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

Definition at line 268 of file span.h.

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

Definition at line 266 of file span.h.

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

Definition at line 267 of file span.h.

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

Definition at line 270 of file span.h.

template<typename T, oiio_span_size_type Extent = dynamic_extent>
using span_strided< T, Extent >::size_type = oiio_span_size_type

Definition at line 260 of file span.h.

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

Definition at line 265 of file span.h.

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

Definition at line 259 of file span.h.

Constructor & Destructor Documentation

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

Default ctr – points to nothing.

Definition at line 275 of file span.h.

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

Copy constructor.

Definition at line 278 of file span.h.

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

Construct from T* and size, and optionally stride.

Definition at line 282 of file span.h.

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

Construct from a single T&.

Definition at line 286 of file span.h.

template<typename T, oiio_span_size_type 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 291 of file span.h.

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

Construct from std::vector<T>.

Definition at line 295 of file span.h.

template<typename T, oiio_span_size_type Extent = dynamic_extent>
template<class Allocator >
constexpr span_strided< T, Extent >::span_strided ( const std::vector< value_type, Allocator > &  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 302 of file span.h.

template<typename T, oiio_span_size_type 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 306 of file span.h.

template<typename T, oiio_span_size_type 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 310 of file span.h.

Member Function Documentation

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

Definition at line 330 of file span.h.

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

Definition at line 336 of file span.h.

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

Definition at line 337 of file span.h.

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

Definition at line 335 of file span.h.

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

Definition at line 327 of file span.h.

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

Definition at line 314 of file span.h.

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

Definition at line 324 of file span.h.

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

Definition at line 321 of file span.h.

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

Definition at line 322 of file span.h.

Member Data Documentation

template<typename T, oiio_span_size_type Extent = dynamic_extent>
constexpr size_type span_strided< T, Extent >::extent = Extent
static

Definition at line 272 of file span.h.


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