Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
ideque< T > Class Template Reference
[deque]
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. | |
ideque & | operator= (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) |
| |
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:
-
T The 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] |
Member Function Documentation
etl::enable_if<is_iterator<TIterator>::value, void>::type assign | ( | TIterator | range_begin, |
TIterator | range_end | ||
) |
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:
-
n The number of copies to assign. value The value to add.<
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.
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.
size_t available | ( | ) | const [inherited] |
reference back | ( | ) |
const_reference back | ( | ) | const |
iterator begin | ( | ) |
const_iterator begin | ( | ) | const |
const_iterator cbegin | ( | ) | const |
const_iterator cend | ( | ) | const |
const_reverse_iterator crbegin | ( | ) | const |
const_reverse_iterator crend | ( | ) | const |
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>The insert position.
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>The insert position.
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>The insert position.
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>The insert position.
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.
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.
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.
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.
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.
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.
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.
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.
bool empty | ( | ) | const [inherited] |
const_iterator end | ( | ) | const |
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_begin The beginning of the range to erase. range_end The end of the range to erase.
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_position The position to erase.
const_reference front | ( | ) | const |
reference front | ( | ) |
bool full | ( | ) | const [inherited] |
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>The insert position. value>The value to insert.
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_position The insert position. n The number of values to insert. value The value to insert.
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>The insert position. range_begin The beginning of the range to insert. range_end The end of the range to insert.
size_type max_size | ( | ) | const [inherited] |
reference operator[] | ( | size_t | index ) |
const_reference operator[] | ( | size_t | index ) | const |
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:
-
item The item to push to the deque.
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.
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:
-
item The item to push to the deque.
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.
reverse_iterator rbegin | ( | ) |
const_reverse_iterator rbegin | ( | ) | const |
const_reverse_iterator rend | ( | ) | const |
reverse_iterator rend | ( | ) |
void repair | ( | pointer | p_buffer_ ) | [protected] |
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_size The new size of the deque. value The value to assign if the new size is larger. Default = Default constructed value.
size_type size | ( | ) | const [inherited] |
Friends And Related Function Documentation
difference_type operator- | ( | const const_reverse_iterator & | lhs, |
const const_reverse_iterator & | rhs | ||
) | [friend] |
difference_type operator- | ( | const reverse_iterator & | lhs, |
const reverse_iterator & | rhs | ||
) | [friend] |
difference_type operator- | ( | const const_iterator & | lhs, |
const const_iterator & | rhs | ||
) | [friend] |
- operator for const_iterator
Field Documentation
const size_type BUFFER_SIZE [protected, inherited] |
const size_type CAPACITY [protected, inherited] |
etl::debug_count construct_count [protected, inherited] |
size_type current_size [protected, inherited] |
Generated on Tue Jul 12 2022 14:05:49 by
