cesium-native  0.41.0
CesiumUtility::DoublyLinkedListAdvanced< T, TPointerBase, Pointers > Class Template Referencefinal

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...
 

Detailed Description

template<typename T, typename TPointerBase, DoublyLinkedListPointers< T >TPointerBase::* Pointers>
class CesiumUtility::DoublyLinkedListAdvanced< T, TPointerBase, Pointers >

A doubly-linked list.

In this implementation, the previous and next pointers are embedded directly in the data object.

Template Parameters
TThe 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.

Member Function Documentation

◆ contains()

template<typename T , typename TPointerBase , DoublyLinkedListPointers< T >TPointerBase::* Pointers>
bool CesiumUtility::DoublyLinkedListAdvanced< T, TPointerBase, Pointers >::contains ( const T &  node) const
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.

Parameters
nodeThe node to check.
Returns
True if this node is the head of the list, or if the node has next or previous nodes. False if the node does not have next or previous nodes and it is not the head of this list.

Definition at line 256 of file DoublyLinkedList.h.

◆ head()

template<typename T , typename TPointerBase , DoublyLinkedListPointers< T >TPointerBase::* Pointers>
const T* CesiumUtility::DoublyLinkedListAdvanced< T, TPointerBase, Pointers >::head ( ) const
inlinenoexcept

Returns the head node of this list, or nullptr if the list is empty.

Definition at line 188 of file DoublyLinkedList.h.

◆ next() [1/2]

template<typename T , typename TPointerBase , DoublyLinkedListPointers< T >TPointerBase::* Pointers>
const T* CesiumUtility::DoublyLinkedListAdvanced< T, TPointerBase, Pointers >::next ( const T &  node) const
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.

◆ next() [2/2]

template<typename T , typename TPointerBase , DoublyLinkedListPointers< T >TPointerBase::* Pointers>
const T* CesiumUtility::DoublyLinkedListAdvanced< T, TPointerBase, Pointers >::next ( const T *  pNode) const
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.

◆ previous() [1/2]

template<typename T , typename TPointerBase , DoublyLinkedListPointers< T >TPointerBase::* Pointers>
const T* CesiumUtility::DoublyLinkedListAdvanced< T, TPointerBase, Pointers >::previous ( const T &  node) const
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.

◆ previous() [2/2]

template<typename T , typename TPointerBase , DoublyLinkedListPointers< T >TPointerBase::* Pointers>
const T* CesiumUtility::DoublyLinkedListAdvanced< T, TPointerBase, Pointers >::previous ( const T *  pNode) const
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.

◆ tail()

template<typename T , typename TPointerBase , DoublyLinkedListPointers< T >TPointerBase::* Pointers>
const T* CesiumUtility::DoublyLinkedListAdvanced< T, TPointerBase, Pointers >::tail ( ) const
inlinenoexcept

Returns the tail node of this list, or nullptr if the list is empty.

Definition at line 197 of file DoublyLinkedList.h.


The documentation for this class was generated from the following file: