WvVectorBase Class Reference

#include <wvvector.h>

Inheritance diagram for WvVectorBase:

[legend]
List of all members.

Detailed Description

The untyped vector base type.

See also:
WvVector

Definition at line 20 of file wvvector.h.

Public Member Functions

int count () const
 Returns the number of elements actually stored in the vector.
bool isempty () const
 Returns true if the vector is empty.
int get_capacity () const
 The number of elements that could be stored without resizing.
void set_capacity (int newslots)
 Adjusts the capacity of the vector.
void compact ()
 Compacts the vector to minimize its footprint.

Protected Types

typedef int(* comparison_type_t )(const void *, const void *)

Protected Member Functions

 WvVectorBase (int slots=DEFAULTSIZE)
 Creates an empty vector.
 ~WvVectorBase ()
 Default WvVectorBase destructor.
void remove (int slot)
 Removes the element at the specified slot.
void insert (int slot, WvLink *elem)
 Inserts an element at the specified slot.
void prepend (WvLink *elem)
 Prepend an element onto the front of the vector.
void append (WvLink *elem)
 Appends an element onto the tail of the vector.
bool get_autofree (int slot)
 Gets autofree for the specified slot.
void set_autofree (int slot, bool autofree)
 Sets autofree for the specified slot.
void qsort (comparison_type_t comparator)

Static Protected Member Functions

static int wrapcomparator (const void *_a, const void *_b)

Protected Attributes

WvLink ** xseq
int xcount
int xslots

Static Protected Attributes

static const int DEFAULTSIZE = 4

Friends

class IterBase

Classes

class  IterBase


Member Function Documentation

void WvVectorBase::set_capacity int  newslots  ) 
 

Adjusts the capacity of the vector.

If the new capacity is greater than the old one, extends the array size without actually filling in any elements.

Definition at line 49 of file wvvector.cc.

References xcount, xseq, and xslots.

Referenced by append(), compact(), insert(), and WvVectorBase().


Member Data Documentation

const int WvVectorBase::DEFAULTSIZE = 4 [static, protected]
 

the minimum number of slots to allocate

Definition at line 26 of file wvvector.h.

WvLink** WvVectorBase::xseq [protected]
 

the controlled sequence

Definition at line 29 of file wvvector.h.

Referenced by append(), get_autofree(), insert(), WvVectorBase::IterBase::next(), WvVector< T >::operator[](), WvVectorBase::IterBase::prev(), qsort(), WvVector< T >::remove(), remove(), WvVectorBase::IterBase::rewind(), set_autofree(), set_capacity(), WvVectorBase::IterBase::unwind(), and ~WvVectorBase().

int WvVectorBase::xcount [protected]
 

the number of elements in the sequence

Definition at line 30 of file wvvector.h.

Referenced by append(), compact(), count(), get_autofree(), insert(), isempty(), WvVector< T >::last(), WvVectorBase::IterBase::next(), WvVector< T >::operator[](), WvVector< T >::qsort(), qsort(), remove(), WvVector< T >::remove_last(), WvVectorBase::IterBase::rewind(), set_autofree(), set_capacity(), WvVectorBase::IterBase::unwind(), and WvVector< T >::zap().

int WvVectorBase::xslots [protected]
 

the capacity of the array

Definition at line 31 of file wvvector.h.

Referenced by append(), get_capacity(), insert(), and set_capacity().


The documentation for this class was generated from the following files:
Generated on Thu May 25 21:51:22 2006 for WvStreams by  doxygen 1.4.6