Class that manages a last in first out singly linked list. More...
Public Member Functions | |
LastInFirstOut () noexcept | |
Default constructor. | |
LastInFirstOut (ForwardLink *pRoot) noexcept | |
Default constructor. | |
void | clear (void) noexcept |
Discard the linked list. | |
uint_t | is_empty (void) const noexcept |
Default constructor. | |
ForwardLink * | get_root (void) const noexcept |
Get the head of the list. | |
uintptr_t | size (void) const noexcept |
Count the number of entries in this linked list. | |
void | add_first (ForwardLink *pNewRoot) noexcept |
Insert an entry to the head of the list. | |
void | add_last (ForwardLink *pNewTail) noexcept |
Insert an entry to the end of the list. | |
ForwardLink * | remove_first (void) noexcept |
Remove an entry from the head of the list. | |
ForwardLink * | take_list (void) noexcept |
Assigns ownership of the linked list. | |
eError | remove (ForwardLink *pEntry) noexcept |
Remove an item from the linked list. | |
void | reverse_list (void) noexcept |
Reverse the singly linked list. | |
Protected Attributes | |
ForwardLink * | m_pRoot |
Root pointer to the singly linked list. | |
Private Member Functions | |
LastInFirstOut (const LastInFirstOut &)=delete | |
LastInFirstOut & | operator= (const LastInFirstOut &)=delete |
LastInFirstOut (LastInFirstOut &&)=delete | |
LastInFirstOut & | operator= (LastInFirstOut &&)=delete |
Class that manages a last in first out singly linked list.
This class holds a linked list that is treated as a last in first out stack.
This class is not reentrant, use MPLastInFirstOut instead.
|
privatedelete |
|
privatedelete |
|
inlinenoexcept |
|
inlinenoexcept |
Default constructor.
Construct the class with an supplied list
pRoot | Pointer to the linked list to initialize this class with |
|
noexcept |
Insert an entry to the head of the list.
Insert a linked list into the head of the stored linked list.
pNewRoot | Pointer to the new head of the list |
|
noexcept |
Insert an entry to the end of the list.
Insert a linked list into the tail of the stored linked list.
pNewTail | Pointer to the list that will be appended to the current linked list |
|
inlinenoexcept |
Discard the linked list.
Set the root pointer to nullptr. No deallocations are performed.
|
inlinenoexcept |
Get the head of the list.
Return the head of the linked list for manual traversal.
|
inlinenoexcept |
|
privatedelete |
|
privatedelete |
|
noexcept |
Remove an item from the linked list.
Traverse the linked list until the pointer is found and then unlink it from the list. The pointer is not deleted, just unlinked.
pEntry | Item to remove from the linked list |
|
noexcept |
Remove an entry from the head of the list.
Remove the pointer from the root of the linked list. Sets the new root with the second entry of the linked list if there is a second entry.
|
inlinenoexcept |
Reverse the singly linked list.
Traverse the singly linked list and reverse the linkage so that the order of the entries are in the opposite order.
|
noexcept |
Count the number of entries in this linked list.
Traverse the linked list until the end is reached and return the number of entries found.
|
noexcept |
Assigns ownership of the linked list.
Returns the head pointer of the linked list and sets the linked list in this class to being empty. The calling function is assigned ownership of the entire list.
|
protected |
Root pointer to the singly linked list.