Loading...
Searching...
No Matches
list

## Classes

class | etl::list_exception
class | etl::list_full
class | etl::list_empty
class | etl::list_iterator
class | etl::list_unsorted
class | etl::list_no_pool
class | etl::list_base
class | etl::ilist< T >
class | etl::optional_exception
class | etl::optional_invalid

## Detailed Description

A linked list with the capacity defined at compile time.

## Class Documentation

## etl::list_exception

class etl::list_exception

Exception for the list.

### Public Member Functions

| list_exception (string_type reason_, string_type file_name_, numeric_type line_number_)
Public Member Functions inherited from etl::exception
ETL_EXCEPTION_CONSTEXPR | exception (string_type reason_, string_type, numeric_type)
| Constructor.
ETL_EXCEPTION_CONSTEXPR string_type | what () const ETL_NOEXCEPT ETL_EXCEPTION_OVERRIDE
ETL_EXCEPTION_CONSTEXPR string_type | file_name () const
ETL_EXCEPTION_CONSTEXPR numeric_type | line_number () const

## Additional Inherited Members

Public Types inherited from etl::exception
typedef const char * | string_type
typedef int | numeric_type

## etl::list_full

class etl::list_full

Full exception for the list.

### Public Member Functions

| list_full (string_type file_name_, numeric_type line_number_)
Public Member Functions inherited from etl::list_exception
| list_exception (string_type reason_, string_type file_name_, numeric_type line_number_)
Public Member Functions inherited from etl::exception
ETL_EXCEPTION_CONSTEXPR | exception (string_type reason_, string_type, numeric_type)
| Constructor.
ETL_EXCEPTION_CONSTEXPR string_type | what () const ETL_NOEXCEPT ETL_EXCEPTION_OVERRIDE
ETL_EXCEPTION_CONSTEXPR string_type | file_name () const
ETL_EXCEPTION_CONSTEXPR numeric_type | line_number () const

## Additional Inherited Members

Public Types inherited from etl::exception
typedef const char * | string_type
typedef int | numeric_type

## etl::list_empty

class etl::list_empty

Empty exception for the list.

### Public Member Functions

| list_empty (string_type file_name_, numeric_type line_number_)
Public Member Functions inherited from etl::list_exception
| list_exception (string_type reason_, string_type file_name_, numeric_type line_number_)
Public Member Functions inherited from etl::exception
ETL_EXCEPTION_CONSTEXPR | exception (string_type reason_, string_type, numeric_type)
| Constructor.
ETL_EXCEPTION_CONSTEXPR string_type | what () const ETL_NOEXCEPT ETL_EXCEPTION_OVERRIDE
ETL_EXCEPTION_CONSTEXPR string_type | file_name () const
ETL_EXCEPTION_CONSTEXPR numeric_type | line_number () const

## Additional Inherited Members

Public Types inherited from etl::exception
typedef const char * | string_type
typedef int | numeric_type

## etl::list_iterator

class etl::list_iterator

Iterator exception for the list.

### Public Member Functions

| list_iterator (string_type file_name_, numeric_type line_number_)
Public Member Functions inherited from etl::list_exception
| list_exception (string_type reason_, string_type file_name_, numeric_type line_number_)
Public Member Functions inherited from etl::exception
ETL_EXCEPTION_CONSTEXPR | exception (string_type reason_, string_type, numeric_type)
| Constructor.
ETL_EXCEPTION_CONSTEXPR string_type | what () const ETL_NOEXCEPT ETL_EXCEPTION_OVERRIDE
ETL_EXCEPTION_CONSTEXPR string_type | file_name () const
ETL_EXCEPTION_CONSTEXPR numeric_type | line_number () const

## Additional Inherited Members

Public Types inherited from etl::exception
typedef const char * | string_type
typedef int | numeric_type

## etl::list_unsorted

class etl::list_unsorted

Unsorted exception for the list.

### Public Member Functions

| list_unsorted (string_type file_name_, numeric_type line_number_)
Public Member Functions inherited from etl::list_exception
| list_exception (string_type reason_, string_type file_name_, numeric_type line_number_)
Public Member Functions inherited from etl::exception
ETL_EXCEPTION_CONSTEXPR | exception (string_type reason_, string_type, numeric_type)
| Constructor.
ETL_EXCEPTION_CONSTEXPR string_type | what () const ETL_NOEXCEPT ETL_EXCEPTION_OVERRIDE
ETL_EXCEPTION_CONSTEXPR string_type | file_name () const
ETL_EXCEPTION_CONSTEXPR numeric_type | line_number () const

## Additional Inherited Members

Public Types inherited from etl::exception
typedef const char * | string_type
typedef int | numeric_type

## etl::list_no_pool

class etl::list_no_pool

