| GlsMap Toolkit 1.10.2

Public Types | Public Member Functions | Protected Attributes | List of all members
disti::VPFUtil::PointerArray< T > Class Template Reference

`#include <vpf_util.h>`

## Public Types
enum | { DEFAULT_INITIAL_SIZE = 16u }

## 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

template<class T >

anonymous enum

default initial size of array

## Constructor & Destructor Documentation

## ◆ PointerArray()

template<class T >

disti::VPFUtil::PointerArray< T >::PointerArray | ( | const unsigned int | initialSize = `DEFAULT_INITIAL_SIZE` | ) |
| inline

Ctor

Parameters

  initialSize | [optional, defaults to DEFAULT_INITIAL_SIZE] initial size of array (>0)

## ◆ ~PointerArray()

template<class T >

disti::VPFUtil::PointerArray< T >::~PointerArray | ( |  | ) |
| inline

Dtor

## Member Function Documentation

## ◆ GetCount()

template<class T >

unsigned int disti::VPFUtil::PointerArray< T >::GetCount | ( | void |  | ) | const
| inline

Get number of pointers in the array

Returns
  number of pointers in the array

## ◆ GetPointer() [1/2]

template<class T >

T * disti::VPFUtil::PointerArray< T >::GetPointer | ( | const unsigned int | index | ) |
| inline

Get a pointer in the array

Parameters

  index | zero based index into array

Returns
  pointer at index else NULL

## ◆ GetPointer() [2/2]

template<class T >

const T * disti::VPFUtil::PointerArray< T >::GetPointer | ( | const unsigned int | index | ) | const
| inline

Get a const pointer in the array

Parameters

  index | zero based index into array

Returns
  pointer at index else NULL

## ◆ InsertPointer()

template<class T >

bool disti::VPFUtil::PointerArray< T >::InsertPointer | ( | T *const | p | ) |
| inline

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

Parameters

  p | pointer to add (non NULL)

Returns
  true on success else false

## ◆ IsValid()

template<class T >

bool disti::VPFUtil::PointerArray< T >::IsValid | ( | void |  | ) | const
| inline

Determine if the array is in a valid state

Returns
  true if valid else false

## ◆ MovePointer()

template<class T >

bool disti::VPFUtil::PointerArray< T >::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

  curIndex | current index of pointer
  newIndex | new desired index of pointer

Returns
  true if success else false

## Member Data Documentation

## ◆ _arrayCount

template<class T >

unsigned int disti::VPFUtil::PointerArray< T >::_arrayCount
| protected

number of elements in _pointers pointer array

## ◆ _arraySize

template<class T >

unsigned int disti::VPFUtil::PointerArray< T >::_arraySize
| protected

length of _pointers pointer array

## ◆ _isValid

template<class T >

WarningBool disti::VPFUtil::PointerArray< T >::_isValid
| protected

true if array is valid else false

## ◆ _pointers

template<class T >

T** disti::VPFUtil::PointerArray< T >::_pointers
| protected

array of T pointers

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

- vpf_util.h