cesium-native 0.43.0
Loading...
Searching...
No Matches
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 

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 63 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 257 of file DoublyLinkedList.h.

◆ head() [1/2]

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 189 of file DoublyLinkedList.h.

◆ head() [2/2]

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

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

Definition at line 186 of file DoublyLinkedList.h.

◆ insertAfter()

template<typename T , typename TPointerBase , DoublyLinkedListPointers< T >TPointerBase::* Pointers>
void CesiumUtility::DoublyLinkedListAdvanced< T, TPointerBase, Pointers >::insertAfter ( T & after,
T & node )
inlinenoexcept

Insert the given node after the other node.

Definition at line 95 of file DoublyLinkedList.h.

◆ insertAtHead()

template<typename T , typename TPointerBase , DoublyLinkedListPointers< T >TPointerBase::* Pointers>
void CesiumUtility::DoublyLinkedListAdvanced< T, TPointerBase, Pointers >::insertAtHead ( T & node)
inlinenoexcept

Insert the given node as the new head of the list.

Definition at line 146 of file DoublyLinkedList.h.

◆ insertAtTail()

template<typename T , typename TPointerBase , DoublyLinkedListPointers< T >TPointerBase::* Pointers>
void CesiumUtility::DoublyLinkedListAdvanced< T, TPointerBase, Pointers >::insertAtTail ( T & node)
inlinenoexcept

Insert the given node as the new tail of the list.

Definition at line 163 of file DoublyLinkedList.h.

◆ insertBefore()

template<typename T , typename TPointerBase , DoublyLinkedListPointers< T >TPointerBase::* Pointers>
void CesiumUtility::DoublyLinkedListAdvanced< T, TPointerBase, Pointers >::insertBefore ( T & before,
T & node )
inlinenoexcept

Insert the given node before the other node.

Definition at line 120 of file DoublyLinkedList.h.

◆ next() [1/4]

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 207 of file DoublyLinkedList.h.

◆ next() [2/4]

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 218 of file DoublyLinkedList.h.

◆ next() [3/4]

template<typename T , typename TPointerBase , DoublyLinkedListPointers< T >TPointerBase::* Pointers>
T * CesiumUtility::DoublyLinkedListAdvanced< T, TPointerBase, Pointers >::next ( T & node)
inlinenoexcept

Returns the next node after the given one, or nullptr if the given node is the tail.

Definition at line 204 of file DoublyLinkedList.h.

◆ next() [4/4]

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

Returns the next node after the given one, or the head if the given node is nullptr.

Definition at line 213 of file DoublyLinkedList.h.

◆ previous() [1/4]

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 229 of file DoublyLinkedList.h.

◆ previous() [2/4]

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 242 of file DoublyLinkedList.h.

◆ previous() [3/4]

template<typename T , typename TPointerBase , DoublyLinkedListPointers< T >TPointerBase::* Pointers>
T * CesiumUtility::DoublyLinkedListAdvanced< T, TPointerBase, Pointers >::previous ( T & node)
inlinenoexcept

Returns the previous node before the given one, or nullptr if the given node is the head.

Definition at line 226 of file DoublyLinkedList.h.

◆ previous() [4/4]

template<typename T , typename TPointerBase , DoublyLinkedListPointers< T >TPointerBase::* Pointers>
T * CesiumUtility::DoublyLinkedListAdvanced< T, TPointerBase, Pointers >::previous ( T * pNode)
inline

Returns the previous node before the given one, or the tail if the given node is nullptr.

Definition at line 237 of file DoublyLinkedList.h.

◆ remove()

template<typename T , typename TPointerBase , DoublyLinkedListPointers< T >TPointerBase::* Pointers>
void CesiumUtility::DoublyLinkedListAdvanced< T, TPointerBase, Pointers >::remove ( T & node)
inlinenoexcept

Removes the given node from this list.

Definition at line 68 of file DoublyLinkedList.h.

◆ size()

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

Returns the size of this list.

Definition at line 180 of file DoublyLinkedList.h.

◆ tail() [1/2]

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 198 of file DoublyLinkedList.h.

◆ tail() [2/2]

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

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

Definition at line 195 of file DoublyLinkedList.h.


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