FreeNOS
Public Member Functions
Iterator< T > Class Template Referenceabstract

Abstracts an iteration process. More...

#include <Iterator.h>

Inheritance diagram for Iterator< T >:
ListIterator< T >

Public Member Functions

virtual ~Iterator ()
 Destructor. More...
 
virtual void reset ()=0
 Restart iteration from the beginning. More...
 
virtual bool hasNext () const =0
 Check if there is more to iterate. More...
 
virtual bool hasCurrent () const =0
 Check if there is a current item. More...
 
virtual const T & current () const =0
 Get the current item read-only. More...
 
virtual T & current ()=0
 Get the current item modifiable. More...
 
virtual T & next ()=0
 Fetch the next item modifiable. More...
 
virtual bool remove ()=0
 Remove the current item from the underlying Container. More...
 
virtual void operator++ (int num)=0
 Increment operator. More...
 

Detailed Description

template<class T>
class Iterator< T >

Abstracts an iteration process.

Definition at line 34 of file Iterator.h.

Constructor & Destructor Documentation

◆ ~Iterator()

template<class T >
virtual Iterator< T >::~Iterator ( )
inlinevirtual

Destructor.

Definition at line 41 of file Iterator.h.

Member Function Documentation

◆ current() [1/2]

template<class T >
virtual const T& Iterator< T >::current ( ) const
pure virtual

Get the current item read-only.

Returns
Reference to the next item.

Implemented in ListIterator< T >, ListIterator< K >, ListIterator< K >, and HashIterator< K, V >.

◆ current() [2/2]

template<class T >
virtual T& Iterator< T >::current ( )
pure virtual

Get the current item modifiable.

Returns
Reference to the next item.

Implemented in ListIterator< K >, ListIterator< T >, ListIterator< K >, and HashIterator< K, V >.

◆ hasCurrent()

template<class T >
virtual bool Iterator< T >::hasCurrent ( ) const
pure virtual

Check if there is a current item.

Returns
True if the iterator has a current item, false otherwise.

Implemented in ListIterator< T >, and ListIterator< K >.

◆ hasNext()

template<class T >
virtual bool Iterator< T >::hasNext ( ) const
pure virtual

Check if there is more to iterate.

Returns
true if more items, false if not.

Implemented in ListIterator< T >, and ListIterator< K >.

◆ next()

template<class T >
virtual T& Iterator< T >::next ( )
pure virtual

Fetch the next item modifiable.

This function first fetches the next item and then updates the current item pointer to that item.

Returns
Reference to the next item.

Implemented in ListIterator< T >, ListIterator< K >, and HashIterator< K, V >.

◆ operator++()

template<class T >
virtual void Iterator< T >::operator++ ( int  num)
pure virtual

Increment operator.

This function first increment the current item and then updates the next item pointer.

Implemented in ListIterator< T >, ListIterator< K >, and HashIterator< K, V >.

◆ remove()

template<class T >
virtual bool Iterator< T >::remove ( )
pure virtual

Remove the current item from the underlying Container.

Returns
True if removed successfully, false otherwise.

Implemented in ListIterator< T >, ListIterator< K >, and HashIterator< K, V >.

◆ reset()

template<class T >
virtual void Iterator< T >::reset ( )
pure virtual

Restart iteration from the beginning.

Implemented in ListIterator< T >, ListIterator< K >, and HashIterator< K, V >.


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