Ocean
Loading...
Searching...
No Matches
Ocean::StackHeapVector< T, tStackCapacity >::Iterator Class Reference

Definition of an iterator allowing to iterate through the vector. More...

#include <StackHeapVector.h>

Public Member Functions

Iterator & operator++ ()
 (Pre-) increments this iterator.
Iterator operator++ (int)
 (Post-) increments this iterator.
T & operator* ()
 De-references the iterator and provides access to the underlying element in the vector.
bool operator== (const Iterator &iterator) const
 Compares two iterators and returns whether both iterators point to the same vector element.
bool operator!= (const Iterator &iterator) const
 Compares two iterators and returns whether both iterators do not point to the same vector element.

Protected Member Functions

 Iterator (StackHeapVector &vector, const size_t index)
 Creates a new iterator pointing to a specified elements in the vector.

Protected Attributes

StackHeapVector & vector_
 The vector owning this iterator.
size_t index_ = size_t(-1)
 The index of the element within the vector to which the iterator points.

Friends

class StackHeapVector

Detailed Description

template<typename T, size_t tStackCapacity>
class Ocean::StackHeapVector< T, tStackCapacity >::Iterator

Definition of an iterator allowing to iterate through the vector.

The iterator allows to modified the element to which the iterator is pointing.

Constructor & Destructor Documentation

◆ Iterator()

template<typename T, size_t tStackCapacity>
Ocean::StackHeapVector< T, tStackCapacity >::Iterator::Iterator ( StackHeapVector & vector,
const size_t index )
protected

Creates a new iterator pointing to a specified elements in the vector.

Parameters
vectorThe vector owning this iterator
indexThe index of the element to which the iterator points

Member Function Documentation

◆ operator!=()

template<typename T, size_t tStackCapacity>
bool Ocean::StackHeapVector< T, tStackCapacity >::Iterator::operator!= ( const Iterator & iterator) const

Compares two iterators and returns whether both iterators do not point to the same vector element.

Returns
True, if so

◆ operator*()

template<typename T, size_t tStackCapacity>
T & Ocean::StackHeapVector< T, tStackCapacity >::Iterator::operator* ( )

De-references the iterator and provides access to the underlying element in the vector.

Returns
The vector element to which this iterator points

◆ operator++() [1/2]

template<typename T, size_t tStackCapacity>
StackHeapVector< T, tStackCapacity >::Iterator & Ocean::StackHeapVector< T, tStackCapacity >::Iterator::operator++ ( )

(Pre-) increments this iterator.

Returns
Reference to the incremented iterator

◆ operator++() [2/2]

template<typename T, size_t tStackCapacity>
StackHeapVector< T, tStackCapacity >::Iterator Ocean::StackHeapVector< T, tStackCapacity >::Iterator::operator++ ( int )

(Post-) increments this iterator.

Returns
The current (not yet) incremented iterator.

◆ operator==()

template<typename T, size_t tStackCapacity>
bool Ocean::StackHeapVector< T, tStackCapacity >::Iterator::operator== ( const Iterator & iterator) const

Compares two iterators and returns whether both iterators point to the same vector element.

Returns
True, if so

◆ StackHeapVector

template<typename T, size_t tStackCapacity>
friend class StackHeapVector
friend

Field Documentation

◆ index_

template<typename T, size_t tStackCapacity>
size_t Ocean::StackHeapVector< T, tStackCapacity >::Iterator::index_ = size_t(-1)
protected

The index of the element within the vector to which the iterator points.

◆ vector_

template<typename T, size_t tStackCapacity>
StackHeapVector& Ocean::StackHeapVector< T, tStackCapacity >::Iterator::vector_
protected

The vector owning this iterator.


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