CrystalSpace

Public API Reference

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

csStaticArray Class Reference

Helper class for CS_DECLARE_STATIC_ARRAY. More...

#include <sarray.h>

List of all members.

Public Methods

 csStaticArray (int Size=0)
 constructor. More...

virtual ~csStaticArray ()
 destructor. More...

int GetSize () const
 Return the number of elements in the array. More...

void Clear (bool DeleteOld=true)
 Remove all elements from the array. More...

void Alloc (int s, bool DeleteOld=true)
 Allocate the given number of elements. More...

void ReAlloc (int s)
 Change the size of the array but copy the contents. More...


Protected Methods

void Copy (const csStaticArray *other, bool DeleteOld=true)
 Remove all elements and copy the contents from another array. More...

void Copy (void *NewData, int NewSize, bool DeleteOld=true)
 Remove all elements and copy the contents from another array. More...

void TakeOver (csStaticArray *other, bool DeleteOld=true)
 Remove all elements (and delete them if 'DeleteOld is true), then use the contents of another array. More...

void TakeOver (void *NewData, int NewSize, bool DeleteOld=true)
 Use the given array and size for this array. More...

virtual void * AllocateArray (int Size) const=0
 Allocate an array of the given number of elements. More...

virtual void DeleteArray (void *Array) const=0
 Delete an array of elements. More...

virtual void CopyArray (void *Dest, void *src, int Count) const=0
 Copy one array into another one. More...


Detailed Description

Helper class for CS_DECLARE_STATIC_ARRAY.

Definition at line 42 of file sarray.h.


Constructor & Destructor Documentation

csStaticArray::csStaticArray int    Size = 0
 

constructor.

virtual csStaticArray::~csStaticArray   [virtual]
 

destructor.


Member Function Documentation

void csStaticArray::Alloc int    s,
bool    DeleteOld = true
 

Allocate the given number of elements.

The old contents are removed, and if 'DeleteOld' is true they are also deleted.

virtual void* csStaticArray::AllocateArray int    Size const [protected, pure virtual]
 

Allocate an array of the given number of elements.

void csStaticArray::Clear bool    DeleteOld = true
 

Remove all elements from the array.

If 'DeleteOld' is true then the elements are also deleted.

Referenced by TakeOver.

void csStaticArray::Copy void *    NewData,
int    NewSize,
bool    DeleteOld = true
[protected]
 

Remove all elements and copy the contents from another array.

If 'DeleteOld' is true then the old contents are deleted.

void csStaticArray::Copy const csStaticArray *    other,
bool    DeleteOld = true
[protected]
 

Remove all elements and copy the contents from another array.

If 'DeleteOld' is true then the old contents are deleted.

virtual void csStaticArray::CopyArray void *    Dest,
void *    src,
int    Count
const [protected, pure virtual]
 

Copy one array into another one.

virtual void csStaticArray::DeleteArray void *    Array const [protected, pure virtual]
 

Delete an array of elements.

int csStaticArray::GetSize   const [inline]
 

Return the number of elements in the array.

Definition at line 133 of file sarray.h.

void csStaticArray::ReAlloc int    s
 

Change the size of the array but copy the contents.

void csStaticArray::TakeOver void *    NewData,
int    NewSize,
bool    DeleteOld = true
[inline, protected]
 

Use the given array and size for this array.

They are taken over, not copied!

Definition at line 143 of file sarray.h.

References Clear.

void csStaticArray::TakeOver csStaticArray *    other,
bool    DeleteOld = true
[inline, protected]
 

Remove all elements (and delete them if 'DeleteOld is true), then use the contents of another array.

The other array will lose control over its elements and be cleared to empty.

Definition at line 137 of file sarray.h.

References Map, and Size.


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