Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

UniConfGen::ListIter Class Reference

#include <uniconfgen.h>

Inheritance diagram for UniConfGen::ListIter:

[legend]
List of all members.

Detailed Description

An iterator that iterates through a constant list of keys.

This is handy if you know the list of keys is relatively short, and you don't want to write your own iterator and/or you know your own object state might change during iteration, so you would have to pregenerate the list of keys anyway.

The creator of the iter is responsible for filling the 'keys' and 'values' lists. If the 'values' list runs out of values before 'keys', the remaining values will be retrieved from the given generator instead.


Public Member Functions

 ListIter (IUniConfGen *_gen)
virtual void rewind ()
 Rewinds the iterator.
virtual bool next ()
 Seeks to the next element in the sequence.
virtual UniConfKey key () const
 Returns the current key.
virtual WvString value () const
 Returns the value of the current key.

Public Attributes

IUniConfGengen
WvList< WvStringkeys
WvList< WvStringvalues
WvList< WvString >::Iter ki
WvList< WvString >::Iter vi


Member Function Documentation

void UniConfGen::ListIter::rewind  )  [virtual]
 

Rewinds the iterator.

Must be called prior to the first invocation of next().

Implements UniConfGen::Iter.

bool UniConfGen::ListIter::next  )  [virtual]
 

Seeks to the next element in the sequence.

Returns true if that element exists. Must be called prior to the first invocation of key().

Implements UniConfGen::Iter.

WvString UniConfGen::ListIter::value  )  const [virtual]
 

Returns the value of the current key.

You could just do a get(), but maybe your generator has a more efficient way.

Implements UniConfGen::Iter.


The documentation for this class was generated from the following files:
Generated on Sun Apr 3 14:48:17 2005 for WvStreams by  doxygen 1.4.2