Lolly 1.4.27
Loading...
Searching...
No Matches
Classes | Functions | Variables
iterator.hpp File Reference
#include "hashmap.hpp"
#include "hashset.hpp"
#include "iterator.ipp"
Include dependency graph for iterator.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  iterator_rep< T >
 An abstract base class for iterator implementation. More...
 
class  iterator< T >
 A template class for iterators. More...
 

Functions

 ABSTRACT_TEMPLATE_CODE (iterator, class, T)
 
template<class T >
tm_ostreamoperator<< (tm_ostream &out, iterator< T > it)
 Outputs the iterator object to an output stream.
 
template<class T , class U >
iterator< T > iterate (hashmap< T, U > h)
 Generates an iterator for a container of type hashmap<T, U>.
 
template<class T >
iterator< T > iterate (hashset< T > h)
 Generates an iterator for a container of type hashset<T>.
 

Variables

int iterator_count
 

Detailed Description

dynamic iterators

Author
Joris van der Hoeven
Date
1999

Definition in file iterator.hpp.

Function Documentation

◆ ABSTRACT_TEMPLATE_CODE()

ABSTRACT_TEMPLATE_CODE ( iterator ,
class ,
T  )

◆ operator<<()

template<class T >
tm_ostream & operator<< ( tm_ostream & out,
iterator< T > it )

Outputs the iterator object to an output stream.

Template Parameters
TThe type for the iterator's return value.
Parameters
outThe output stream.
itThe iterator object.
Returns
The output stream.

Definition at line 26 of file iterator.ipp.

27 {
28 bool flag= false;
29 out << "[ ";
30 while (it->busy ()) {
31 if (flag) out << ", ";
32 else flag= true;
33 out << it->next ();
34 }
35 return out << " ]";
36}
The list class represents a linked list.
Definition list.hpp:48

◆ iterate() [1/2]

template<class T , class U >
iterator< T > iterate ( hashmap< T, U > h)

Generates an iterator for a container of type hashmap<T, U>.

Template Parameters
TThe type of the elements in the container.
UThe type of the values in the hashmap.
Parameters
hThe hashmap container.
Returns
An iterator object for the hashmap container.

Definition at line 166 of file iterator.ipp.

166 {
168}

◆ iterate() [2/2]

template<class T >
iterator< T > iterate ( hashset< T > h)

Generates an iterator for a container of type hashset<T>.

Template Parameters
TThe type of the elements in the container.
Parameters
hThe hashset container.
Returns
An iterator object for the hashset container.

Definition at line 99 of file iterator.ipp.

99 {
101}

Variable Documentation

◆ iterator_count

int iterator_count
extern