cesium-native
0.41.0
|
A doubly-linked list. More...
#include <CesiumUtility/DoublyLinkedList.h>
Public Member Functions | |
void | remove (T &node) noexcept |
Removes the given node from this list. | |
void | insertAfter (T &after, T &node) noexcept |
Insert the given node after the other node. | |
void | insertBefore (T &before, T &node) noexcept |
Insert the given node before the other node. | |
void | insertAtHead (T &node) noexcept |
Insert the given node as the new head of the list. | |
void | insertAtTail (T &node) noexcept |
Insert the given node as the new tail of the list. | |
size_t | size () const noexcept |
Returns the size of this list. | |
T * | head () noexcept |
Returns the head node of this list, or nullptr if the list is empty. | |
const T * | head () const noexcept |
Returns the head node of this list, or nullptr if the list is empty. More... | |
T * | tail () noexcept |
Returns the tail node of this list, or nullptr if the list is empty. | |
const T * | tail () const noexcept |
Returns the tail node of this list, or nullptr if the list is empty. More... | |
T * | next (T &node) noexcept |
Returns the next node after the given one, or nullptr if the given node is the tail. | |
const T * | next (const T &node) const noexcept |
Returns the next node after the given one, or nullptr if the given node is the tail. More... | |
T * | next (T *pNode) noexcept |
Returns the next node after the given one, or the head if the given node is nullptr . | |
const T * | next (const T *pNode) const noexcept |
Returns the next node after the given one, or the head if the given node is nullptr . More... | |
T * | previous (T &node) noexcept |
Returns the previous node before the given one, or nullptr if the given node is the head. | |
const T * | previous (const T &node) const noexcept |
Returns the previous node before the given one, or nullptr if the given node is the head. More... | |
T * | previous (T *pNode) |
Returns the previous node before the given one, or the tail if the given node is nullptr . | |
const T * | previous (const T *pNode) const noexcept |
Returns the previous node before the given one, or the tail if the given node is nullptr . More... | |
bool | contains (const T &node) const |
Determines if this list contains a given node in constant time. In order to avoid a full list scan, this method assumes that if the node has any next or previous node, then it is contained in this list. Do not use this method to determine which of multiple lists contain this node. More... | |
A doubly-linked list.
In this implementation, the previous and next pointers are embedded directly in the data object.
T | The data object type. |
(T::*Pointers) | A member pointer to the field that holds the links to the previous and next nodes. |
Definition at line 62 of file DoublyLinkedList.h.
|
inline |
Determines if this list contains a given node in constant time. In order to avoid a full list scan, this method assumes that if the node has any next or previous node, then it is contained in this list. Do not use this method to determine which of multiple lists contain this node.
node | The node to check. |
Definition at line 256 of file DoublyLinkedList.h.
|
inlinenoexcept |
Returns the head node of this list, or nullptr
if the list is empty.
Definition at line 188 of file DoublyLinkedList.h.
|
inlinenoexcept |
Returns the next node after the given one, or nullptr
if the given node is the tail.
Definition at line 206 of file DoublyLinkedList.h.
|
inlinenoexcept |
Returns the next node after the given one, or the head if the given node is nullptr
.
Definition at line 217 of file DoublyLinkedList.h.
|
inlinenoexcept |
Returns the previous node before the given one, or nullptr
if the given node is the head.
Definition at line 228 of file DoublyLinkedList.h.
|
inlinenoexcept |
Returns the previous node before the given one, or the tail if the given node is nullptr
.
Definition at line 241 of file DoublyLinkedList.h.
|
inlinenoexcept |
Returns the tail node of this list, or nullptr
if the list is empty.
Definition at line 197 of file DoublyLinkedList.h.