Embedded Template Library  1.0
 All Classes Files Functions Variables Typedefs Friends Modules Pages
etl::ideque< T > Class Template Reference

#include <ideque.h>

Classes

struct  const_iterator
 Const Iterator. More...
 
struct  is_iterator
 Test for an iterator. More...
 
struct  iterator
 Iterator. More...
 

Public Types

typedef T value_type
 
typedef size_t size_type
 
typedef T & reference
 
typedef const T & const_reference
 
typedef T * pointer
 
typedef const T * const_pointer
 
typedef std::iterator_traits
< pointer >::difference_type 
difference_type
 
typedef std::reverse_iterator
< iterator
reverse_iterator
 
typedef std::reverse_iterator
< const_iterator
const_reverse_iterator
 
- Public Types inherited from etl::deque_base
typedef size_t size_type
 

Public Member Functions

idequeoperator= (const ideque &other)
 Assignment operator.
 
template<typename TIterator >
etl::enable_if< is_iterator
< TIterator >::value, void >
::type 
assign (TIterator range_begin, TIterator range_end)
 Assigns a range to the deque.
 
void assign (size_type n, const value_type &value)
 
reference at (size_t index)
 
const_reference at (size_t index) const
 
reference operator[] (size_t index)
 
const_reference operator[] (size_t index) const
 
reference front ()
 
const_reference front () const
 
reference back ()
 
const_reference back () const
 
iterator begin ()
 Gets an iterator to the beginning of the deque.
 
const_iterator begin () const
 Gets a const iterator to the beginning of the deque.
 
const_iterator cbegin () const
 Gets a const iterator to the beginning of the deque.
 
iterator end ()
 Gets an iterator to the end of the deque.
 
const_iterator end () const
 Gets a const iterator to the end of the deque.
 
const_iterator cend () const
 Gets a const iterator to the end of the deque.
 
reverse_iterator rbegin ()
 Gets a reverse iterator to the end of the deque.
 
const_reverse_iterator rbegin () const
 Gets a const reverse iterator to the end of the deque.
 
const_reverse_iterator crbegin () const
 Gets a const reverse iterator to the end of the deque.
 
reverse_iterator rend ()
 Gets a reverse iterator to the beginning of the deque.
 
const_reverse_iterator rend () const
 Gets a const reverse iterator to the beginning of the deque.
 
const_reverse_iterator crend () const
 Gets a const reverse iterator to the beginning of the deque.
 
void clear ()
 Clears the deque.
 
iterator insert (const_iterator insert_position, const value_type &value)
 
iterator insert (const_iterator insert_position, size_type n, const value_type &value)
 
template<typename TIterator >
enable_if< is_iterator
< TIterator >::value, iterator >
::type 
insert (const_iterator insert_position, TIterator range_begin, TIterator range_end)
 
iterator erase (const_iterator erase_position)
 
iterator erase (const_iterator range_begin, const_iterator range_end)
 
void push_back (parameter_t item)
 
reference push_back ()
 
void pop_back ()
 Removes the oldest item from the deque.
 
void push_front (parameter_t item)
 
reference push_front ()
 
void pop_front ()
 Removes the oldest item from the deque.
 
void resize (size_t new_size, const value_type &value=value_type())
 
- Public Member Functions inherited from etl::deque_base
size_type size () const
 
bool empty () const
 
bool full () const
 
size_type capacity () const
 
size_type max_size () const
 
size_t available () const
 
void clear ()
 Clears the deque.
 

Protected Types

typedef parameter_type< T >::type parameter_t
 

Protected Member Functions

 ideque (pointer p_buffer, size_t max_size, size_t buffer_size)
 Constructor.
 
- Protected Member Functions inherited from etl::deque_base
 deque_base (size_t max_size, size_t buffer_size)
 Constructor.
 

Protected Attributes

iterator first
 
iterator last
 Iterator to the first item in the deque.
 
pointer p_buffer
 Iterator to the last item in the deque.
 
- Protected Attributes inherited from etl::deque_base
size_type current_size
 The current number of elements in the deque.
 
const size_type MAX_SIZE
 The maximum number of elements in the deque.
 
const size_type BUFFER_SIZE
 The of elements in the buffer.
 

Friends

difference_type operator- (const iterator &lhs, const iterator &rhs)
 
difference_type operator- (const const_iterator &lhs, const const_iterator &rhs)
 
difference_type operator- (const reverse_iterator &lhs, const reverse_iterator &rhs)
 
difference_type operator- (const const_reverse_iterator &lhs, const const_reverse_iterator &rhs)
 

Detailed Description

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

The base class for all etl::deque classes.

Template Parameters
TThe type of values this deque should hold.

Member Function Documentation

template<typename T>
void etl::ideque< T >::assign ( size_type  n,
const value_type &  value 
)
inline

Assigns 'n' copies of a value to the deque. If ETL_THROW_EXCEPTIONS is defined, throws an etl::deque_full is 'n' is too large.

Parameters
nThe number of copies to assign.
valueThe value to add.<
template<typename T>
reference etl::ideque< T >::at ( size_t  index)
inline

Gets a reference to the item at the index. If ETL_THROW_EXCEPTIONS is defined, throws an etl::deque_out_of_bounds if the index is out of range.

