Stefan Scholz / ETL
Embed: (wiki syntax)

« Back to documentation index

array_view< T > Class Template Reference

array_view< T > Class Template Reference

Array view. More...

#include <array_view.h>

Public Member Functions

 array_view ()
 Default constructor.
template<typename TArray , typename TDummy = typename etl::enable_if<!etl::is_same<T, TArray>::value, void>::type>
 array_view (TArray &a)
 Construct from std::array or etl::array or other type that supports data() and size() member functions.
template<typename TIterator , typename TDummy = typename etl::enable_if<etl::is_random_iterator<TIterator>::value, void>::type>
 array_view (TIterator begin_, TIterator end_)
 Construct from iterators.
template<typename TIterator , typename TSize , typename TDummy = typename etl::enable_if<etl::is_random_iterator<TIterator>::value, void>::type>
 array_view (TIterator begin_, TSize size_)
 Construct from C array.
template<const size_t ARRAY_SIZE>
 array_view (T(&begin_)[ARRAY_SIZE])
 Construct from C array.
 array_view (const array_view &other)
 Copy constructor.
reference front ()
 Returns a reference to the first element.
const_reference front () const
 Returns a const reference to the first element.
reference back ()
 Returns a reference to the last element.
const_reference back () const
 Returns a const reference to the last element.
pointer data ()
 Returns a pointer to the first element of the internal storage.
const_pointer data () const
 Returns a const pointer to the first element of the internal storage.
iterator begin ()
 Returns an iterator to the beginning of the array.
const_iterator begin () const
 Returns a const iterator to the beginning of the array.
const_iterator cbegin () const
 Returns a const iterator to the beginning of the array.
iterator end ()
 Returns an iterator to the end of the array.
const_iterator end () const
 Returns a const iterator to the end of the array.
const_reverse_iterator rbegin () const
 Returns a const reverse iterator to the reverse beginning of the array.
const_reverse_iterator crbegin () const
 Returns a const reverse iterator to the reverse beginning of the array.
reverse_iterator rend ()
 Returns a reverse iterator to the end of the array.
const_reverse_iterator rend () const
 Returns a const reverse iterator to the end of the array.
const_reverse_iterator crend () const
 Returns a const reverse iterator to the end of the array.
bool empty () const
 Returns true if the array size is zero.
size_t size () const
 Returns the size of the array.
size_t max_size () const
 Returns the maximum possible size of the array.
array_viewoperator= (const array_view &other)
 Assign from a view.
template<typename TIterator , typename TDummy = typename etl::enable_if<etl::is_random_iterator<TIterator>::value, void>::type>
void assign (TIterator begin_, TIterator end_)
 Assign from iterators.
template<typename TIterator , typename TSize , typename TDummy = typename etl::enable_if<etl::is_random_iterator<TIterator>::value, void>::type>
void assign (TIterator begin_, TSize size_)
 Assign from iterator and size.
reference operator[] (size_t i)
 Returns a reference to the indexed value.
const_reference operator[] (size_t i) const
 Returns a const reference to the indexed value.
reference at (size_t i)
 Returns a reference to the indexed value.
const_reference at (size_t i) const
 Returns a const reference to the indexed value.
void swap (array_view &other)
 Swaps with another array_view.
void remove_prefix (size_type n)
 Shrinks the view by moving its start forward.
void remove_suffix (size_type n)
 Shrinks the view by moving its end backward.

Friends

bool operator== (const array_view< T > &lhs, const array_view< T > &rhs)
 Equality for array views.
bool operator!= (const array_view< T > &lhs, const array_view< T > &rhs)
 Inequality for array views.
bool operator< (const array_view< T > &lhs, const array_view< T > &rhs)
 Less-than for array views.
bool operator> (const array_view< T > &lhs, const array_view< T > &rhs)
 Greater-than for array views.
bool operator<= (const array_view< T > &lhs, const array_view< T > &rhs)
 Less-than-equal for array views.
bool operator>= (const array_view< T > &lhs, const array_view< T > &rhs)
 Greater-than-equal for array views.

Detailed Description

template<typename T>
class etl::array_view< T >

Array view.

Definition at line 98 of file array_view.h.


Constructor & Destructor Documentation

array_view (  )

Default constructor.

Definition at line 116 of file array_view.h.

array_view ( TArray &  a ) [explicit]

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

Definition at line 128 of file array_view.h.

array_view ( TIterator  begin_,
TIterator  end_ 
)

Construct from iterators.

Definition at line 139 of file array_view.h.

array_view ( TIterator  begin_,
TSize  size_ 
)

Construct from C array.

Definition at line 151 of file array_view.h.

array_view ( T(&)  begin_[ARRAY_SIZE] ) [explicit]

