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

Go to the source code of this file.

Classes

class  hashset_iterator_rep< T >
 
class  hashmap_iterator_rep< T, U >
 

Macros

#define ITERATOR_CC
 

Functions

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

Macro Definition Documentation

◆ ITERATOR_CC

#define ITERATOR_CC

Definition at line 13 of file iterator.ipp.

Function Documentation

◆ 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 >
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}

◆ iterate() [2/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}