Stefan Scholz / ETL
Embed: (wiki syntax)

« Back to documentation index

ideque< T > Class Template Reference

The base class for all etl::deque classes. More...

#include <deque.h>

Inherits etl::deque_base.

Inherited by deque< T, MAX_SIZE_ >.

Data Structures

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

Public Member Functions

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)
 Assigns 'n' copies of a value to the deque.
reference at (size_t index)
 Gets a reference to the item at the index.
const_reference at (size_t index) const
 Gets a const reference to the item at the index.
reference operator[] (size_t index)
 Gets a reference to the item at the index.
const_reference operator[] (size_t index) const
 Gets a const reference to the item at the index.
reference front ()
 Gets a reference to the item at the front of the deque.
const_reference front () const
 Gets a const reference to the item at the front of the deque.
reference back ()
 Gets a reference to the item at the back of the deque.
const_reference back () const
 Gets a const reference to the item at the back of the deque.
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)
 Inserts data into the deque.
template<typename T1 >
iterator emplace (const_iterator insert_position, const T1 &value1)
 Emplaces data into the deque.
template<typename T1 , typename T2 >
iterator emplace (const_iterator insert_position, const T1 &value1, const T2 &value2)
 Emplaces data into the deque.
template<typename T1 , typename T2 , typename T3 >
iterator emplace (const_iterator insert_position, const T1 &value1, const T2 &value2, const T3 &value3)
 Emplaces data into the deque.
template<typename T1 , typename T2 , typename T3 , typename T4 >
iterator emplace (const_iterator insert_position, const T1 &value1, const T2 &value2, const T3 &value3, const T4 &value4)
 Emplaces data into the deque.
iterator insert (const_iterator insert_position, size_type n, const value_type &value)
 Inserts 'n' copies of a value into the deque.
template<typename TIterator >
enable_if< is_iterator
< TIterator >::value, iterator >
::type 
insert (const_iterator insert_position, TIterator range_begin, TIterator range_end)
 Inserts a range into the deque.
iterator erase (const_iterator erase_position)
 Erase an item.
iterator erase (const_iterator range_begin, const_iterator range_end)
 erase a range.
void push_back (parameter_t item)
 Adds an item to the back of the deque.
reference push_back ()
 Adds one to the front of the deque and returns a reference to the new element.
template<typename T1 >
void emplace_back (const T1 &value1)
 Emplaces an item to the back of the deque.
template<typename T1 , typename T2 >
void emplace_back (const T1 &value1, const T2 &value2)
 Emplaces an item to the back of the deque.
template<typename T1 , typename T2 , typename T3 >
void emplace_back (const T1 &value1, const T2 &value2, const T3 &value3)
 Emplaces an item to the back of the deque.
template<typename T1 , typename T2 , typename T3 , typename T4 >
void emplace_back (const T1 &value1, const T2 &value2, const T3 &value3, const T4 &value4)
 Emplaces an item to the back of the deque.
void pop_back ()
 Removes the oldest item from the deque.
void push_front (parameter_t item)
 Adds an item to the front of the deque.
reference push_front ()
 Adds one to the front of the deque and returns a reference to the new element.
template<typename T1 >
void emplace_front (const T1 &value1)
 Emplaces an item to the front of the deque.
template<typename T1 , typename T2 >
void emplace_front (const T1 &value1, const T2 &value2)
 Emplaces an item to the front of the deque.
template<typename T1 , typename T2 , typename T3 >
void emplace_front (const T1 &value1, const T2 &value2, const T3 &value3)
 Emplaces an item to the front of the deque.
template<typename T1 , typename T2 , typename T3 , typename T4 >
void emplace_front (const T1 &value1, const T2 &value2, const T3 &value3, const T4 &value4)
 Emplaces an item to the front of the deque.
void pop_front ()
 Removes the oldest item from the deque.
void resize (size_t new_size, const value_type &value=value_type())
 Resizes the deque.
idequeoperator= (const ideque &rhs)
 Assignment operator.
virtual void repair ()=0
 Fix the internal pointers after a low level memory copy.
size_type size () const
 Gets the current size of the deque.
bool empty () const
 Checks the 'empty' state of the deque.
bool full () const
 Checks the 'full' state of the deque.
