The provided list implementation uses a generic doubly-linked approach in which each node, apart from storing its data, has two link pointers. The first link points to the previous node in the list and the second link, points to the next node in the list. The first node of the list has its previous link pointing to nullptr
, similarly, the last node of the list has its next node pointing to nullptr
.
More...
The provided list implementation uses a generic doubly-linked approach in which each node, apart from storing its data, has two link pointers. The first link points to the previous node in the list and the second link, points to the next node in the list. The first node of the list has its previous link pointing to nullptr
, similarly, the last node of the list has its next node pointing to nullptr
.
The list data-structure, referenced through an object of type qList_t also has a head and a tail pointer, to allow fast operations on boundary nodes.
qlist
Doubly-linked list implementation Nodes should be an user-defined class inherited fromt he node class
class mynode : public node {
int a;
int b;
float y;
};
◆ listCompareFcn_t
Pointer to a function used by the list::sort() method to compare nodes of a list.
Example :
bool myNode_CompareFcn( const void *n1, const void *n2 ) {
mydata_t *node1 = (mydata_t *)n1;
mydata_t *node2 = (mydata_t *)n2;
return ( node1->x > node2->x );
}
- Parameters
-
[in] | h | The handler object containing the objects being compared. |
- Returns
true
value indicates that element pointed by node1 goes after the element pointed to by node2
◆ listDirection
An enum with the possible options to transverse a list.
Enumerator |
---|
FORWARD | |
BACKWARD | |
◆ listPosition
An enum with the possible options to specify a target position for a list.
Enumerator |
---|
AT_FRONT | |
AT_BACK | |