Unsorted exception for the list.

### Public Member Functions

| list_no_pool (string_type file_name_, numeric_type line_number_)
Public Member Functions inherited from etl::list_exception
| list_exception (string_type reason_, string_type file_name_, numeric_type line_number_)
Public Member Functions inherited from etl::exception
ETL_EXCEPTION_CONSTEXPR | exception (string_type reason_, string_type, numeric_type)
| Constructor.
ETL_EXCEPTION_CONSTEXPR string_type | what () const ETL_NOEXCEPT ETL_EXCEPTION_OVERRIDE
ETL_EXCEPTION_CONSTEXPR string_type | file_name () const
ETL_EXCEPTION_CONSTEXPR numeric_type | line_number () const

## Additional Inherited Members

Public Types inherited from etl::exception
typedef const char * | string_type
typedef int | numeric_type

## etl::list_base

class etl::list_base

The base class for all lists.

### Public Types

typedef size_t | size_type
| The type used for determining the size of list.

### Public Member Functions

bool | has_shared_pool () const
| true if the list has a shared pool.
void | reverse ()
| Reverses the list.
size_type | max_size () const
| Gets the maximum possible size of the list.
size_type | capacity () const
| Gets the maximum possible size of the list.
size_type | size () const
| Gets the size of the list.
bool | empty () const
| Checks to see if the list is empty.
bool | full () const
| Checks to see if the list is full.
size_type | available () const

### Protected Member Functions

bool | is_trivial_list () const
| Is the list a trivial length?
node_t & | get_head ()
| Get the head node.
const node_t & | get_head () const
| Get the head node.
node_t & | get_tail ()
| Get the tail node.
const node_t & | get_tail () const
| Get the tail node.
void | insert_node (node_t &position, node_t &node)
| Insert a node before 'position'.
void | join (node_t &left, node_t &right)
| Join two nodes.
| list_base (bool pool_is_shared_)
| The constructor that is called from derived classes.
| list_base (etl::ipool &node_pool_, size_type max_size_, bool pool_is_shared_)
| The constructor that is called from derived classes.
void | set_node_pool (etl::ipool &node_pool_)
| Set the node pool instance.
etl::ipool * | get_node_pool ()
| Get the node pool instance.
| ~list_base ()
| Destructor.

### Protected Attributes

etl::ipool * | p_node_pool
| The pool of data nodes used in the list.
node_t | terminal_node
| The node that acts as the list start and end.
size_type | MAX_SIZE
| The maximum size of the list.
bool | pool_is_shared
| If true then the pool is shared between lists.
| ETL_DECLARE_DEBUG_COUNT
| Internal debugging.

#### Member Function Documentation

## available()

size_type etl::list_base::available | ( |  | ) | const

inline

Returns the remaining capacity.

Returns
  The remaining capacity.

## etl::ilist

class etl::ilist

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

A templated base for all etl::list types.

### Public Types

typedef T | value_type
typedef T * | pointer
typedef const T * | const_pointer
typedef T & | reference
typedef const T & | const_reference
typedef size_t | size_type
typedef etl::iterator_traits< iterator >::difference_type | difference_type
typedef ETL_OR_STD::reverse_iterator< iterator > | reverse_iterator
typedef ETL_OR_STD::reverse_iterator< const_iterator > | const_reverse_iterator
Public Types inherited from etl::list_base
typedef size_t | size_type
| The type used for determining the size of list.

### Public Member Functions

