Ocean
Ocean::StackHeapVector< T, tStackCapacity >::Iterator Class Reference

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

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

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

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

Friends And Related Function Documentation

◆ 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: