Stefan Scholz / ETL
Embed: (wiki syntax)

« Back to documentation index

const_array_view< T > Class Template Reference

const_array_view< T > Class Template Reference

Constant array view. More...

#include <array_view.h>

Public Member Functions

 const_array_view ()
 Default constructor.
template<typename TArray , typename TDummy = typename etl::enable_if<!etl::is_same<T, TArray>::value, void>::type>
 const_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>
 const_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>
 const_array_view (TIterator begin_, TSize size_)
 Construct from C array.
template<const size_t ARRAY_SIZE>
 const_array_view (const T(&begin_)[ARRAY_SIZE])
 Construct from C array.
 const_array_view (const array_view< T > &other)
 Copy constructor.
 const_array_view (const const_array_view &other)
 Copy constructor.
const_reference front () const
 Returns a const reference to the first element.
const_reference back () const
 Returns a const reference to the last element.
const_pointer data () const
 Returns a const pointer to the first element of the internal storage.
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.
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.
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.
const_array_view< T > & operator= (const const_array_view< T > &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.
const_reference operator[] (size_t i) const
 Returns a const reference to the indexed value.
const_reference at (size_t i) const
 Returns a const reference to the indexed value.
void swap (const_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 const_array_view< T > &lhs, const const_array_view< T > &rhs)
 Equality for array views.
bool operator!= (const const_array_view< T > &lhs, const const_array_view< T > &rhs)
 Inequality for array views.
bool operator< (const const_array_view< T > &lhs, const const_array_view< T > &rhs)
 Less-than for array views.
bool operator> (const const_array_view< T > &lhs, const const_array_view< T > &rhs)
 Greater-than for array views.
bool operator<= (const const_array_view< T > &lhs, const const_array_view< T > &rhs)
 Less-than-equal for array views.
bool operator>= (const const_array_view< T > &lhs, const const_array_view< T > &rhs)
 Greater-than-equal for array views.

Detailed Description

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

Constant array view.

Definition at line 497 of file array_view.h.


Constructor & Destructor Documentation

Default constructor.

Definition at line 511 of file array_view.h.

const_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 523 of file array_view.h.

const_array_view ( TIterator  begin_,
TIterator  end_ 
)

Construct from iterators.

Definition at line 534 of file array_view.h.

const_array_view ( TIterator  begin_,
TSize  size_ 
)

Construct from C array.

Definition at line 545 of file array_view.h.

const_array_view ( const T(&)  begin_[ARRAY_SIZE] ) [explicit]

Construct from C array.

Definition at line 555 of file array_view.h.

const_array_view ( const array_view< T > &  other )

Copy constructor.

Definition at line 564 of file array_view.h.

const_array_view ( const const_array_view< T > &  other )

Copy constructor.

Definition at line 573 of file array_view.h.


Member Function Documentation

void assign ( TIterator  begin_,
TIterator  end_ 
)

Assign from iterators.

Definition at line 710 of file array_view.h.

void assign ( TIterator  begin_,
TSize  size_ 
)

Assign from iterator and size.

Definition at line 722 of file array_view.h.

const_reference at ( size_t  i ) const

Returns a const reference to the indexed value.

Definition at line 739 of file array_view.h.

const_reference back (  ) const

Returns a const reference to the last element.

Definition at line 590 of file array_view.h.

const_iterator begin (  ) const

Returns a const iterator to the beginning of the array.

Definition at line 606 of file array_view.h.

const_iterator cbegin (  ) const

Returns a const iterator to the beginning of the array.

Definition at line 614 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 646 of file array_view.h.

const_reverse_iterator crend (  ) const

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

Definition at line 662 of file array_view.h.

const_pointer data (  ) const

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

Definition at line 598 of file array_view.h.

bool empty (  ) const

Returns true if the array size is zero.

Definition at line 674 of file array_view.h.

const_iterator end (  ) const

Returns a const iterator to the end of the array.

Definition at line 622 of file array_view.h.

const_reference front (  ) const

Returns a const reference to the first element.

Definition at line 582 of file array_view.h.

size_t max_size (  ) const

Returns the maximum possible size of the array.

Definition at line 690 of file array_view.h.

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

Assign from a view.

Definition at line 698 of file array_view.h.

const_reference operator[] ( size_t  i ) const

Returns a const reference to the indexed value.

Definition at line 731 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 638 of file array_view.h.

void remove_prefix ( size_type  n )

Shrinks the view by moving its start forward.

Definition at line 758 of file array_view.h.

void remove_suffix ( size_type  n )

Shrinks the view by moving its end backward.

Definition at line 766 of file array_view.h.

const_reverse_iterator rend (  ) const

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

Definition at line 654 of file array_view.h.

size_t size (  ) const

Returns the size of the array.

Definition at line 682 of file array_view.h.

void swap ( const_array_view< T > &  other )

Swaps with another array_view.

Definition at line 749 of file array_view.h.


Friends And Related Function Documentation

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

Inequality for array views.

Definition at line 783 of file array_view.h.

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

Less-than for array views.

Definition at line 791 of file array_view.h.

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

Less-than-equal for array views.

Definition at line 807 of file array_view.h.

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

Equality for array views.

Definition at line 774 of file array_view.h.

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

Greater-than for array views.

Definition at line 799 of file array_view.h.

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

Greater-than-equal for array views.

Definition at line 815 of file array_view.h.