Logo Search packages:      
Sourcecode: yacas version File versions  Download package

CArrayGrower< T > Class Template Reference

#include <grower.h>

Inheritance diagram for CArrayGrower< T >:

CArrayGrowerBase CDeletingArrayGrower< T >

List of all members.

Detailed Description

template<class T>
class CArrayGrower< T >

template class useful for implementing a dynamic growing array for any arbitrary type of object. If using the array to maintain objects, please use pointers to the objects, and use the CDeletingArrayGrower to automatically delete the objects at destruction.

Definition at line 73 of file grower.h.

Public Types

typedef T ElementType
typedef T * ElementTypePtr

Public Member Functions

int Append (T aValue)
 Append an element to an array.
LispBoolean ArrayOwnedExternally ()
int BaseAppend (LispChar *aValue)
 CArrayGrower (int aGranularity=8)
void Clear ()
void CopyToExternalArray (T *&aArray, LispBoolean aPreAlloc)
 Copy the array to another array.
void Delete (int aIndex, int aCount=1)
 Delete element(s) from the array.
void GrowTo (int aNrItems)
void Insert (int aIndex, T &aObj, LispInt aCount=1)
 Insert object aObj, aCount times.
T & Item (const int aIndex) const
void Move (int aSrcIndex, int aTrgIndex)
void MoveBlock (int aSrcIndex, int aTrgIndex)
LispInt NrAllocated ()
 Return the number of allocated cells.
int NrItems () const
 Return the number of items currently in the array.
void operator delete (void *object)
void operator delete[] (void *object)
void * operator new (size_t size)
void * operator new[] (size_t size)
T & operator[] (const int aIndex) const
 Access to an element in the array.
void SetExternalArray (T *aArray, LispInt aNrItems)
void SetGranularity (LispInt aGranularity)
 Set the step size for growing the array.
void SetNrItems (int aNrItems)

Protected Member Functions

LispChar * BaseItem (int aIndex)

Protected Attributes

LispChar * iArray
LispBoolean iArrayOwnedExternally
LispInt iGranularity
LispInt iItemSize
LispInt iNrAllocated
LispInt iNrItems

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index