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

lrt::List::IteratorImpl Class Template Reference

Concrete implementation of an iterator on lists. More...

#include <rtlist.h>

Inheritance diagram for lrt::List::IteratorImpl:

Inheritance graph
[legend]
List of all members.

Public Methods

virtual ~IteratorImpl ()
virtual void goToNext ()
 Move the iterator to the next element. More...

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

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

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

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

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

virtual T & get ()
 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
 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 ()
 Return true if the iterator can modify its collection. More...

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


Friends

class List< T >

Detailed Description

template<class T>
class lrt::List< T >::IteratorImpl

Concrete implementation of an iterator on lists.

This class is for use by List itself only. Use Iterator instead.


Member Function Documentation

template<class T>
virtual bool lrt::List< T >::IteratorImpl::canModify (    )  [inline, virtual]
 

Return true if the iterator can modify its collection.

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

Implements lrt::IIteratorImpl.

template<class T>
virtual bool lrt::List< T >::IteratorImpl::equals (  const IIteratorImpl< T > *    it )  const [inline, 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.

Implements lrt::IIteratorImpl.

template<class T>
virtual void lrt::List< T >::IteratorImpl::goToNext (    )  [inline, virtual]
 

Move the iterator to the next element.

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

Implements lrt::IIteratorImpl.

template<class T>
virtual void lrt::List< T >::IteratorImpl::goToPrev (    )  [inline, virtual]
 

Move the iterator to the previous element.

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

Implements lrt::IIteratorImpl.


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