CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

csBasicVector Class Reference

#include <csvector.h>

Inheritance diagram for csBasicVector:

csVector csConstraintVector csHintManager csRGBVector 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. More...

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

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

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

void *& Get (int n) const
 Same but in function form. More...

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

int Length () const
 Query vector length. More...

int Limit () const
 Query vector limit. More...

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

bool DeleteChunk (int n, int size)
 Delete a chunk of size at the position 'n' (yeah, non virtual too). More...

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

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

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

int Push (void *what)
 Push a element on 'top' of vector. More...

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

void * Pop ()
 Pop a element from vector 'top'. More...

void * Top () const
 Return the top element but don't remove it. More...

bool Insert (int n, void *Item)
 Insert element 'Item' before element 'n'. More...

bool InsertChunk (int n, int size, void **Item)
 Insert a chunk of size at the position 'n'. More...


Detailed Description

Deprecated:
Use csArray, csGrowingArray, csRefArray or csPArray instead.
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.

Definition at line 41 of file csvector.h.


Constructor & Destructor Documentation

csBasicVector::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::~csBasicVector   [virtual]
 

Destroy the container but none of the objects to which it points.


Member Function Documentation

bool csBasicVector::Delete void *    Item [inline]
 

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

Definition at line 187 of file csvector.h.

References Delete, and Find.

bool csBasicVector::Delete int    n
 

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

Referenced by Delete.

bool csBasicVector::DeleteChunk int    n,
int    size
 

Delete a chunk of size at the position 'n' (yeah, non virtual too).

void csBasicVector::Exchange int    n1,
int    n2
[inline]
 

Exchange two elements in array.

Definition at line 222 of file csvector.h.

int csBasicVector::Find void *    which const
 

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

Referenced by csVector::Delete, Delete, PushSmart, and csTreeNode::RemoveChild.

void *& csBasicVector::Get int    n const [inline]
 

Same but in function form.

Reimplemented in csStrVector.

Definition at line 170 of file csvector.h.

Referenced by csTreeNode::BSF, csTreeNode::DSF, csWSTexVector::Get, csStrVector::Get, csSkin::Get, csConstraintVector::Get, csSparseGrid::GetAt, csAnimationTemplate::GetLength, and csGrid::GetRootView.

bool csBasicVector::Insert int    n,
void *    Item
 

Insert element 'Item' before element 'n'.

bool csBasicVector::InsertChunk int    n,
int    size,
void **    Item
 

Insert a chunk of size at the position 'n'.

int csBasicVector::Length   const [inline]
 

Query vector length.

Definition at line 182 of file csvector.h.

Referenced by csTreeNode::BSF, csTreeNode::DSF, and csTreeNode::IsLeaf.

int csBasicVector::Limit   const [inline]
 

Query vector limit.

Definition at line 177 of file csvector.h.

void *& csBasicVector::operator[] int    n const [inline]
 

Same but doesn't call SetLength () in the event n is out of bounds.

Definition at line 163 of file csvector.h.

void *& csBasicVector::operator[] int    n [inline]
 

Get a reference to n-th element.

Definition at line 155 of file csvector.h.

References SetLength.

void * csBasicVector::Pop   [inline]
 

Pop a element from vector 'top'.

Definition at line 207 of file csvector.h.

References SetLength.

int csBasicVector::Push void *    what [inline]
 

Push a element on 'top' of vector.

Definition at line 194 of file csvector.h.

References SetLength.

Referenced by csTreeNode::AddChild, csAnimationTemplate::AddFrame, csTreeNode::BSF, csTreeNode::csTreeNode, and PushSmart.

int csBasicVector::PushSmart void *    what [inline]
 

Push an elemen on top of the vector if it is not yet contained.

Definition at line 201 of file csvector.h.

References Find, and Push.

void csBasicVector::SetLength int    n
 

Set vector length to n.

Referenced by operator[], Pop, and Push.

void * csBasicVector::Top   const [inline]
 

Return the top element but don't remove it.

Definition at line 217 of file csvector.h.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.14