CrystalSpace

Public API Reference

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

csPDelArray Class Template Reference

An array of pointers. More...

#include <parray.h>

Inheritance diagram for csPDelArray:

csArray< T *, csPDelArrayElementHandler< T * > > List of all members.

Public Methods

 csPDelArray (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...

T * GetAndClear (int n)
 Get and clear the element 'n' from vector. More...

T * Extract (int n)
 Extract element number 'n' from vector. More...

T * Pop ()
 Pop an element from tail end of array. More...

void SetLength (int n, T const &what)
 Variant of SetLength() which copies the pointed-to object instead of the actual pointer. More...

void SetLength (int n, T *const &w)
 Call csArray<T*>::SetLength(n, w). More...

void SetLength (int n)
 Call csArray<T*>::SetLength(n). More...


Detailed Description

template<class T>
class csPDelArray< T >

An array of pointers.

No ref counting is done on the elements in this array. Use csRefArray if you want ref counting to happen. This array will delete elements (using 'delete') as needed. This array properly initializes new elements in the array to 0 (the NULL pointer).

Definition at line 53 of file parray.h.


Constructor & Destructor Documentation

template<class T>
csPDelArray< T >::csPDelArray int    ilimit = 0,
int    ithreshold = 0
[inline]
 

Initialize object to hold initially 'ilimit' elements, and increase storage by 'ithreshold' each time the upper bound is exceeded.

Definition at line 66 of file parray.h.


Member Function Documentation

template<class T>
T* csPDelArray< T >::Extract int    n [inline]
 

Extract element number 'n' from vector.

The element is deleted from the array and returned. You are responsible for deleting the pointer later.

Definition at line 88 of file parray.h.

template<class T>
T* csPDelArray< T >::GetAndClear int    n [inline]
 

Get and clear the element 'n' from vector.

This spot in the array will be set to 0. You are responsible for deleting the returned pointer later.

Definition at line 76 of file parray.h.

Referenced by csPDelArray< csPluginOption >::Extract, and csPDelArray< csPluginOption >::Pop.

template<class T>
T* csPDelArray< T >::Pop   [inline]
 

Pop an element from tail end of array.

Reimplemented from csArray< T *, csPDelArrayElementHandler< T * > >.

Definition at line 96 of file parray.h.

Referenced by csObjectPool::Alloc.

template<class T>
void csPDelArray< T >::SetLength int    n [inline]
 

Call csArray<T*>::SetLength(n).

Reimplemented from csArray< T *, csPDelArrayElementHandler< T * > >.

Definition at line 127 of file parray.h.

template<class T>
void csPDelArray< T >::SetLength int    n,
T *const &    w
[inline]
 

Call csArray<T*>::SetLength(n, w).

Reimplemented from csArray< T *, csPDelArrayElementHandler< T * > >.

Definition at line 121 of file parray.h.

template<class T>
void csPDelArray< T >::SetLength int    n,
T const &    what
[inline]
 

Variant of SetLength() which copies the pointed-to object instead of the actual pointer.

Definition at line 106 of file parray.h.


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