34#ifndef __EST_TITERATOR_H__
35#define __EST_TITERATOR_H__
73template <
class Container,
class IPo
inter,
class Entry>
75template <
class Container,
class IPo
inter,
class Entry>
77template <
class Container,
class IPo
inter,
class Entry>
80template <
class Container,
class IPo
inter,
class Entry>
112 {
begin(over);
return *
this;}
149 {
next();
return *
this;}
172 const Entry *operator ->()
const
186 unsigned int n()
const {
return pos; }
195template <
class Container,
class IPo
inter,
class Entry>
212 { this->
begin(over); }
214 const Entry *operator ->()
const
218template <
class Container,
class IPo
inter,
class Entry>
260 Entry *operator ->()
const
275template <
class Container,
class IPo
inter,
class Entry>
292 { this->
begin(over); }
294 Entry *operator ->()
const
EST_TIterator< Container, IPointer, Entry > Iter
Name for an iterator like this.
const Entry & current() const
Return the element currently pointed to.
unsigned int n() const
Return the current position.
Iter & operator=(const Iter &orig)
Copy an iterator by assignment.
void begin(const Container &over)
Set the iterator ready to run over this container.
bool has_more_elements() const
True if there are more elements to look at.
bool at_end() const
True when there are no more.
const Entry & next_element()
Return the current element and move the pointer forwards.
EST_TIterator(const Container &over)
Create an iterator ready to run over the given container.
EST_TIterator()
Create an iterator not associated with any specific container.
void next()
Next moves to the next entry.
Iter & operator++()
The increment operator does the same as next.
Container * cont
The container we are looking at.
const Entry & operator*() const
The * operator returns the current element.
void beginning()
Reset to the start of the container.
unsigned int pos
Position in the structure. May or may not be useful.
EST_TRwIterator< Container, IPointer, Entry > Iter
Can't access constant containers this way.
Entry & operator*() const
The * operator returns the current element.
Entry & next_element()
Return the current element and move the pointer forwards.
EST_TRwIterator(Container &over)
Create an iterator ready to run over the given container.
EST_TRwIterator()
Create an iterator not associated with any specific container.
Iter & operator=(const Iter &orig)
Copy an iterator by assignment.
void begin(Container &over)
Set the iterator ready to run over this container.
Entry & current() const
Return the element currently pointed to.
EST_TRwStructIterator()
Create an iterator not associated with any specific container.
Iter & operator=(const Iter &orig)
Copy an iterator by assignment.
EST_TRwStructIterator(Container &over)
Create an iterator ready to run over the given container.
Iter & operator=(const Iter &orig)
Copy an iterator by assignment.
EST_TStructIterator()
Create an iterator not associated with any specific container.
EST_TStructIterator(const Container &over)
Create an iterator ready to run over the given container.