Returns
A reference to the item at the index.
template<typename T>
const_reference etl::ideque< T >::at ( size_t  index) const
inline

Gets a const reference to the item at the index. If ETL_THROW_EXCEPTIONS is defined, throws an etl::deque_out_of_bounds if the index is out of range.

Returns
A const reference to the item at the index.
template<typename T>
reference etl::ideque< T >::back ( )
inline

Gets a reference to the item at the back of the deque.

Returns
A reference to the item at the back of the deque.
template<typename T>
const_reference etl::ideque< T >::back ( ) const
inline

Gets a const reference to the item at the back of the deque.

Returns
A const reference to the item at the back of the deque.
template<typename T>
iterator etl::ideque< T >::erase ( const_iterator  erase_position)
inline

erase an item. If ETL_THROW_EXCEPTIONS is defined, throws an etl::deque_out_of_bounds if the position is out of range.

Parameters
erase_positionThe position to erase.
template<typename T>
iterator etl::ideque< T >::erase ( const_iterator  range_begin,
const_iterator  range_end 
)
inline

erase a range. If ETL_THROW_EXCEPTIONS is defined, throws an etl::deque_out_of_bounds if the iterators are out of range.

Parameters
range_beginThe beginning of the range to erase.
range_endThe end of the range to erase.
template<typename T>
reference etl::ideque< T >::front ( )
inline

Gets a reference to the item at the front of the deque.

Returns
A reference to the item at the front of the deque.
template<typename T>
const_reference etl::ideque< T >::front ( ) const
inline

Gets a const reference to the item at the front of the deque.

Returns
A const reference to the item at the front of the deque.
template<typename T>
iterator etl::ideque< T >::insert ( const_iterator  insert_position,
const value_type &  value 
)
inline

Inserts data into the deque. If ETL_THROW_EXCEPTIONS is defined, throws an etl::deque_full if the deque is full.

Parameters
insert_position>Theinsert position.
value>Thevalue to insert.
template<typename T>
iterator etl::ideque< T >::insert ( const_iterator  insert_position,
size_type  n,
const value_type &  value 
)
inline

Inserts 'n' copies of a value into the deque. If ETL_THROW_EXCEPTIONS is defined, throws an etl::deque_full if the deque is full.

Parameters
insert_positionThe insert position.
nThe number of values to insert.
valueThe value to insert.
template<typename T>
template<typename TIterator >
enable_if<is_iterator<TIterator>::value, iterator>::type etl::ideque< T >::insert ( const_iterator  insert_position,
TIterator  range_begin,
TIterator  range_end 
)
inline

Inserts a range into the deque. If ETL_THROW_EXCEPTIONS is defined, throws an etl::deque_empty if the deque is full.

Parameters
insert_position>Theinsert position.
range_beginThe beginning of the range to insert.
range_endThe end of the range to insert.
template<typename T>
reference etl::ideque< T >::operator[] ( size_t  index)
inline

Gets a reference to the item at the index.

Returns
A reference to the item at the index.
template<typename T>
const_reference etl::ideque< T >::operator[] ( size_t  index) const
inline

Gets a const reference to the item at the index.

Returns
A const reference to the item at the index.
template<typename T>
void etl::ideque< T >::push_back ( parameter_t  item)
inline

Adds an item to the back of the deque. If ETL_THROW_EXCEPTIONS is defined, throws an etl::deque_full is the deque is already full.

Parameters
itemThe item to push to the deque.
template<typename T>
reference etl::ideque< T >::push_back ( )
inline

Adds one to the front of the deque and returns a reference to the new element. If ETL_THROW_EXCEPTIONS is defined, throws an etl::deque_full is the deque is already full.

Returns
A reference to the item to assign to.
template<typename T>
void etl::ideque< T >::push_front ( parameter_t  item)
inline

Adds an item to the front of the deque. If ETL_THROW_EXCEPTIONS is defined, throws an etl::deque_full is the deque is already full.

Parameters
itemThe item to push to the deque.
template<typename T>
reference etl::ideque< T >::push_front ( )
inline

Adds one to the front of the deque and returns a reference to the new element. If ETL_THROW_EXCEPTIONS is defined, throws an etl::deque_full is the deque is already full.

Returns
A reference to the item to assign to.
template<typename T>
void etl::ideque< T >::resize ( size_t  new_size,
const value_type &  value = value_type() 
)
inline

Resizes the deque. If ETL_THROW_EXCEPTIONS is defined, throws an etl::deque_full is 'new_size' is too large.

Parameters
new_sizeThe new size of the deque.
valueThe value to assign if the new size is larger. Default = Default constructed value.

Friends And Related Function Documentation

template<typename T>
difference_type operator- ( const iterator lhs,
const iterator rhs 
)
friend
  • operator for iterator
template<typename T>
difference_type operator- ( const const_iterator lhs,
const const_iterator rhs 
)
friend
template<typename T>
difference_type operator- ( const reverse_iterator &  lhs,
const reverse_iterator &  rhs 
)
friend
  • operator for reverse_iterator
template<typename T>
difference_type operator- ( const const_reverse_iterator &  lhs,
const const_reverse_iterator &  rhs 
)
friend
  • operator for const_reverse_iterator

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