size_type max_size () const
 Returns the maximum possible size of the deque.
size_t available () const
 Returns the remaining capacity.

Protected Member Functions

 ideque (pointer p_buffer_, size_t max_size_, size_t buffer_size_)
 Constructor.
void initialise ()
 Initialise the deque.
void repair (pointer p_buffer_)
 Fix the internal pointers after a low level memory copy.

Protected Attributes

iterator _end
 Iterator to the _begin item in the deque.
pointer p_buffer
 Iterator to the _end item in the deque.
size_type current_size
 The current number of elements in the deque.
const size_type CAPACITY
 The maximum number of elements in the deque.
const size_type BUFFER_SIZE
 The number of elements in the buffer.
etl::debug_count construct_count
 Internal debugging.

Friends

difference_type operator- (const iterator &lhs, const iterator &rhs)
 
  • operator for iterator

difference_type operator- (const const_iterator &lhs, const const_iterator &rhs)
 
difference_type operator- (const reverse_iterator &lhs, const reverse_iterator &rhs)
 
  • operator for reverse_iterator

difference_type operator- (const const_reverse_iterator &lhs, const const_reverse_iterator &rhs)
 
  • operator for const_reverse_iterator


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.

Definition at line 215 of file deque.h.


Constructor & Destructor Documentation

ideque ( pointer  p_buffer_,
size_t  max_size_,
size_t  buffer_size_ 
) [protected]

Constructor.

Definition at line 1789 of file deque.h.


Member Function Documentation

etl::enable_if<is_iterator<TIterator>::value, void>::type assign ( TIterator  range_begin,
TIterator  range_end 
)

Assigns a range to the deque.

Definition at line 630 of file deque.h.

void assign ( size_type  n,
const value_type &  value 
)

Assigns 'n' copies of a value to the deque.

If asserts or exceptions are enabled, throws an etl::deque_full is 'n' is too large.

Parameters:
nThe number of copies to assign.
valueThe value to add.<

Definition at line 646 of file deque.h.

const_reference at ( size_t  index ) const

Gets a const reference to the item at the index.

If asserts or exceptions are enabled, throws an etl::deque_out_of_bounds if the index is out of range.

Returns:
A const reference to the item at the index.

Definition at line 682 of file deque.h.

reference at ( size_t  index )

Gets a reference to the item at the index.

If asserts or exceptions are enabled, throws an etl::deque_out_of_bounds if the index is out of range.

Returns:
A reference to the item at the index.

Definition at line 667 of file deque.h.

size_t available (  ) const [inherited]

Returns the remaining capacity.

Returns:
The remaining capacity.

Definition at line 186 of file deque.h.

reference back (  )

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

Returns:
A reference to the item at the back of the deque.

Definition at line 738 of file deque.h.

const_reference back (  ) const

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.

Definition at line 747 of file deque.h.

iterator begin (  )

Gets an iterator to the beginning of the deque.

Definition at line 755 of file deque.h.

const_iterator begin (  ) const

Gets a const iterator to the beginning of the deque.

Definition at line 763 of file deque.h.

const_iterator cbegin (  ) const

Gets a const iterator to the beginning of the deque.

Definition at line 771 of file deque.h.

const_iterator cend (  ) const

Gets a const iterator to the end of the deque.

Definition at line 795 of file deque.h.

void clear (  )

Clears the deque.

Definition at line 851 of file deque.h.

const_reverse_iterator crbegin (  ) const

Gets a const reverse iterator to the end of the deque.

Definition at line 819 of file deque.h.

const_reverse_iterator crend (  ) const

Gets a const reverse iterator to the beginning of the deque.

Definition at line 843 of file deque.h.

iterator emplace ( const_iterator  insert_position,
const T1 &  value1 
)

Emplaces data into the deque.

If asserts or exceptions are enabled, throws an etl::deque_full if the deque is full.

Parameters:
insert_position>Theinsert position.

Definition at line 914 of file deque.h.

iterator emplace ( const_iterator  insert_position,
const T1 &  value1,
const T2 &  value2 
)

Emplaces data into the deque.

If asserts or exceptions are enabled, throws an etl::deque_full if the deque is full.

Parameters:
insert_position>Theinsert position.

