Base Framework
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
DoubleLinkedNode< TYPE > Class Template Reference

Double linked node. More...

#include <base/collection/DoubleLinkedNode.h>

Public Member Functions

 DoubleLinkedNode (NullPtr, NullPtr, const TYPE &_value)
 
 DoubleLinkedNode (NullPtr, NullPtr, TYPE &&_value)
 
 DoubleLinkedNode (DoubleLinkedNode *_next, DoubleLinkedNode *_previous)
 
 DoubleLinkedNode (DoubleLinkedNode *_next, DoubleLinkedNode *_previous, const TYPE &_value)
 
 DoubleLinkedNode (DoubleLinkedNode *_next, DoubleLinkedNode *_previous, TYPE &&_value)
 
DoubleLinkedNodegetNext () const noexcept
 
void setNext (DoubleLinkedNode *next) noexcept
 
DoubleLinkedNodegetPrevious () const noexcept
 
void setPrevious (DoubleLinkedNode *previous) noexcept
 
TYPE & getValue () noexcept
 
const TYPE & getValue () const noexcept
 
void setValue (const TYPE &value) noexcept
 
void setValue (TYPE &&value) noexcept
 
TYPE & operator* () noexcept
 
const TYPE & operator* () const noexcept
 

Protected Member Functions

 DoubleLinkedNode (int, int, const TYPE &_value)
 

Protected Attributes

DoubleLinkedNodenext = nullptr
 
DoubleLinkedNodeprevious = nullptr
 
TYPE value
 

Detailed Description

template<class TYPE>
class DoubleLinkedNode< TYPE >

Double linked node.

A double linked node. This class is used by collections that only require bidirectional traversal of elements.

Constructor & Destructor Documentation

◆ DoubleLinkedNode() [1/5]

template<class TYPE >
DoubleLinkedNode< TYPE >::DoubleLinkedNode ( NullPtr  ,
NullPtr  ,
const TYPE &  _value 
)
inline

Initializes a linked node with no previous and next node.

◆ DoubleLinkedNode() [2/5]

template<class TYPE >
DoubleLinkedNode< TYPE >::DoubleLinkedNode ( NullPtr  ,
NullPtr  ,
TYPE &&  _value 
)
inline

Initializes a linked node with no previous and next node.

◆ DoubleLinkedNode() [3/5]

template<class TYPE >
DoubleLinkedNode< TYPE >::DoubleLinkedNode ( DoubleLinkedNode< TYPE > *  _next,
DoubleLinkedNode< TYPE > *  _previous 
)
inline

Initializes a linked node with default construction of value.

Parameters
nextThe next node in the container.
previousThe previous node in the container.

◆ DoubleLinkedNode() [4/5]

template<class TYPE >
DoubleLinkedNode< TYPE >::DoubleLinkedNode ( DoubleLinkedNode< TYPE > *  _next,
DoubleLinkedNode< TYPE > *  _previous,
const TYPE &  _value 
)
inline

Initializes a linked node.

Parameters
nextThe next node in the container.
previousThe previous node in the container.
valueThe value to be associated with the node.

◆ DoubleLinkedNode() [5/5]

template<class TYPE >
DoubleLinkedNode< TYPE >::DoubleLinkedNode ( DoubleLinkedNode< TYPE > *  _next,
DoubleLinkedNode< TYPE > *  _previous,
TYPE &&  _value 
)
inline

Initializes a linked node.

Parameters
nextThe next node in the container.
previousThe previous node in the container.
valueThe value to be associated with the node.

Member Function Documentation

◆ getNext()

template<class TYPE >
DoubleLinkedNode* DoubleLinkedNode< TYPE >::getNext ( ) const
inlinenoexcept

Returns the next node.

◆ getPrevious()

template<class TYPE >
DoubleLinkedNode* DoubleLinkedNode< TYPE >::getPrevious ( ) const
inlinenoexcept

Returns the previous node.

◆ getValue() [1/2]

template<class TYPE >
const TYPE& DoubleLinkedNode< TYPE >::getValue ( ) const
inlinenoexcept

Returns the value of the node.

◆ getValue() [2/2]

template<class TYPE >
TYPE& DoubleLinkedNode< TYPE >::getValue ( )
inlinenoexcept

Returns the value of the node.

◆ setNext()

template<class TYPE >
void DoubleLinkedNode< TYPE >::setNext ( DoubleLinkedNode< TYPE > *  next)
inlinenoexcept

Sets the next node.

◆ setPrevious()

template<class TYPE >
void DoubleLinkedNode< TYPE >::setPrevious ( DoubleLinkedNode< TYPE > *  previous)
inlinenoexcept

Sets the previous node.

◆ setValue() [1/2]

template<class TYPE >
void DoubleLinkedNode< TYPE >::setValue ( const TYPE &  value)
inlinenoexcept

Sets the value of the node.

◆ setValue() [2/2]

template<class TYPE >
void DoubleLinkedNode< TYPE >::setValue ( TYPE &&  value)
inlinenoexcept

Sets the value of the node.

Member Data Documentation

◆ next

template<class TYPE >
DoubleLinkedNode* DoubleLinkedNode< TYPE >::next = nullptr
protected

The next node in the container.

◆ previous

template<class TYPE >
DoubleLinkedNode* DoubleLinkedNode< TYPE >::previous = nullptr
protected

The previous node in the container.

◆ value

template<class TYPE >
TYPE DoubleLinkedNode< TYPE >::value
protected

The value associated with the node.