Vital
Loading...
Searching...
No Matches
vital::CircularQueue< T >::iterator Class Reference

A forward and backward iterator for iterating over the elements in the CircularQueue. More...

#include <circular_queue.h>

Public Member Functions

 iterator (T *pointer, T *front, T *end)
 Constructs an iterator.
 
force_inline void increment ()
 Moves the iterator to the next element.
 
force_inline void decrement ()
 Moves the iterator to the previous element.
 
force_inline iterator operator++ ()
 
force_inline const iterator operator++ (int i)
 
force_inline iterator operator-- ()
 
force_inline const iterator operator-- (int i)
 
force_inline T & operator* ()
 
force_inline T * operator-> ()
 
force_inline T * get ()
 
force_inline bool operator== (const iterator &rhs)
 
force_inline bool operator!= (const iterator &rhs)
 

Protected Attributes

T * pointer_
 
T * front_
 
T * end_
 

Detailed Description

template<class T>
class vital::CircularQueue< T >::iterator

A forward and backward iterator for iterating over the elements in the CircularQueue.

The iterator supports increment and decrement operations and wraps around the circular buffer.

Constructor & Destructor Documentation

◆ iterator()

template<class T >
vital::CircularQueue< T >::iterator::iterator ( T * pointer,
T * front,
T * end )
inline

Constructs an iterator.

Parameters
pointerThe current pointer to an element in the queue.
frontThe pointer to the start of the internal buffer.
endThe pointer to the end of the internal buffer.

Member Function Documentation

◆ decrement()

template<class T >
force_inline void vital::CircularQueue< T >::iterator::decrement ( )
inline

Moves the iterator to the previous element.

◆ get()

template<class T >
force_inline T * vital::CircularQueue< T >::iterator::get ( )
inline

◆ increment()

template<class T >
force_inline void vital::CircularQueue< T >::iterator::increment ( )
inline

Moves the iterator to the next element.

◆ operator!=()

template<class T >
force_inline bool vital::CircularQueue< T >::iterator::operator!= ( const iterator & rhs)
inline

◆ operator*()

template<class T >
force_inline T & vital::CircularQueue< T >::iterator::operator* ( )
inline

◆ operator++() [1/2]

template<class T >
force_inline iterator vital::CircularQueue< T >::iterator::operator++ ( )
inline

◆ operator++() [2/2]

template<class T >
force_inline const iterator vital::CircularQueue< T >::iterator::operator++ ( int i)
inline

◆ operator--() [1/2]

template<class T >
force_inline iterator vital::CircularQueue< T >::iterator::operator-- ( )
inline

◆ operator--() [2/2]

template<class T >
force_inline const iterator vital::CircularQueue< T >::iterator::operator-- ( int i)
inline

◆ operator->()

template<class T >
force_inline T * vital::CircularQueue< T >::iterator::operator-> ( )
inline

◆ operator==()

template<class T >
force_inline bool vital::CircularQueue< T >::iterator::operator== ( const iterator & rhs)
inline

Member Data Documentation

◆ end_

template<class T >
T* vital::CircularQueue< T >::iterator::end_
protected

◆ front_

template<class T >
T* vital::CircularQueue< T >::iterator::front_
protected

◆ pointer_

template<class T >
T* vital::CircularQueue< T >::iterator::pointer_
protected

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