Definition at line 979 of file deque.h.

iterator emplace ( const_iterator  insert_position,
const T1 &  value1,
const T2 &  value2,
const T3 &  value3 
)

Emplaces data into the deque.

If asserts or exceptions are enabled, throws an etl::deque_full if the deque is full.

Parameters:
insert_position>Theinsert position.

Definition at line 1044 of file deque.h.

iterator emplace ( const_iterator  insert_position,
const T1 &  value1,
const T2 &  value2,
const T3 &  value3,
const T4 &  value4 
)

Emplaces data into the deque.

If asserts or exceptions are enabled, throws an etl::deque_full if the deque is full.

Parameters:
insert_position>Theinsert position.

Definition at line 1109 of file deque.h.

void emplace_back ( const T1 &  value1 )

Emplaces an item to the back of the deque.

If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full.

Definition at line 1521 of file deque.h.

void emplace_back ( const T1 &  value1,
const T2 &  value2 
)

Emplaces an item to the back of the deque.

If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full.

Definition at line 1538 of file deque.h.

void emplace_back ( const T1 &  value1,
const T2 &  value2,
const T3 &  value3 
)

Emplaces an item to the back of the deque.

If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full.

Definition at line 1555 of file deque.h.

void emplace_back ( const T1 &  value1,
const T2 &  value2,
const T3 &  value3,
const T4 &  value4 
)

Emplaces an item to the back of the deque.

If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full.

Definition at line 1572 of file deque.h.

void emplace_front ( const T1 &  value1 )

Emplaces an item to the front of the deque.

If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full.

Definition at line 1628 of file deque.h.

void emplace_front ( const T1 &  value1,
const T2 &  value2 
)

Emplaces an item to the front of the deque.

If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full.

Definition at line 1645 of file deque.h.

void emplace_front ( const T1 &  value1,
const T2 &  value2,
const T3 &  value3 
)

Emplaces an item to the front of the deque.

If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full.

Definition at line 1662 of file deque.h.

void emplace_front ( const T1 &  value1,
const T2 &  value2,
const T3 &  value3,
const T4 &  value4 
)

Emplaces an item to the front of the deque.

If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full.

Definition at line 1679 of file deque.h.

bool empty (  ) const [inherited]

Checks the 'empty' state of the deque.

Returns:
true if empty.

Definition at line 159 of file deque.h.

iterator end (  )

Gets an iterator to the end of the deque.

Definition at line 779 of file deque.h.

const_iterator end (  ) const

Gets a const iterator to the end of the deque.

Definition at line 787 of file deque.h.

iterator erase ( const_iterator  range_begin,
const_iterator  range_end 
)

erase a range.

If asserts or exceptions are enabled, 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.

Definition at line 1426 of file deque.h.

iterator erase ( const_iterator  erase_position )

Erase an item.

If asserts or exceptions are enabled, throws an etl::deque_out_of_bounds if the position is out of range.

Parameters:
erase_positionThe position to erase.

Definition at line 1385 of file deque.h.

const_reference front (  ) const

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.

Definition at line 729 of file deque.h.

reference front (  )

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

Returns:
A reference to the item at the front of the deque.

Definition at line 720 of file deque.h.

bool full (  ) const [inherited]

Checks the 'full' state of the deque.

Returns:
true if full.

Definition at line 168 of file deque.h.

void initialise (  ) [protected]

Initialise the deque.

Definition at line 1798 of file deque.h.

iterator insert ( const_iterator  insert_position,
const value_type &  value 
)

Inserts data into the deque.

If asserts or exceptions are enabled, throws an etl::deque_full if the deque is full.

Parameters:
insert_position>Theinsert position.
value>Thevalue to insert.

Definition at line 862 of file deque.h.

iterator insert ( const_iterator  insert_position,
size_type  n,
const value_type &  value 
)

Inserts 'n' copies of a value into the deque.

If asserts or exceptions are enabled, 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.

Definition at line 1175 of file deque.h.

enable_if<is_iterator<TIterator>::value, iterator>::type insert ( const_iterator  insert_position,
TIterator  range_begin,
TIterator  range_end 
)

Inserts a range into the deque.

If asserts or exceptions are enabled, 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.

