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

WvListBase Class Reference

#include <wvlinklist.h>

Inherited by WvList< T >, WvList< CallbackInfo >, and WvList< UniGenMount >.

Collaboration diagram for WvListBase:

[legend]
List of all members.

Detailed Description

For internal use only.

The untyped base class of WvList<T>.

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

Definition at line 21 of file wvlinklist.h.

Public Member Functions

 WvListBase ()
 Creates an empty linked list.

size_t count () const
 Returns the number of elements in the list.

void reverse ()
 Reverses the order of elements in the list.

bool isempty () const
 Quickly determines if the list is empty.


Public Attributes

WvLink head
WvLinktail

Protected Member Functions

WvListBaseoperator= (const WvListBase &l)


Constructor & Destructor Documentation

WvListBase::WvListBase  )  [inline]
 

Creates an empty linked list.

Definition at line 31 of file wvlinklist.h.

References head, and tail.


Member Function Documentation

size_t WvListBase::count  )  const
 

Returns the number of elements in the list.

This function causes a full traversal of the list which may be overly inefficient depending on how and when it is used.

Returns: the number of elements

Definition at line 24 of file wvlinklist.cc.

References head, and WvLink::next.

Referenced by _wv_serialize().

bool WvListBase::isempty  )  const [inline]
 

Quickly determines if the list is empty.

This is much faster than checking count() == 0.

Returns: true if empty

Definition at line 61 of file wvlinklist.h.

References head, and WvLink::next.

Referenced by WvList< UniGenMount >::first().

WvListBase& WvListBase::operator= const WvListBase l  )  [protected]
 

void WvListBase::reverse  ) 
 

Reverses the order of elements in the list.

This function traverses the list and rearranges the pointers and updates the pointers to head & tail appropriately.

It does nothing for lists of count<2

Definition at line 35 of file wvlinklist.cc.

References head, WvLink::next, and tail.


Member Data Documentation

WvLink WvListBase::head
 

Definition at line 28 of file wvlinklist.h.

Referenced by count(), isempty(), reverse(), WvHashTableBase::IterBase::rewind(), and WvListBase().

WvLink * WvListBase::tail
 

Definition at line 28 of file wvlinklist.h.

Referenced by reverse(), and WvListBase().


The documentation for this class was generated from the following files:
Generated on Sat Feb 21 21:06:32 2004 for WvStreams by doxygen 1.3.5