Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
TDoubleLinkedList< ElementType > Class Template Reference

#include <List.h>

+ Collaboration diagram for TDoubleLinkedList< ElementType >:

Classes

class  TDoubleLinkedListNode
 

Public Types

typedef TDoubleLinkedListIterator< TDoubleLinkedListNode, ElementType > TIterator
 
typedef TDoubleLinkedListIterator< TDoubleLinkedListNode, const ElementType > TConstIterator
 

Public Member Functions

 TDoubleLinkedList ()
 
virtual ~TDoubleLinkedList ()
 
bool AddHead (const ElementType &InElement)
 
bool AddHead (TDoubleLinkedListNode *NewNode)
 
bool AddTail (const ElementType &InElement)
 
bool AddTail (TDoubleLinkedListNode *NewNode)
 
bool InsertNode (const ElementType &InElement, TDoubleLinkedListNode *NodeToInsertBefore=nullptr)
 
bool InsertNode (TDoubleLinkedListNode *NewNode, TDoubleLinkedListNode *NodeToInsertBefore=nullptr)
 
void RemoveNode (const ElementType &InElement)
 
void RemoveNode (TDoubleLinkedListNode *NodeToRemove, bool bDeleteNode=true)
 
void Empty ()
 
TDoubleLinkedListNodeGetHead () const
 
TDoubleLinkedListNodeGetTail () const
 
TDoubleLinkedListNodeFindNode (const ElementType &InElement)
 
bool Contains (const ElementType &InElement)
 
bool IsEmpty () const
 
int32 Num () const
 

Protected Member Functions

virtual void SetListSize (int32 NewListSize)
 

Private Member Functions

 TDoubleLinkedList (const TDoubleLinkedList &)
 
TDoubleLinkedListoperator= (const TDoubleLinkedList &)
 

Private Attributes

TDoubleLinkedListNodeHeadNode
 
TDoubleLinkedListNodeTailNode
 
int32 ListSize
 

Friends

TIterator begin (TDoubleLinkedList &List)
 
TConstIterator begin (const TDoubleLinkedList &List)
 
TIterator end (TDoubleLinkedList &List)
 
TConstIterator end (const TDoubleLinkedList &List)
 

Detailed Description

template<class ElementType>
class TDoubleLinkedList< ElementType >

Double linked list.

See also
TIntrusiveDoubleLinkedList

Definition at line 435 of file List.h.

Member Typedef Documentation

◆ TConstIterator

template<class ElementType >
typedef TDoubleLinkedListIterator<TDoubleLinkedListNode, const ElementType> TDoubleLinkedList< ElementType >::TConstIterator

Definition at line 488 of file List.h.

◆ TIterator

template<class ElementType >
typedef TDoubleLinkedListIterator<TDoubleLinkedListNode, ElementType> TDoubleLinkedList< ElementType >::TIterator

Used to iterate over the elements of a linked list.

Definition at line 487 of file List.h.

Constructor & Destructor Documentation

◆ TDoubleLinkedList() [1/2]

template<class ElementType >
TDoubleLinkedList< ElementType >::TDoubleLinkedList ( )
inline

Constructors.

Definition at line 491 of file List.h.

◆ ~TDoubleLinkedList()

template<class ElementType >
virtual TDoubleLinkedList< ElementType >::~TDoubleLinkedList ( )
inlinevirtual

Destructor

Definition at line 498 of file List.h.

◆ TDoubleLinkedList() [2/2]

template<class ElementType >
TDoubleLinkedList< ElementType >::TDoubleLinkedList ( const TDoubleLinkedList< ElementType > & )
private

Member Function Documentation

◆ AddHead() [1/2]

template<class ElementType >
bool TDoubleLinkedList< ElementType >::AddHead ( const ElementType & InElement)
inline

Add the specified value to the beginning of the list, making that value the new head of the list.

Parameters
InElementthe value to add to the list.
Returns
whether the node was successfully added into the list.
See also
GetHead, InsertNode, RemoveNode

Definition at line 512 of file List.h.

◆ AddHead() [2/2]

template<class ElementType >
bool TDoubleLinkedList< ElementType >::AddHead ( TDoubleLinkedListNode * NewNode)
inline

Definition at line 517 of file List.h.

◆ AddTail() [1/2]

template<class ElementType >
bool TDoubleLinkedList< ElementType >::AddTail ( const ElementType & InElement)
inline

Append the specified value to the end of the list

Parameters
InElementthe value to add to the list.
Returns
whether the node was successfully added into the list
See also
GetTail, InsertNode, RemoveNode

Definition at line 547 of file List.h.

◆ AddTail() [2/2]

template<class ElementType >
bool TDoubleLinkedList< ElementType >::AddTail ( TDoubleLinkedListNode * NewNode)
inline

Definition at line 552 of file List.h.

◆ Contains()

template<class ElementType >
bool TDoubleLinkedList< ElementType >::Contains ( const ElementType & InElement)
inline