Definition at line 1284 of file deque.h.

size_type max_size (  ) const [inherited]

Returns the maximum possible size of the deque.

Returns:
The maximum size of the deque.

Definition at line 177 of file deque.h.

ideque& operator= ( const ideque< T > &  rhs )

Assignment operator.

Definition at line 1767 of file deque.h.

reference operator[] ( size_t  index )

Gets a reference to the item at the index.

Returns:
A reference to the item at the index.

Definition at line 696 of file deque.h.

const_reference operator[] ( size_t  index ) const

Gets a const reference to the item at the index.

Returns:
A const reference to the item at the index.

Definition at line 708 of file deque.h.

void pop_back (  )

Removes the oldest item from the deque.

Definition at line 1587 of file deque.h.

void pop_front (  )

Removes the oldest item from the deque.

Definition at line 1694 of file deque.h.

void push_back ( parameter_t  item )

Adds an item to the back of the deque.

If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full.

Parameters:
itemThe item to push to the deque.

Definition at line 1492 of file deque.h.

reference push_back (  )

Adds one to the front of the deque and returns a reference to the new element.

If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full.

Returns:
A reference to the item to assign to.

Definition at line 1505 of file deque.h.

void push_front ( parameter_t  item )

Adds an item to the front of the deque.

If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full.

Parameters:
itemThe item to push to the deque.

Definition at line 1600 of file deque.h.

reference push_front (  )

Adds one to the front of the deque and returns a reference to the new element.

If asserts or exceptions are enabled, throws an etl::deque_full if the deque is already full.

Returns:
A reference to the item to assign to.

Definition at line 1613 of file deque.h.

reverse_iterator rbegin (  )

Gets a reverse iterator to the end of the deque.

Definition at line 803 of file deque.h.

const_reverse_iterator rbegin (  ) const

Gets a const reverse iterator to the end of the deque.

Definition at line 811 of file deque.h.

const_reverse_iterator rend (  ) const

Gets a const reverse iterator to the beginning of the deque.

Definition at line 835 of file deque.h.

reverse_iterator rend (  )

Gets a reverse iterator to the beginning of the deque.

Definition at line 827 of file deque.h.

void repair ( pointer  p_buffer_ ) [protected]

Fix the internal pointers after a low level memory copy.

Definition at line 1812 of file deque.h.

virtual void repair (  ) [pure virtual]

Fix the internal pointers after a low level memory copy.

Implemented in deque< T, MAX_SIZE_ >.

void resize ( size_t  new_size,
const value_type &  value = value_type() 
)

Resizes the deque.

If asserts or exceptions are enabled, 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.

Definition at line 1708 of file deque.h.

size_type size (  ) const [inherited]

Gets the current size of the deque.

Returns:
The current size of the deque.

Definition at line 150 of file deque.h.


Friends And Related Function Documentation

difference_type operator- ( const iterator lhs,
const iterator rhs 
) [friend]

  • operator for iterator

Definition at line 1735 of file deque.h.

difference_type operator- ( const const_reverse_iterator &  lhs,
const const_reverse_iterator &  rhs 
) [friend]

  • operator for const_reverse_iterator

Definition at line 1759 of file deque.h.

difference_type operator- ( const reverse_iterator &  lhs,
const reverse_iterator &  rhs 
) [friend]

  • operator for reverse_iterator

Definition at line 1751 of file deque.h.

difference_type operator- ( const const_iterator lhs,
const const_iterator rhs 
) [friend]

Definition at line 1743 of file deque.h.


Field Documentation

iterator _end [protected]

Iterator to the _begin item in the deque.

Definition at line 1821 of file deque.h.

const size_type BUFFER_SIZE [protected, inherited]

The number of elements in the buffer.

Definition at line 205 of file deque.h.

const size_type CAPACITY [protected, inherited]

The maximum number of elements in the deque.

Definition at line 204 of file deque.h.

etl::debug_count construct_count [protected, inherited]

Internal debugging.

Definition at line 206 of file deque.h.

size_type current_size [protected, inherited]

The current number of elements in the deque.

Definition at line 203 of file deque.h.

pointer p_buffer [protected]

Iterator to the _end item in the deque.

Definition at line 1822 of file deque.h.