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.
deque< T, MAX_SIZE_ > Class Template Reference
[deque]
A fixed capacity double ended queue. More...
#include <deque.h>
Inherits etl::ideque< T >.
Public Member Functions | |
| deque () | |
| Default constructor. | |
| ~deque () | |
| Destructor. | |
| deque (const deque &other) | |
| Copy constructor. | |
| template<typename TIterator > | |
| deque (TIterator begin_, TIterator end_) | |
| Assigns data to the deque. | |
| deque (size_t n, typename etl::ideque< T >::parameter_t value=value_type()) | |
| Assigns data to the deque. | |
| deque & | operator= (const deque &rhs) |
| Assignment operator. | |
| void | repair () |
| Fix the internal pointers after a low level memory copy. | |
| 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. | |
| 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. | |
| 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 | 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. | |
| 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 | |
| void | repair (pointer p_buffer_) |
| Fix the internal pointers after a low level memory copy. | |
| void | initialise () |
| Initialise the deque. | |
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. | |
| 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, const size_t MAX_SIZE_>
class etl::deque< T, MAX_SIZE_ >
A fixed capacity double ended queue.
- Note:
- The deque allocates one more element than the specified maximum size.
- Template Parameters:
-
T The type of items this deque holds. MAX_SIZE_ The capacity of the deque
Definition at line 1969 of file deque.h.
Constructor & Destructor Documentation
| deque | ( | TIterator | begin_, |
| TIterator | end_ | ||
| ) |
| deque | ( | size_t | n, |
| typename etl::ideque< T >::parameter_t | value = value_type() |
||
| ) | [explicit] |
Member Function Documentation
| etl::enable_if<is_iterator<TIterator>::value, void>::type assign | ( | TIterator | range_begin, |
| TIterator | range_end | ||
| ) | [inherited] |
| void assign | ( | size_type | n, |
| const value_type & | value | ||
| ) | [inherited] |
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.<
| reference at | ( | size_t | index ) | [inherited] |
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.
| const_reference at | ( | size_t | index ) | const [inherited] |
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.
| size_t available | ( | ) | const [inherited] |
| reference back | ( | ) | [inherited] |
| const_reference back | ( | ) | const [inherited] |
| iterator begin | ( | ) | [inherited] |
| const_iterator begin | ( | ) | const [inherited] |
| const_iterator cbegin | ( | ) | const [inherited] |
| const_iterator cend | ( | ) | const [inherited] |
| const_reverse_iterator crbegin | ( | ) | const [inherited] |
| const_reverse_iterator crend | ( | ) | const [inherited] |
| iterator emplace | ( | const_iterator | insert_position, |
| const T1 & | value1, | ||
| const T2 & | value2, | ||
| const T3 & | value3, | ||
| const T4 & | value4 | ||
| ) | [inherited] |
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 | ||
| ) | [inherited] |
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 | ||
| ) | [inherited] |
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 | ||
| ) | [inherited] |
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 ) | [inherited] |
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 | ||
| ) | [inherited] |
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 | ||
| ) | [inherited] |
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 | ||
| ) | [inherited] |
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, |
| const T2 & | value2, | ||
| const T3 & | value3, | ||
| const T4 & | value4 | ||
| ) | [inherited] |
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 ) | [inherited] |
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 | ||
| ) | [inherited] |
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 | ||
| ) | [inherited] |
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 [inherited] |
| iterator end | ( | ) | [inherited] |
| iterator erase | ( | const_iterator | erase_position ) | [inherited] |
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.
| iterator erase | ( | const_iterator | range_begin, |
| const_iterator | range_end | ||
| ) | [inherited] |
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.
| const_reference front | ( | ) | const [inherited] |
| reference front | ( | ) | [inherited] |
| bool full | ( | ) | const [inherited] |
| void initialise | ( | ) | [protected, inherited] |
| iterator insert | ( | const_iterator | insert_position, |
| const value_type & | value | ||
| ) | [inherited] |
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 | ||
| ) | [inherited] |
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 | ||
| ) | [inherited] |
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] |
| const_reference operator[] | ( | size_t | index ) | const [inherited] |
| reference operator[] | ( | size_t | index ) | [inherited] |
| void pop_back | ( | ) | [inherited] |
| void pop_front | ( | ) | [inherited] |
| reference push_back | ( | ) | [inherited] |
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_back | ( | parameter_t | item ) | [inherited] |
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_front | ( | ) | [inherited] |
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 ) | [inherited] |
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.
| reverse_iterator rbegin | ( | ) | [inherited] |
| const_reverse_iterator rbegin | ( | ) | const [inherited] |
| const_reverse_iterator rend | ( | ) | const [inherited] |
| reverse_iterator rend | ( | ) | [inherited] |
| void repair | ( | ) | [virtual] |
Fix the internal pointers after a low level memory copy.
Implements ideque< T >.
| void repair | ( | pointer | p_buffer_ ) | [protected, inherited] |
| void resize | ( | size_t | new_size, |
| const value_type & | value = value_type() |
||
| ) | [inherited] |
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, inherited] |
| difference_type operator- | ( | const reverse_iterator & | lhs, |
| const reverse_iterator & | rhs | ||
| ) | [friend, inherited] |
| difference_type operator- | ( | const const_iterator & | lhs, |
| const const_iterator & | rhs | ||
| ) | [friend, inherited] |
- operator for const_iterator
Field Documentation
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
1.7.2