Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

WvListBase::IterBase Class Reference

#include <wvlinklist.h>

Inherited by WvList< T >::Iter.

Collaboration diagram for WvListBase::IterBase:

[legend]
List of all members.

Detailed Description

For internal use only.

The untyped base class of WvList<T>::Iter.

Putting common code in here allows us to prevent it from being replicated by each template instantiation of WvList<T>.

Definition at line 72 of file wvlinklist.h.

Public Member Functions

 IterBase (const WvListBase &l)
 Binds the iterator to the specified list.

void rewind ()
 Rewinds the iterator to make it point to an imaginary element preceeding the first element of the list.

WvLinknext ()
 Moves the iterator along the list to point to the next element.

WvLinkcur () const
 Returns a pointer to the WvLink at the iterator's current location.

void * vptr () const
 Returns a void pointer to the object at the iterator's current location.

WvLinkfind (const void *data)
 Rewinds the iterator and repositions it over the element that matches the specified value.


Public Attributes

const WvListBaselist
WvLinklink
WvLinkprev


Constructor & Destructor Documentation

WvListBase::IterBase::IterBase const WvListBase l  )  [inline]
 

Binds the iterator to the specified list.

"l" is the list

Definition at line 82 of file wvlinklist.h.


Member Function Documentation

WvLink* WvListBase::IterBase::cur  )  const [inline]
 

Returns a pointer to the WvLink at the iterator's current location.

Returns: the current WvLink pointer, or null if there were no more elements remaining in the traversal sequence

Definition at line 110 of file wvlinklist.h.

Referenced by WvHashTableBase::prevlink().

WvLink * WvListBase::IterBase::find const void *  data  ) 
 

Rewinds the iterator and repositions it over the element that matches the specified value.

Uses pointer equality (object identity) as the criteria for finding the matching element.

It is not possible to use find(const void*) to locate multiple matching elements unless the list is altered between invocations since it always starts searching from the head of the list rather than from the current location.

Returns: the current WvLink pointer, or null if no such element was found

Definition at line 58 of file wvlinklist.cc.

References WvLink::data, next(), and rewind().

WvLink* WvListBase::IterBase::next  )  [inline]
 

Moves the iterator along the list to point to the next element.

If the iterator had just been rewound, it now points to the first element of the list.

Returns: the current WvLink pointer, or null if there were no more elements remaining in the traversal sequence

Definition at line 102 of file wvlinklist.h.

References WvLink::next.

Referenced by find(), and WvHashTableBase::prevlink().

void WvListBase::IterBase::rewind  )  [inline]
 

Rewinds the iterator to make it point to an imaginary element preceeding the first element of the list.

Definition at line 89 of file wvlinklist.h.

Referenced by find(), and WvHashTableBase::prevlink().

void* WvListBase::IterBase::vptr  )  const [inline]
 

Returns a void pointer to the object at the iterator's current location.

You should almost never need this. Use ptr() instead.

Definition at line 117 of file wvlinklist.h.

References WvLink::data.


Member Data Documentation

WvLink* WvListBase::IterBase::link
 

Definition at line 76 of file wvlinklist.h.

const WvListBase* WvListBase::IterBase::list
 

Definition at line 75 of file wvlinklist.h.

WvLink * WvListBase::IterBase::prev
 

Definition at line 76 of file wvlinklist.h.


The documentation for this class was generated from the following files:
Generated on Sat Mar 13 14:58:22 2004 for WvStreams by doxygen 1.3.6-20040222