Unreal Snake Game 1.0.0
Public Types | Public Member Functions | Private Attributes | Friends | List of all members
SnakeGame::TLinkedListBase< ContainerType, ElementType, IteratorType > Class Template Reference

#include <List.h>

Public Types

typedef IteratorType< ContainerType, ElementType > TIterator
 
typedef IteratorType< ContainerType, const ElementType > TConstIterator
 

Public Member Functions

 TLinkedListBase ()
 
FORCEINLINE void Unlink ()
 
FORCEINLINE void LinkBefore (ContainerType *Before)
 
FORCEINLINE void LinkAfter (ContainerType *After)
 
FORCEINLINE void LinkReplace (ContainerType *Replace)
 
FORCEINLINE void LinkHead (ContainerType *&Head)
 
FORCEINLINE bool IsLinked ()
 
FORCEINLINE ContainerType ** GetPrevLink () const
 
FORCEINLINE ContainerType * GetNextLink () const
 
FORCEINLINE ContainerType * Next ()
 

Private Attributes

ContainerType * NextLink
 
ContainerType ** PrevLink
 

Friends

FORCEINLINE friend TIterator begin (ContainerType &List)
 
FORCEINLINE friend TConstIterator begin (const ContainerType &List)
 
FORCEINLINE friend TIterator end (ContainerType &List)
 
FORCEINLINE friend TConstIterator end (const ContainerType &List)
 

Detailed Description

template<class ContainerType, class ElementType, template< class, class > class IteratorType>
class SnakeGame::TLinkedListBase< ContainerType, ElementType, IteratorType >

Base linked list class, used to implement methods shared by intrusive/non-intrusive linked lists

Member Typedef Documentation

◆ TIterator

template<class ContainerType , class ElementType , template< class, class > class IteratorType>
typedef IteratorType<ContainerType, ElementType> SnakeGame::TLinkedListBase< ContainerType, ElementType, IteratorType >::TIterator

Used to iterate over the elements of a linked list.

Constructor & Destructor Documentation

◆ TLinkedListBase()

template<class ContainerType , class ElementType , template< class, class > class IteratorType>
SnakeGame::TLinkedListBase< ContainerType, ElementType, IteratorType >::TLinkedListBase ( )
inline

Default constructor (empty list)

Member Function Documentation

◆ IsLinked()

template<class ContainerType , class ElementType , template< class, class > class IteratorType>
FORCEINLINE bool SnakeGame::TLinkedListBase< ContainerType, ElementType, IteratorType >::IsLinked ( )
inline

Returns whether element is currently linked.

Returns
true if currently linked, false otherwise

◆ LinkAfter()

template<class ContainerType , class ElementType , template< class, class > class IteratorType>
FORCEINLINE void SnakeGame::TLinkedListBase< ContainerType, ElementType, IteratorType >::LinkAfter ( ContainerType *  After)
inline

Adds this element to the linked list, after the specified element

Parameters
AfterThe link to insert this element after.

◆ LinkBefore()

template<class ContainerType , class ElementType , template< class, class > class IteratorType>
FORCEINLINE void SnakeGame::TLinkedListBase< ContainerType, ElementType, IteratorType >::LinkBefore ( ContainerType *  Before)
inline

Adds this element to a list, before the given element.

Parameters
BeforeThe link to insert this element before.

◆ LinkHead()

template<class ContainerType , class ElementType , template< class, class > class IteratorType>
FORCEINLINE void SnakeGame::TLinkedListBase< ContainerType, ElementType, IteratorType >::LinkHead ( ContainerType *&  Head)
inline

Adds this element as the head of the linked list, linking the input Head pointer to this element, so that when the element is linked/unlinked, the Head linked list pointer will be correctly updated.

If Head already has an element, this functions like LinkBefore.

Parameters
HeadPointer to the head of the linked list - this pointer should be the main reference point for the linked list

◆ LinkReplace()

template<class ContainerType , class ElementType , template< class, class > class IteratorType>
FORCEINLINE void SnakeGame::TLinkedListBase< ContainerType, ElementType, IteratorType >::LinkReplace ( ContainerType *  Replace)
inline

Adds this element to the linked list, replacing the specified element. This is equivalent to calling LinkBefore(Replace); Replace->Unlink();

Parameters
ReplacePointer to the element to be replaced

◆ Unlink()

template<class ContainerType , class ElementType , template< class, class > class IteratorType>
FORCEINLINE void SnakeGame::TLinkedListBase< ContainerType, ElementType, IteratorType >::Unlink ( )
inline

Removes this element from the list in constant time.

This function is safe to call even if the element is not linked.

Member Data Documentation

◆ NextLink

template<class ContainerType , class ElementType , template< class, class > class IteratorType>
ContainerType* SnakeGame::TLinkedListBase< ContainerType, ElementType, IteratorType >::NextLink
private

The next link in the linked list

◆ PrevLink

template<class ContainerType , class ElementType , template< class, class > class IteratorType>
ContainerType** SnakeGame::TLinkedListBase< ContainerType, ElementType, IteratorType >::PrevLink
private

Pointer to 'NextLink', within the previous link in the linked list


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