libzed 1.9.9
A general-purpose library for quick and simple data manipulation.
 
Loading...
Searching...
No Matches
z::core::circularIterator< TYPE, LEN > Class Template Reference

A custom iterator for circular buffers. More...

#include <circularBuffer.hpp>

Public Member Functions

 circularIterator (const TYPE *buffer, int index) noexcept
 Constructor.
 
circularIterator operator++ () noexcept
 Move to the next spot in the buffer.
 
bool operator!= (const circularIterator &other) const noexcept
 Inequality operator.
 
const TYPEoperator* () const noexcept
 Dereference operator.
 

Detailed Description

template<typename TYPE, unsigned int LEN>
class z::core::circularIterator< TYPE, LEN >

A custom iterator for circular buffers.

This iterator allows C++'s range based for loop syntax.

Constructor & Destructor Documentation

◆ circularIterator()

template<typename TYPE , unsigned int LEN>
z::core::circularIterator< TYPE, LEN >::circularIterator ( const TYPE buffer,
int  index 
)
inlinenoexcept

Constructor.

Parameters
bufferThe raw buffer data.
indexThe current index in the buffer.

Member Function Documentation

◆ operator!=()

template<typename TYPE , unsigned int LEN>
bool z::core::circularIterator< TYPE, LEN >::operator!= ( const circularIterator< TYPE, LEN > &  other) const
inlinenoexcept

Inequality operator.

Parameters
otherThe other iterator to compare against.
Returns
True if these iterators are not pointing at the same item, false otherwise.

◆ operator*()

template<typename TYPE , unsigned int LEN>
const TYPE & z::core::circularIterator< TYPE, LEN >::operator* ( ) const
inlinenoexcept

Dereference operator.

Returns
The data at the current index.

◆ operator++()

template<typename TYPE , unsigned int LEN>
circularIterator z::core::circularIterator< TYPE, LEN >::operator++ ( )
inlinenoexcept

Move to the next spot in the buffer.

Returns
A new iterator at the next index.

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