Construct from C array.

Definition at line 161 of file array_view.h.

array_view ( const array_view< T > &  other )

Copy constructor.

Definition at line 170 of file array_view.h.


Member Function Documentation

void assign ( TIterator  begin_,
TIterator  end_ 
)

Assign from iterators.

Definition at line 359 of file array_view.h.

void assign ( TIterator  begin_,
TSize  size_ 
)

Assign from iterator and size.

Definition at line 371 of file array_view.h.

reference at ( size_t  i )

Returns a reference to the indexed value.

Definition at line 396 of file array_view.h.

const_reference at ( size_t  i ) const

Returns a const reference to the indexed value.

Definition at line 406 of file array_view.h.

reference back (  )

Returns a reference to the last element.

Definition at line 195 of file array_view.h.

const_reference back (  ) const

Returns a const reference to the last element.

Definition at line 203 of file array_view.h.

const_iterator begin (  ) const

Returns a const iterator to the beginning of the array.

Definition at line 235 of file array_view.h.

iterator begin (  )

Returns an iterator to the beginning of the array.

Definition at line 227 of file array_view.h.

const_iterator cbegin (  ) const

Returns a const iterator to the beginning of the array.

Definition at line 243 of file array_view.h.

const_reverse_iterator crbegin (  ) const

Returns a const reverse iterator to the reverse beginning of the array.

Definition at line 291 of file array_view.h.

const_reverse_iterator crend (  ) const

Returns a const reverse iterator to the end of the array.

Definition at line 315 of file array_view.h.

pointer data (  )

Returns a pointer to the first element of the internal storage.

Definition at line 211 of file array_view.h.

const_pointer data (  ) const

Returns a const pointer to the first element of the internal storage.

Definition at line 219 of file array_view.h.

bool empty (  ) const

Returns true if the array size is zero.

Definition at line 323 of file array_view.h.

iterator end (  )

Returns an iterator to the end of the array.

Definition at line 251 of file array_view.h.

const_iterator end (  ) const

Returns a const iterator to the end of the array.

Definition at line 259 of file array_view.h.

const_reference front (  ) const

Returns a const reference to the first element.

Definition at line 187 of file array_view.h.

reference front (  )

Returns a reference to the first element.

Definition at line 179 of file array_view.h.

size_t max_size (  ) const

Returns the maximum possible size of the array.

Definition at line 339 of file array_view.h.

array_view& operator= ( const array_view< T > &  other )

Assign from a view.

Definition at line 347 of file array_view.h.

const_reference operator[] ( size_t  i ) const

Returns a const reference to the indexed value.

Definition at line 388 of file array_view.h.

reference operator[] ( size_t  i )

Returns a reference to the indexed value.

Definition at line 380 of file array_view.h.

const_reverse_iterator rbegin (  ) const

Returns a const reverse iterator to the reverse beginning of the array.

Definition at line 283 of file array_view.h.

void remove_prefix ( size_type  n )

Shrinks the view by moving its start forward.

Definition at line 425 of file array_view.h.

void remove_suffix ( size_type  n )

Shrinks the view by moving its end backward.

Definition at line 433 of file array_view.h.

const_reverse_iterator rend (  ) const

Returns a const reverse iterator to the end of the array.

Definition at line 307 of file array_view.h.

reverse_iterator rend (  )

Returns a reverse iterator to the end of the array.

Definition at line 299 of file array_view.h.

size_t size (  ) const

Returns the size of the array.

Definition at line 331 of file array_view.h.

void swap ( array_view< T > &  other )

Swaps with another array_view.

Definition at line 416 of file array_view.h.


Friends And Related Function Documentation

bool operator!= ( const array_view< T > &  lhs,
const array_view< T > &  rhs 
) [friend]

Inequality for array views.

Definition at line 450 of file array_view.h.

bool operator< ( const array_view< T > &  lhs,
const array_view< T > &  rhs 
) [friend]

Less-than for array views.

Definition at line 458 of file array_view.h.

bool operator<= ( const array_view< T > &  lhs,
const array_view< T > &  rhs 
) [friend]

Less-than-equal for array views.

Definition at line 474 of file array_view.h.

bool operator== ( const array_view< T > &  lhs,
const array_view< T > &  rhs 
) [friend]

Equality for array views.

Definition at line 441 of file array_view.h.

bool operator> ( const array_view< T > &  lhs,
const array_view< T > &  rhs 
) [friend]

Greater-than for array views.

Definition at line 466 of file array_view.h.

bool operator>= ( const array_view< T > &  lhs,
const array_view< T > &  rhs 
) [friend]

Greater-than-equal for array views.

Definition at line 482 of file array_view.h.