Main Page   Class Hierarchy   Compound List   File List   Compound Members  

csBasicVector Class Reference

This is a lightweight base class for containers. More...

#include <csvector.h>

Inheritance diagram for csBasicVector:

csVector csConstraintVector csHintManager csObjVector csPolygonArray csRestrictedAccessVector csRGBVector csSegmentArray csSkin csStrVector csWSTexVector List of all members.

Public Methods

 csBasicVector (int ilimit=0, int ithreshold=0)
 Initialize object to hold initially 'ilimit' elements, and increase storage by 'ithreshold' each time the upper bound is exceeded.

virtual ~csBasicVector ()
 Destroy the container but none of the objects to which it points.

csSome& operator[] (int n)
 Get a reference to n-th element.

csSome& operator[] (int n) const
 Same but doesn't call SetLength () in the event n is out of bounds.

csSome& Get (int n) const
 Same but in function form.

void SetLength (int n)
 Set vector length to n.

int Length () const
 Query vector length.

int Limit () const
 Query vector limit.

bool Delete (int n)
 Delete element number 'n' from vector (attention: non virtual!).

bool Delete (csSome Item)
 Delete the given element from vector (attention: non virtual!).

void Exchange (int n1, int n2)
 Exchange two elements in array.

int Find (csSome which) const
 Find a element in array and return its index (or -1 if not found).

int Push (csSome what)
 Push a element on 'top' of vector.

int PushSmart (csSome what)
 Push an elemen on top of the vector if it is not yet contained.

csSome Pop ()
 Pop a element from vector 'top'.

csSome Top () const
 Return the top element but don't remove it.

bool Insert (int n, csSome Item)
 Insert element 'Item' before element 'n'.

Protected Attributes

int count
int limit
int threshold
csSome* root

Detailed Description

This is a lightweight base class for containers.

It contains no virtual functions and, by default, does not preallocate any memory. It contains all the basic functionality of the derived csVector class, but none of the gimmicks.

The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000