#include <include/EST_TIterator.h>
Public Types | |
typedef EST_TIterator< Container, IPointer, Entry > | Iter |
Public Member Functions | |
EST_TStructIterator () | |
Create an iterator not associated with any specific container. | |
Iter & | operator= (const Iter &orig) |
Copy an iterator by assignment. | |
EST_TStructIterator (const Container &over) | |
Create an iterator ready to run over the given container. | |
const Entry * | operator-> () const |
Template class defining interface to an iterator, i.e an object which returns elements from a structure one at a time.
This is template is usually hidden in the declaration of the container classes with a typedef for Entries providing a more convenient name for the iterator. However the interface is that defined here.
We support two interfaces, a pointer like interface similar to specialised iteration code elsewhere in the speech tools library and to the iterators in the C++ standard template library and an interface similar to that of Enumerations in Java.
<programlisting arch='c++'> MyContainer::Entries them;
for(them.begin(container); them; them++) { MyContainer::Entry &it = *them; // Do Something With it }</programlisting>
<programlisting arch='c++'> MyContainer::Entries them;
them.begin(container); while (them.has_more_entries()) { MyContainer::Entry &it = them.next_entry(); // Do Something With it }</programlisting>
Definition at line 74 of file EST_TIterator.h.