Definition at line 739 of file List.h.

◆ Empty()

template<class ElementType >
void TDoubleLinkedList< ElementType >::Empty ( )
inline

Removes all nodes from the list.

Definition at line 679 of file List.h.

◆ FindNode()

template<class ElementType >
TDoubleLinkedListNode * TDoubleLinkedList< ElementType >::FindNode ( const ElementType & InElement)
inline

Finds the node corresponding to the value specified

Parameters
InElementthe value to find
Returns
a pointer to the node that contains the value specified, or nullptr of the value couldn't be found

Definition at line 723 of file List.h.

◆ GetHead()

template<class ElementType >
TDoubleLinkedListNode * TDoubleLinkedList< ElementType >::GetHead ( ) const
inline

Returns the node at the head of the list.

Returns
Pointer to the first node.
See also
GetTail

Definition at line 701 of file List.h.

◆ GetTail()

template<class ElementType >
TDoubleLinkedListNode * TDoubleLinkedList< ElementType >::GetTail ( ) const
inline

Returns the node at the end of the list.

Returns
Pointer to the last node.
See also
GetHead

Definition at line 712 of file List.h.

◆ InsertNode() [1/2]

template<class ElementType >
bool TDoubleLinkedList< ElementType >::InsertNode ( const ElementType & InElement,
TDoubleLinkedListNode * NodeToInsertBefore = nullptr )
inline

Insert the specified value into the list at an arbitrary point.

Parameters
InElementthe value to insert into the list
NodeToInsertBeforethe new node will be inserted into the list at the current location of this node if nullptr, the new node will become the new head of the list
Returns
whether the node was successfully added into the list
See also
Empty, RemoveNode

Definition at line 583 of file List.h.

◆ InsertNode() [2/2]

template<class ElementType >
bool TDoubleLinkedList< ElementType >::InsertNode ( TDoubleLinkedListNode * NewNode,
TDoubleLinkedListNode * NodeToInsertBefore = nullptr )
inline

Definition at line 588 of file List.h.

◆ IsEmpty()

template<class ElementType >
bool TDoubleLinkedList< ElementType >::IsEmpty ( ) const
inline

Returns true if the list is empty and contains no elements.

Returns
True if the list is empty.
See also
Num

Definition at line 750 of file List.h.

◆ Num()

template<class ElementType >
int32 TDoubleLinkedList< ElementType >::Num ( ) const
inline

Returns the number of items in the list.

Returns
Item count.

Definition at line 760 of file List.h.

◆ operator=()

template<class ElementType >
TDoubleLinkedList & TDoubleLinkedList< ElementType >::operator= ( const TDoubleLinkedList< ElementType > & )
private

◆ RemoveNode() [1/2]

template<class ElementType >
void TDoubleLinkedList< ElementType >::RemoveNode ( const ElementType & InElement)
inline

Remove the node corresponding to InElement.

Parameters
InElementThe value to remove from the list.
See also
Empty, InsertNode

Definition at line 616 of file List.h.

◆ RemoveNode() [2/2]

template<class ElementType >
void TDoubleLinkedList< ElementType >::RemoveNode ( TDoubleLinkedListNode * NodeToRemove,
bool bDeleteNode = true )
inline

Removes the node specified.

Parameters
NodeToRemoveThe node to remove.
See also
Empty, InsertNode

Definition at line 628 of file List.h.

◆ SetListSize()

template<class ElementType >
virtual void TDoubleLinkedList< ElementType >::SetListSize ( int32 NewListSize)
inlineprotectedvirtual

Updates the size reported by Num(). Child classes can use this function to conveniently hook into list additions/removals.

Parameters
NewListSizethe new size for this list

Definition at line 773 of file List.h.

Friends And Related Symbol Documentation

◆ begin [1/2]

template<class ElementType >
TConstIterator begin ( const TDoubleLinkedList< ElementType > & List)
friend

Definition at line 787 of file List.h.

◆ begin [2/2]

template<class ElementType >
TIterator begin ( TDoubleLinkedList< ElementType > & List)
friend

Definition at line 786 of file List.h.

◆ end [1/2]

template<class ElementType >
TConstIterator end ( const TDoubleLinkedList< ElementType > & List)
friend

Definition at line 789 of file List.h.

◆ end [2/2]

template<class ElementType >
TIterator end ( TDoubleLinkedList< ElementType > & List)
friend

Definition at line 788 of file List.h.

Member Data Documentation

◆ HeadNode

template<class ElementType >
TDoubleLinkedListNode* TDoubleLinkedList< ElementType >::HeadNode
private

Definition at line 779 of file List.h.

◆ ListSize

template<class ElementType >
int32 TDoubleLinkedList< ElementType >::ListSize
private

Definition at line 781 of file List.h.

◆ TailNode

template<class ElementType >
TDoubleLinkedListNode* TDoubleLinkedList< ElementType >::TailNode
private

Definition at line 780 of file List.h.


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