An Intrusive Double Linked List.
More...
#include <IntrusiveDoubleLinkedList.h>
|
bool | isEmpty () const |
| Return true if the linked list is empty.
|
|
T * | dequeueFront () |
| Removes and returns the first element of the linked list.
|
|
void | clear () |
| Clears this linked list removing links between all linked list elements.
|
|
void | appendBack (IntrusiveDoubleLinkedList &other) |
| Appends another list at the back of current list.
|
|
void | queueBack (T &item) |
| Appends item to the back of this linked list.
|
|
void | remove (T &item) |
| Removes item from this linked list.
|
|
|
T * | back = nullptr |
|
T * | front = nullptr |
|
template<typename T>
struct SC::IntrusiveDoubleLinkedList< T >
An Intrusive Double Linked List.
- Template Parameters
-
T | The Type being linked. It must declare two pointers to itself named next and prev . |
This is an useful data structure when we want to delegate the allocation strategy to caller.
Both Async and Process use this data structure to store requests.
- Note
- Include
Internal/IntrusiveDoubleLinkedList.inl
in the .cpp where any of the methods will be used.
struct Node
{
Node* next = nullptr;
Node* prev = nullptr;
int data = 0;
};
Node items[2];
items[0].data = 0;
items[1].data = 1;
◆ appendBack()
Appends another list at the back of current list.
◆ clear()
Clears this linked list removing links between all linked list elements.
◆ dequeueFront()
Removes and returns the first element of the linked list.
◆ isEmpty()
Return true if the linked list is empty.
◆ queueBack()
Appends item to the back of this linked list.
◆ remove()
Removes item from this linked list.
The documentation for this struct was generated from the following file: