GL Studio C++ Runtime API
VPFUtil::PointerArray< T > Class Template Reference

#include <vpf_util.h>

Public Types

enum  
 

Public Member Functions

 PointerArray (const unsigned int initialSize=DEFAULT_INITIAL_SIZE)
 
 ~PointerArray ()
 
bool InsertPointer (T *const p)
 
bool MovePointer (const unsigned int curIndex, const unsigned int newIndex)
 
unsigned int GetCount (void) const
 
T * GetPointer (const unsigned int index)
 
const T * GetPointer (const unsigned int index) const
 
bool IsValid (void) const
 

Protected Attributes

WarningBool _isValid
 
unsigned int _arraySize
 
unsigned int _arrayCount
 
T ** _pointers
 

Detailed Description

template<class T>
class disti::VPFUtil::PointerArray< T >

encapsulates a growable array of pointers

Member Enumeration Documentation

anonymous enum

default initial size of array

Constructor & Destructor Documentation

PointerArray ( const unsigned int  initialSize = DEFAULT_INITIAL_SIZE)
inline

Ctor

Parameters
initialSize[optional, defaults to DEFAULT_INITIAL_SIZE] initial size of array (>0)
~PointerArray ( )
inline

Dtor

Member Function Documentation

unsigned int GetCount ( void  ) const
inline

Get number of pointers in the array

Returns
number of pointers in the array
T* GetPointer ( const unsigned int  index)
inline

Get a pointer in the array

Parameters
indexzero based index into array
Returns
pointer at index else NULL
const T* GetPointer ( const unsigned int  index) const
inline

Get a const pointer in the array

Parameters
indexzero based index into array
Returns
pointer at index else NULL
bool InsertPointer ( T *const  p)
inline

Insert a pointer into the array at the end of the array

Parameters
ppointer to add (non NULL)
Returns
true on success else false
bool IsValid ( void  ) const
inline

Determine if the array is in a valid state

Returns
true if valid else false
bool MovePointer ( const unsigned int  curIndex,
const unsigned int  newIndex 
)
inline

Move a pointer from one index in the array to another index in the array. array elements are shifted down accordingly.

Parameters
curIndexcurrent index of pointer
newIndexnew desired index of pointer
Returns
true if success else false

Member Data Documentation

unsigned int _arrayCount
protected

number of elements in _pointers pointer array

unsigned int _arraySize
protected

length of _pointers pointer array

WarningBool _isValid
protected

true if array is valid else false

T** _pointers
protected

array of T pointers


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