iterator | begin ()
| Gets the beginning of the list.
const_iterator | begin () const
| Gets the beginning of the list.
iterator | end ()
| Gets the end of the list.
const_iterator | end () const
| Gets the end of the list.
const_iterator | cbegin () const
| Gets the beginning of the list.
const_iterator | cend () const
| Gets the end of the list.
reverse_iterator | rbegin ()
| Gets the reverse beginning of the list.
const_reverse_iterator | rbegin () const
| Gets the reverse beginning of the list.
reverse_iterator | rend ()
| Gets the reverse end of the list.
const_reverse_iterator | rend () const
| Gets the reverse end of the list.
const_reverse_iterator | crbegin () const
| Gets the reverse beginning of the list.
const_reverse_iterator | crend () const
| Gets the reverse end of the list.
reference | front ()
const_reference | front () const
reference | back ()
const_reference | back () const
template<typename TIterator>
void | assign (TIterator first, TIterator last, typename etl::enable_if<!etl::is_integral< TIterator >::value, int >::type=0)
void | assign (size_t n, const T &value)
| Assigns 'n' copies of a value to the list.
void | push_front (const T &value)
| Pushes a value to the front of the list.
reference | emplace_front ()
| Emplaces a value to the front of the list.
template<typename T1>
reference | emplace_front (const T1 &value1)
| Emplaces a value to the front of the list.
template<typename T1, typename T2>
reference | emplace_front (const T1 &value1, const T2 &value2)
| Emplaces a value to the front of the list.
template<typename T1, typename T2, typename T3>
reference | emplace_front (const T1 &value1, const T2 &value2, const T3 &value3)
| Emplaces a value to the front of the list.
template<typename T1, typename T2, typename T3, typename T4>
reference | emplace_front (const T1 &value1, const T2 &value2, const T3 &value3, const T4 &value4)
| Emplaces a value to the front of the list.
void | pop_front ()
| Removes a value from the front of the list.
void | push_back (const T &value)
| Pushes a value to the back of the list.
reference | emplace_back ()
| Emplaces a value to the back of the list.
template<typename T1>
reference | emplace_back (const T1 &value1)
template<typename T1, typename T2>
reference | emplace_back (const T1 &value1, const T2 &value2)
template<typename T1, typename T2, typename T3>
reference | emplace_back (const T1 &value1, const T2 &value2, const T3 &value3)
template<typename T1, typename T2, typename T3, typename T4>
reference | emplace_back (const T1 &value1, const T2 &value2, const T3 &value3, const T4 &value4)
void | pop_back ()
| Removes a value from the back of the list.
iterator | insert (const_iterator position, const_reference value)
| Inserts a value to the list at the specified position.
iterator | emplace (const_iterator position)
| Emplaces a value to the list at the specified position.
template<typename T1>
iterator | emplace (const_iterator position, const T1 &value1)
template<typename T1, typename T2>
iterator | emplace (const_iterator position, const T1 &value1, const T2 &value2)
template<typename T1, typename T2, typename T3>
iterator | emplace (const_iterator position, const T1 &value1, const T2 &value2, const T3 &value3)
template<typename T1, typename T2, typename T3, typename T4>
iterator | emplace (const_iterator position, const T1 &value1, const T2 &value2, const T3 &value3, const T4 &value4)
void | insert (const_iterator position, size_t n, const_reference value)
| Inserts 'n' copies of a value to the list at the specified position.
template<typename TIterator>
void | insert (const_iterator position, TIterator first, TIterator last, typename etl::enable_if<!etl::is_integral< TIterator >::value, int >::type=0)
| Inserts a range of values to the list at the specified position.
iterator | erase (const_iterator position)
| Erases the value at the specified position.
iterator | erase (const_iterator first, const_iterator last)
| Erases a range of elements.
void | resize (size_t n)
| Resizes the list.
void | resize (size_t n, const_reference value)
| Resizes the list.
void | clear ()
| Clears the list.
void | remove (const_reference value)
template<typename TPredicate>
void | remove_if (TPredicate predicate)
| Removes according to a predicate.
void | unique ()
template<typename TIsEqual>
void | unique (TIsEqual isEqual)
void | splice (iterator to, ilist &other)
| Splices from another list to this.
void | splice (iterator to, ilist &other, iterator from)
| Splices an element from another list to this.
void | splice (iterator to, ilist &other, iterator first, iterator last)
| Splices a range of elements from another list to this.
void | merge (ilist &other)
| Merge another list into this one. Both lists should be sorted.
template<typename TCompare>
void | merge (ilist &other, TCompare compare)
| Merge another list into this one. Both lists should be sorted.
void | sort ()
template<typename TCompare>
void | sort (TCompare compare)
ilist & | operator= (const ilist &rhs)
| Assignment operator.
Public Member Functions inherited from etl::list_base
bool | has_shared_pool () const
| true if the list has a shared pool.
void | reverse ()
| Reverses the list.
size_type | max_size () const
| Gets the maximum possible size of the list.
size_type | capacity () const
| Gets the maximum possible size of the list.
size_type | size () const
| Gets the size of the list.
bool | empty () const
| Checks to see if the list is empty.
bool | full () const
| Checks to see if the list is full.
size_type | available () const

### Protected Types

typedef etl::parameter_type< T >::type | parameter_t

### Protected Member Functions

| ilist (bool pool_is_shared_)
| Constructor.
| ilist (etl::ipool &node_pool, size_t max_size_, bool pool_is_shared_)
| Constructor.
void | initialise ()
| Initialise the list.
Protected Member Functions inherited from etl::list_base
bool | is_trivial_list () const
| Is the list a trivial length?
node_t & | get_head ()
| Get the head node.
const node_t & | get_head () const
| Get the head node.
node_t & | get_tail ()
| Get the tail node.
const node_t & | get_tail () const
| Get the tail node.
void | insert_node (node_t &position, node_t &node)
| Insert a node before 'position'.
void | join (node_t &left, node_t &right)
| Join two nodes.
| list_base (bool pool_is_shared_)
| The constructor that is called from derived classes.
| list_base (etl::ipool &node_pool_, size_type max_size_, bool pool_is_shared_)
| The constructor that is called from derived classes.
void | set_node_pool (etl::ipool &node_pool_)
| Set the node pool instance.
etl::ipool * | get_node_pool ()
| Get the node pool instance.
| ~list_base ()
| Destructor.

