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

MapIter Class Template Reference

Map iterator. More...

#include <mmap.h>

List of all members.

Public Methods

void first ()
void next ()
const keyclass & key () const
keyclass & key ()
const valueclass & value () const
valueclass & value ()
int exhausted () const


Detailed Description

template<class keyclass, class valueclass>
class MapIter< keyclass, valueclass >

Map iterator.

Usage:

for (MapIter<String,String> iter (myMap); !iter.exhausted(); iter.next())

printf("s=s
", (CONSTR) iter.key(), (CONSTR) iter.value());

, which prints the key-value-pairs of the map to stdout.

See mmap.h for additional macros forMap and forStringMap for somewhat easier iteration. For example:

forStringMap (myMap, iter) { printf("s", (CONSTR) iter.value()); }

, which prints the values in the map to stdout.

Definition at line 472 of file mmap.h.


Member Function Documentation

int exhausted   const [inline]
 

Returns 1 (true) if all the items in the mmap.have been iterated, 0 (false) otherwise.

Definition at line 505 of file mmap.h.

References GenHashIter::exhausted().

void first   [inline]
 

Points the iterator to the first item in the Map.

Definition at line 477 of file mmap.h.

References GenHashIter::first().

keyclass& key   [inline]
 

Returns a non-const reference to the key in the current position of the iterator.

Definition at line 490 of file mmap.h.

References GenHashIter::getkeyv().

const keyclass& key   const [inline]
 

Returns a const reference to the key in the current position of the iterator.

Definition at line 485 of file mmap.h.

References GenHashIter::getkey().

void next   [inline]
 

Moves the iterator to next item in the Map.

Definition at line 480 of file mmap.h.

References GenHashIter::next().

valueclass& value   [inline]
 

Returns a non-const reference to the value in the current position of the iterator.

Definition at line 500 of file mmap.h.

References GenHashIter::getvaluev().

const valueclass& value   const [inline]
 

Returns a const reference to the value in the current position of the iterator.

Definition at line 495 of file mmap.h.

References GenHashIter::getvalue().


The documentation for this class was generated from the following file:
Generated on Thu Feb 10 20:06:43 2005 for LibMagiC by doxygen1.2.18