OS  v1.7.5
Documentation
Loading...
Searching...
No Matches
qOS::listIterator Class Reference

A list iterator. More...

#include <list.hpp>

Public Member Functions

 listIterator ()=delete
 
 listIterator (list &xList, listDirection dir=listDirection::FORWARD, void *nodeOffset=nullptr) noexcept
 Instantiate a list iterator for the given list.
 
bool untilEnd (void) const noexcept
 Check until current iterator reach one of its ends.
 
bool untilEnd (void *node) const noexcept
 Check until current iterator reach the given node.
 
listIteratoroperator++ (int) noexcept
 Move the iterator forward.
 
listIteratoroperator-- (int) noexcept
 Move the iterator backward.
 
template<typename T >
get (void) noexcept
 Gets the node that the iterator is currently pointing to.
 

Detailed Description

A list iterator.

Constructor & Destructor Documentation

◆ listIterator() [1/2]

qOS::listIterator::listIterator ( )
delete

◆ listIterator() [2/2]

qOS::listIterator::listIterator ( list & xList,
listDirection dir = listDirection::FORWARD,
void * nodeOffset = nullptr )
explicitnoexcept

Instantiate a list iterator for the given list.

Parameters
[in]xListThe list
[in]dirThe direction in which the iterator will traverse the list
[in]nodeOffsetA pointer to the node offset in the list

Member Function Documentation

◆ get()

template<typename T >
T qOS::listIterator::get ( void )
inlinenoexcept

Gets the node that the iterator is currently pointing to.

Returns
A pointer to the node currently being pointed.

◆ operator++()

listIterator & qOS::listIterator::operator++ ( int )
noexcept

Move the iterator forward.

◆ operator--()

listIterator & qOS::listIterator::operator-- ( int )
noexcept

Move the iterator backward.

◆ untilEnd() [1/2]

bool qOS::listIterator::untilEnd ( void * node) const
noexcept

Check until current iterator reach the given node.

Parameters
[in]nodeA pointer to the node you want to reach
Returns
true if the iterator has reach the given node.

◆ untilEnd() [2/2]

bool qOS::listIterator::untilEnd ( void ) const
noexcept

Check until current iterator reach one of its ends.

Returns
true if the iterator has reach on of its ends.