Loading...
Searching...
No Matches
etl::intrusive_list< TValue, TLink > Class Template Reference

`#include <intrusive_list.h>`

## Classes

class | iterator
| iterator. More...
class | const_iterator
| const_iterator More...

## Public Types

typedef etl::intrusive_list_base< TLink >::link_type | link_type
typedef intrusive_list< TValue, TLink > | list_type
typedef TValue | node_type
typedef TValue | value_type
typedef value_type * | pointer
typedef const value_type * | const_pointer
typedef value_type & | reference
typedef const value_type & | const_reference
typedef size_t | size_type
typedef etl::iterator_traits< iterator >::difference_type | difference_type
Public Types inherited from etl::intrusive_list_base< TLink >
typedef TLink | link_type

## Public Member Functions

| intrusive_list ()
| Constructor.
| ~intrusive_list ()
| Destructor.
template<typename TIterator>
| intrusive_list (TIterator first, TIterator last, typename etl::enable_if<!etl::is_integral< TIterator >::value, int >::type=0)
| Constructor from range.
iterator | begin ()
| Gets the beginning of the intrusive_list.
const_iterator | begin () const
| Gets the beginning of the intrusive_list.
const_iterator | cbegin () const
| Gets the beginning of the intrusive_list.
iterator | end ()
| Gets the end of the intrusive_list.
const_iterator | end () const
| Gets the end of the intrusive_list.
const_iterator | cend () const
| Gets the end of the intrusive_list.
reference | front ()
const_reference | front () const
reference | back ()
const_reference | back () const
iterator | insert (const_iterator position, value_type &value)
| Inserts a value to the intrusive_list before the specified position.
template<typename TIterator>
void | insert (const_iterator position, TIterator first, TIterator last)
iterator | erase (iterator position)
| Erases the value at the specified position.
iterator | erase (const_iterator position)
| Erases the value at the specified position.
iterator | erase (const_iterator first, const_iterator last)
node_type * | erase (const node_type &node)
| Erases the specified node.
node_type * | erase (const node_type *p_node)
| Erases the specified node.
template<typename TIsEqual>
void | unique (TIsEqual isEqual)
void | sort ()
| Sort using in-place merge sort algorithm.
template<typename TCompare>
void | sort (TCompare compare)
void | remove (const_reference value)
template<typename TPredicate>
void | remove_if (TPredicate predicate)
| Removes according to a predicate.
void | splice (iterator position, list_type &other)
| Splice another list into this one.
void | splice (iterator position, list_type &other, iterator isource)
| Splice an element from another list into this one.
void | splice (iterator position, list_type &other, iterator begin_, iterator end_)
| Splice a range of elements from another list into this one.
void | merge (list_type &other)
| Merge another list into this one. Both lists should be sorted.
template<typename TCompare>
void | merge (list_type &other, TCompare compare)
| Merge another list into this one. Both lists should be sorted.
bool | contains (const_reference value) const
Public Member Functions inherited from etl::intrusive_list_base< TLink >
template<typename TIterator>
void | assign (TIterator first, TIterator last)
void | push_front (link_type &value)
| Pushes a value to the front of the intrusive_list.
void | pop_front ()
| Removes a value from the front of the intrusive_list.
void | push_back (link_type &value)
| Pushes a value to the back of the intrusive_list.
void | pop_back ()
| Removes a value from the back of the intrusive_list.
void | clear ()
| Clears the intrusive_list.
void | reverse ()
| Reverses the list.
bool | empty () const
| Returns true if the list has no elements.
size_t | size () const
| Returns the number of elements.
bool | contains_node (const link_type &search_link) const
bool | contains_node (const link_type *search_link) const

## Additional Inherited Members

Protected Member Functions inherited from etl::intrusive_list_base< TLink >
| ~intrusive_list_base ()
| Destructor.
bool | is_trivial_list () const
| Is the intrusive_list a trivial length?
void | insert_link (link_type &previous, link_type &new_link)
| Insert a link.
void | insert_link (link_type *previous, link_type &new_link)
| Insert a link.
void | insert_link (link_type &previous, link_type *new_link)
| Insert a link.
void | insert_link (link_type *previous, link_type *new_link)
| Insert a link.
void | disconnect_link (link_type &link)
| Remove a link.
void | disconnect_link (link_type *link)
| Remove a link.
link_type * | get_head ()
| Get the head link.
const link_type * | get_head () const
| Get the head link.
link_type * | get_tail ()
| Get the tail link.
const link_type * | get_tail () const
| Get the tail link.
void | initialise ()
| Initialise the intrusive_list.
bool | is_link_in_list (const link_type *search_link) const
| Tests if the link is in this list.
link_type * | remove_link (link_type *link)
link_type * | remove_link_range (link_type *p_first, link_type *p_last)
| Removes a range of links.
Protected Attributes inherited from etl::intrusive_list_base< TLink >
link_type | terminal_link
| The link that acts as the intrusive_list start & end.
size_t | current_size
| Counts the number of elements in the list.

## Detailed Description

template<typename TValue, typename TLink>
class etl::intrusive_list< TValue, TLink >

An intrusive list.

Note
  TLink must be a base of TValue.

## Member Function Documentation

## back() [1/2]

template<typename TValue, typename TLink>

reference etl::intrusive_list< TValue, TLink >::back | ( |  | ) |

inline

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

## back() [2/2]

template<typename TValue, typename TLink>

const_reference etl::intrusive_list< TValue, TLink >::back | ( |  | ) | const

inline

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

## contains()

template<typename TValue, typename TLink>

bool etl::intrusive_list< TValue, TLink >::contains | ( | const_reference | value | ) | const

inline

Detects existence of specified value in list.

Parameters

  value | The value to find in list

## erase()

template<typename TValue, typename TLink>

iterator etl::intrusive_list< TValue, TLink >::erase | ( | const_iterator | first,
|  | const_iterator | last )

inline

Erases a range of elements. Clears the links after erasing if AUTO or CHECKED.

## front() [1/2]

template<typename TValue, typename TLink>

reference etl::intrusive_list< TValue, TLink >::front | ( |  | ) |

inline

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

## front() [2/2]

template<typename TValue, typename TLink>

const_reference etl::intrusive_list< TValue, TLink >::front | ( |  | ) | const

inline

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

## insert()

template<typename TValue, typename TLink>
template<typename TIterator>

void etl::intrusive_list< TValue, TLink >::insert | ( | const_iterator | position,
|  | TIterator | first,
|  | TIterator | last )

inline

Inserts a range of values to the intrusive_list after the specified position.

## sort()

template<typename TValue, typename TLink>
template<typename TCompare>

void etl::intrusive_list< TValue, TLink >::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()

template<typename TValue, typename TLink>
template<typename TIsEqual>

void etl::intrusive_list< TValue, TLink >::unique | ( | TIsEqual | isEqual | ) |

inline

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

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

- include/etl/intrusive_list.h