## Additional Inherited Members

Protected Attributes inherited from etl::list_base
etl::ipool * | p_node_pool
| The pool of data nodes used in the list.
node_t | terminal_node
| The node that acts as the list start and end.
size_type | MAX_SIZE
| The maximum size of the list.
bool | pool_is_shared
| If true then the pool is shared between lists.
| ETL_DECLARE_DEBUG_COUNT
| Internal debugging.

#### Member Function Documentation

## assign()

template<typename T>
template<typename TIterator>

void etl::ilist< T >::assign | ( | TIterator | first,
|  | TIterator | last,
|  | typename etl::enable_if<!etl::is_integral< TIterator >::value, int >::type | = 0 )

inline

Assigns a range of values to the list. If asserts or exceptions are enabled throws etl::list_full if the list does not have enough free space. If ETL_THROW_EXCEPTIONS & ETL_DEBUG are defined throws list_iterator if the iterators are reversed.

## back() [1/2]

template<typename T>

reference etl::ilist< T >::back | ( |  | ) |

inline

Gets a reference to the last element. If asserts or exceptions are enabled, throws an etl::list_empty if the list is empty.

## back() [2/2]

template<typename T>

const_reference etl::ilist< T >::back | ( |  | ) | const

inline

Gets a reference to the last element. If asserts or exceptions are enabled, throws an etl::list_empty if the list is empty.

## front() [1/2]

template<typename T>

reference etl::ilist< T >::front | ( |  | ) |

inline

Gets a reference to the first element. If asserts or exceptions are enabled, throws an etl::list_empty if the list is empty.

## front() [2/2]

template<typename T>

const_reference etl::ilist< T >::front | ( |  | ) | const

inline

Gets a const reference to the first element. If asserts or exceptions are enabled, throws an etl::list_empty if the list is empty.

## sort() [1/2]

template<typename T>

void etl::ilist< T >::sort | ( |  | ) |

inline

Sort using in-place merge sort algorithm. Uses 'less-than operator as the predicate.

## sort() [2/2]

template<typename T>
template<typename TCompare>

void etl::ilist< T >::sort | ( | TCompare | compare | ) |

inline

Stable sort using in-place merge sort algorithm. Copyright 2001 Simon Tatham.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL SIMON TATHAM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

## unique() [1/2]

template<typename T>

void etl::ilist< T >::unique | ( |  | ) |

inline

Removes all but the first element from every consecutive group of equal elements in the container.

## unique() [2/2]

template<typename T>
template<typename TIsEqual>

void etl::ilist< T >::unique | ( | TIsEqual | isEqual | ) |

inline

Removes all but the first element from every consecutive group of equal elements in the container.

## etl::optional_exception

class etl::optional_exception

Exception for optional.

### Public Member Functions

| optional_exception (string_type reason_, string_type file_name_, numeric_type line_number_)
Public Member Functions inherited from etl::exception
ETL_EXCEPTION_CONSTEXPR | exception (string_type reason_, string_type, numeric_type)
| Constructor.
ETL_EXCEPTION_CONSTEXPR string_type | what () const ETL_NOEXCEPT ETL_EXCEPTION_OVERRIDE
ETL_EXCEPTION_CONSTEXPR string_type | file_name () const
ETL_EXCEPTION_CONSTEXPR numeric_type | line_number () const

## Additional Inherited Members

Public Types inherited from etl::exception
typedef const char * | string_type
typedef int | numeric_type

## etl::optional_invalid

class etl::optional_invalid

Invalid exception for optional.

### Public Member Functions

| optional_invalid (string_type file_name_, numeric_type line_number_)
Public Member Functions inherited from etl::optional_exception
| optional_exception (string_type reason_, string_type file_name_, numeric_type line_number_)
Public Member Functions inherited from etl::exception
ETL_EXCEPTION_CONSTEXPR | exception (string_type reason_, string_type, numeric_type)
| Constructor.
ETL_EXCEPTION_CONSTEXPR string_type | what () const ETL_NOEXCEPT ETL_EXCEPTION_OVERRIDE
ETL_EXCEPTION_CONSTEXPR string_type | file_name () const
ETL_EXCEPTION_CONSTEXPR numeric_type | line_number () const

## Additional Inherited Members

Public Types inherited from etl::exception
typedef const char * | string_type
typedef int | numeric_type