semf
semf::LinkedQueue< T >::Node Class Reference

Implements the next() functionality for every element in a queue. More...

#include <linkedqueue.h>

Inheritance diagram for semf::LinkedQueue< T >::Node:
Inheritance graph
Collaboration diagram for semf::LinkedQueue< T >::Node:
Collaboration graph

Public Member Functions

virtual ~Node ()=default
 
T * next () const
 Returns a pointer to the next element in a queue. More...
 
void setNext (T *next)
 Sets a pointer to the next element in a list. More...
 
bool isInQueue (LinkedQueue &queue)
 Returns if a node is part of this LinkedQueue. More...
 

Detailed Description

template<class T>
class semf::LinkedQueue< T >::Node

Implements the next() functionality for every element in a queue.

A class type using LinkedQueue has to inherit from this class.

Definition at line 45 of file linkedqueue.h.

Constructor & Destructor Documentation

◆ ~Node()

template<class T >
virtual semf::LinkedQueue< T >::Node::~Node ( )
virtualdefault

Member Function Documentation

◆ isInQueue()

template<class T >
bool semf::LinkedQueue< T >::Node::isInQueue ( LinkedQueue queue)
inline

Returns if a node is part of this LinkedQueue.

Note
This is done by checking if the pointer to the next element is nullptr and if this node is the last element in queue.
Parameters
queueQueue to check.
Returns
false for is not in this LinkedQueue, otherwise true.

Definition at line 75 of file linkedqueue.h.

Here is the call graph for this function:

◆ next()

template<class T >
T * semf::LinkedQueue< T >::Node::next ( ) const
inline

Returns a pointer to the next element in a queue.

Attention
The last element in a queue will return nullptr.
Returns
The next element in a queue.

Definition at line 55 of file linkedqueue.h.

Here is the caller graph for this function:

◆ setNext()

template<class T >
void semf::LinkedQueue< T >::Node::setNext ( T *  next)
inline

Sets a pointer to the next element in a list.

Attention
Do not use outside LinkedList. That leads to undefined behavior.
Parameters
nextThe next element in a list.

Definition at line 64 of file linkedqueue.h.

Here is the call graph for this function: