Function addNodeSorted
addNodeSorted -- insert a node into a list by ln_Priority field
void addNodeSorted
(
LinkedList!(va_toolbox.linked_list.LinkListHeadExtras,va_toolbox.linked_list.LinkListNodeExtras)* listHead,
ref LinkedList!(va_toolbox.linked_list.LinkListHeadExtras,va_toolbox.linked_list.LinkListNodeExtras) node
);
Insert or append a node to a system queue. The insert is performed based on the node priority -- it will keep the list properly sorted. New nodes will be inserted in front of the first node with a lower priority. Hence a FIFO queue for nodes of equal priority results
Parameters
Name | Description |
---|---|
listHead | a pointer to the target list header |
node | the node to insert |
Returns
Your list is larger by one node.
Example
ListHead myList; ListNode* myNode; ... myList.addNodeSorted( , myNode );
Notes
This function does not arbitrate for access to the list. The calling task must be the owner of the involved list.
Bugs
none
See
initListHead(), addNode(), remNode(), addNodeHead(), remNodeHead(), addNodeTail(), remNodeTail(), addNodeSorted(), findNode()