PUMA Library Reference Manual
Loading...
Searching...
No Matches
Puma::BCList< Item, BUCKET_SIZE >::Iterator Class Reference

#include <Puma/BCList.h>

+ Inheritance diagram for Puma::BCList< Item, BUCKET_SIZE >::Iterator:

Description

template<class Item, int BUCKET_SIZE = 32>
class Puma::BCList< Item, BUCKET_SIZE >::Iterator

Bucket list sequential iterator.

Public Member Functions

 Iterator ()
 Construct an empty iterator. More...
 
 operator bool () const
 Check whether this iterator is in a valid state. More...
 
bool operator== (const Iterator &other) const
 Compare two iterators. More...
 
bool operator!= (const Iterator &other) const
 Compare two iterators. More...
 
Iteratoroperator++ ()
 Unary increment operator. More...
 
Iterator operator++ (int)
 Binary increment operator. More...
 
Iteratoroperator-- ()
 Unary decrement operator. More...
 
Iterator operator-- (int)
 Binary decrement operator. More...
 
Item & operator* () const
 Get the list item the iterator currently points to. More...
 
Item * operator-> () const
 Get a pointer to the list item the iterator currently points to. More...
 

Friends

class BCList< Item, BUCKET_SIZE >
 

Constructor & Destructor Documentation

◆ Iterator()

template<class Item , int BUCKET_SIZE = 32>
Puma::BCList< Item, BUCKET_SIZE >::Iterator::Iterator ( )
inline

Construct an empty iterator.

Do not use this iterator for other purposes than comparison.

Member Function Documentation

◆ operator bool()

template<class Item , int BUCKET_SIZE = 32>
Puma::BCList< Item, BUCKET_SIZE >::Iterator::operator bool ( ) const
inline

Check whether this iterator is in a valid state.

If the iterator is not valid, it must not be used for other purposes than comparison.

Returns
True if the iterator is valid.

◆ operator!=()

template<class Item , int BUCKET_SIZE = 32>
bool Puma::BCList< Item, BUCKET_SIZE >::Iterator::operator!= ( const Iterator other) const
inline

Compare two iterators.

Parameters
otherThe iterator to compare to.
Returns
True if both iterators point to different list items.

◆ operator*()

template<class Item , int BUCKET_SIZE = 32>
Item & Puma::BCList< Item, BUCKET_SIZE >::Iterator::operator* ( ) const
inline

Get the list item the iterator currently points to.

Ensure the iterator is valid before calling this method.

Returns
A reference to the current list item.

◆ operator++() [1/2]

template<class Item , int BUCKET_SIZE = 32>
Iterator & Puma::BCList< Item, BUCKET_SIZE >::Iterator::operator++ ( )
inline

Unary increment operator.

Lets point the iterator to the next item in the list.

Returns
A reference to this iterator pointing to the next item.

◆ operator++() [2/2]

template<class Item , int BUCKET_SIZE = 32>
Iterator Puma::BCList< Item, BUCKET_SIZE >::Iterator::operator++ ( int  )
inline

Binary increment operator.

Lets point the iterator to the next item in the list.

Returns
An new iterator pointing to the same item before the iterator was incremented.

◆ operator--() [1/2]

template<class Item , int BUCKET_SIZE = 32>
Iterator & Puma::BCList< Item, BUCKET_SIZE >::Iterator::operator-- ( )
inline

Unary decrement operator.

Lets point the iterator to the previous item in the list.

Returns
A reference to this iterator pointing to the previous item.

◆ operator--() [2/2]

template<class Item , int BUCKET_SIZE = 32>
Iterator Puma::BCList< Item, BUCKET_SIZE >::Iterator::operator-- ( int  )
inline

Binary decrement operator.

Lets point the iterator to the previous item in the list.

Returns
An new iterator pointing to the same item before the iterator was decremented.

◆ operator->()

template<class Item , int BUCKET_SIZE = 32>
Item * Puma::BCList< Item, BUCKET_SIZE >::Iterator::operator-> ( ) const
inline

Get a pointer to the list item the iterator currently points to.

Ensure the iterator is valid before calling this method.

Returns
A pointer to the current list item.

◆ operator==()

template<class Item , int BUCKET_SIZE = 32>
bool Puma::BCList< Item, BUCKET_SIZE >::Iterator::operator== ( const Iterator other) const
inline

Compare two iterators.

Parameters
otherThe iterator to compare to.
Returns
True if both iterators point to same list item.

Friends And Related Function Documentation

◆ BCList< Item, BUCKET_SIZE >

template<class Item , int BUCKET_SIZE = 32>
friend class BCList< Item, BUCKET_SIZE >
friend