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

Single linked node. More...

#include <base/collection/SingleLinkedNode.h>

Public Member Functions

 SingleLinkedNode (NullPtr, const TYPE &_value) noexcept
 
 SingleLinkedNode (SingleLinkedNode *_next, const TYPE &_value) noexcept
 
SingleLinkedNodegetNext () const noexcept
 
void setNext (SingleLinkedNode *next) noexcept
 
TYPE * getValue () noexcept
 
const TYPE * getValue () const noexcept
 
void setValue (const TYPE &value) noexcept
 

Protected Member Functions

 SingleLinkedNode (int, const TYPE &_value) noexcept
 

Protected Attributes

SingleLinkedNodenext = nullptr
 
TYPE value
 

Detailed Description

template<class TYPE>
class SingleLinkedNode< TYPE >

Single linked node.

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

Constructor & Destructor Documentation

◆ SingleLinkedNode() [1/2]

template<class TYPE >
SingleLinkedNode< TYPE >::SingleLinkedNode ( NullPtr  ,
const TYPE &  _value 
)
inlinenoexcept

Initializes a linked node.

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

◆ SingleLinkedNode() [2/2]

template<class TYPE >
SingleLinkedNode< TYPE >::SingleLinkedNode ( SingleLinkedNode< TYPE > *  _next,
const TYPE &  _value 
)
inlinenoexcept

Initializes a linked node.

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

Member Function Documentation

◆ getNext()

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

Returns the next node.

◆ getValue() [1/2]

template<class TYPE >
const TYPE* SingleLinkedNode< TYPE >::getValue ( ) const
inlinenoexcept

Returns the value of the node.

◆ getValue() [2/2]

template<class TYPE >
TYPE* SingleLinkedNode< TYPE >::getValue ( )
inlinenoexcept

Returns the value of the node.

◆ setNext()

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

Sets the next node.

◆ setValue()

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

Sets the value of the node.

Member Data Documentation

◆ next

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

The next node in the container.

◆ value

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

The value associated with the node.