Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

lrt::IIteratorImpl Class Template Reference

An iterator implementation. More...

#include <rtiterator.h>

Inheritance diagram for lrt::IIteratorImpl:

Inheritance graph
[legend]
List of all members.

Public Methods

virtual ~IIteratorImpl ()
 Destroys the iterator implementation.

virtual void goToNext ()=0
 Move the iterator to the next element. More...

virtual void goToPrev ()=0
 Move the iterator to the previous element. More...

virtual bool equals (const IIteratorImpl< T > *) const=0
 Check if this iterator implementation is at the same position of the same collection as the given one. More...

virtual bool hasElement () const=0
 Return true if the current iterator position denotes a valid element.

virtual bool hasNext () const=0
 Return true iff goToNext(); hasElement(); would return true.

virtual bool hasPrev () const=0
 Return true iff goToPrev(); hasElement(); would return true.

virtual T & get ()=0
 Return a modifyable reference to the element at the current iterator position, or any nonsense element if the current position is invalid.

virtual const T & get () const=0
 Return a constant reference to the element at the current iterator position, or any nonsense element if the current position is invalid.

virtual bool canModify ()=0
 Return true if the iterator can modify its collection. More...

virtual void remove ()=0
 Remove the element at the current iterator position, and advance to the next element.

virtual IIteratorImpl< T > * clone () const=0
 Return a copy of your concrete iterator implementation, pointing to the same collection element.


Detailed Description

template<class T>
class lrt::IIteratorImpl< T >

An iterator implementation.

This interface must be implemented by whatever class serving as a concrete iterator for a collection in libRT.


Member Function Documentation

template<class T>
virtual bool lrt::IIteratorImpl< T >::canModify (    )  [pure virtual]
 

Return true if the iterator can modify its collection.

(e.g. remove elements from it, modify its elements,...)

Implemented in lrt::List::IteratorImpl.

template<class T>
virtual bool lrt::IIteratorImpl< T >::equals (  const IIteratorImpl< T > *    )  const [pure virtual]
 

Check if this iterator implementation is at the same position of the same collection as the given one.

Note: You should first check that the other implementation is of your same class, by using a dynamic_cast to your concrete implementation.

Implemented in lrt::List::IteratorImpl.

template<class T>
virtual void lrt::IIteratorImpl< T >::goToNext (    )  [pure virtual]
 

Move the iterator to the next element.

If there is no next element, the iterator should move to an invalid position.

Implemented in lrt::List::IteratorImpl.

template<class T>
virtual void lrt::IIteratorImpl< T >::goToPrev (    )  [pure virtual]
 

Move the iterator to the previous element.

If there is no previous element, the iterator should move to an invalid position.

Implemented in lrt::List::IteratorImpl.


The documentation for this class was generated from the following file:
This is the RoboTour API documentation version 0.1 • Copyright (C) by Florian Fischer