|
| list () noexcept |
|
bool | insert (void *const xNode, const listPosition p=listPosition::AT_BACK) noexcept |
| Insert an item into the list.
|
|
bool | remove (void *const xNode) noexcept |
| If the node is member of a list, the node will be removed from it.
|
|
void * | remove (const listPosition p, void *const xNode=nullptr) noexcept |
| Remove an item from the list.
|
|
void * | getFront (void) const noexcept |
| Get a pointer to the front item of the list.
|
|
void * | getBack (void) const noexcept |
| Get a pointer to the back item of the list.
|
|
bool | isEmpty (void) const noexcept |
| Check if the list is empty.
|
|
size_t | length (void) const noexcept |
| Get the number of items inside the list.
|
|
bool | sort (listCompareFcn_t f) noexcept |
| Sort the double linked list using the f function to determine the order. The sorting algorithm used by this function compares pairs of adjacent nodes by calling the specified f function with pointers to them as arguments. The sort is performed only modifying node's links without data swapping, improving performance if nodes have a large storage.
|
|
bool | swap (void *node1, void *node2) noexcept |
| Swap two nodes that belongs to the list by changing its own links.
|
|
bool | move (list &src, const listPosition p=listPosition::AT_BACK) noexcept |
| Moves(or merge) the entire list src to the given list. After the move operation, this function leaves empty the list given by src.
|
|
void | clean (void) noexcept |
| Clean up the entire list leaving it empty.
|
|
listIterator | begin (void) noexcept |
| Returns an iterator pointing to the first element in the list container.
|
|
listIterator | end (void) noexcept |
| Returns an iterator pointing to the last element in the list container.
|
|
listIterator | from (void *offset) noexcept |
| Returns an iterator pointing to the element given by offset in the list container.
|
|
A list object (Generic double-linked)
Sort the double linked list using the f function to determine the order. The sorting algorithm used by this function compares pairs of adjacent nodes by calling the specified f function with pointers to them as arguments. The sort is performed only modifying node's links without data swapping, improving performance if nodes have a large storage.
- Note
- The function modifies the content of the list by reordering its elements as defined by f.
- Parameters
-
[in] | f | Pointer to a function that compares two nodes. This function is called repeatedly by list::sort() to compare two nodes. It shall follow the following prototype: bool CompareFcn( listCompareHandle_t h )
|
The function defines the order of the elements by returning a Boolean data, where a true
value indicates that element pointed by node1 goes after the element pointed to by node2.
- Returns
true
if at least one reordering is performed over the list.