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

# XFuDynamicArray< T > Class Template Reference

Dynamic array template. More...

`#include <XFuDynamicArray.h>`

Inheritance diagram for XFuDynamicArray< T >:

[legend]
Collaboration diagram for XFuDynamicArray< T >:

[legend]
List of all members.

## Public Member Functions
UINT32 | getSizeIncrement () const
| Returns the size increment.
void | setSizeIncrement (const UINT32 aSizeIncrement)
| Sets the size increment.
UINT32 | size () const
| Returns the number of elements stored in the array.
UINT32 | maxSize () const
| Returns the size of the array.
INT | isEmpty () const
| Checks whether the array has any elements.
T | get (const UINT32 aPos) const
| Returns an element at the specified position in the array.
T | get () const
| Returns the last element from the array.
void | put (T aElement)
| Adds an element to the end of the array.
void | put (const UINT32 aPos, T aElement)
| Inserts an element to the array at the specified position.
T | removeIndex (const UINT32 aPos)
| Removes an element from the array and returns the removed element.
T | remove (T aElement)
| Removes an element from the array.
T | remove ()
| Removes the last element from the array and returns the removed element.
void | clear ()
| Clears the array, but does not free its internal storage.
| ~XFuDynamicArray ()
| Destructor.
## Static Public Member Functions
XFuDynamicArray * | create (const UINT32 aSize=XFUDYNAMICARRAY_DEFAULT_SIZE_INCREMENT)
| Static constructor.
## Protected Member Functions
void | setArraySize (const UINT32 aSize)
| Resizes the element array.
| XFuDynamicArray ()
| Protected constructor.
## Protected Attributes
UINT32 | mElementCount
| The number of elements in the array.
T * | mElements
| Array of elements stored by the dynamic array.
UINT32 | mSizeIncrement
| Size increment.
UINT32 | mArraySize
| The size of the element array.

## Detailed Description

### template<class T>
class XFuDynamicArray< T >

Dynamic array template.

Simple usage example to store UINT32's:

     // Create the array
     XFuDynamicArray<UINT32> *store = XFuDynamicArray<UINT32>::create();
     // put 3 values to the end of the array
     store->put(1);
     store->put(3);
     store->put(4);
     // Insert value in the second position of the array
     store->put(1, 2);
     // store now contains { 1, 2, 3, 4 }
     UINT32 value = store->get(3);
     // value is now 4
     delete store;

Definition at line 39 of file XFuDynamicArray.h.

## Constructor & Destructor Documentation

template<class T>
XFuDynamicArray< T >::XFuDynamicArray | ( |  | ) | `[protected]`

| Protected constructor. Definition at line 102 of file XFuDynamicArray.h. References XFuDynamicArray< T >::mArraySize, XFuDynamicArray< T >::mElementCount, and XFuDynamicArray< T >::mElements.

template<class T>
XFuDynamicArray< T >::~XFuDynamicArray | ( |  | ) |

| Destructor. Definition at line 247 of file XFuDynamicArray.h. References XFuDynamicArray< T >::mElements.

## Member Function Documentation

template<class T>
void XFuDynamicArray< T >::clear | ( |  | ) |

| Clears the array, but does not free its internal storage. Definition at line 227 of file XFuDynamicArray.h. References XFuDynamicArray< T >::mElementCount.

template<class T>
XFuDynamicArray< T > * XFuDynamicArray< T >::create | ( | const UINT32 | aSize = XFUDYNAMICARRAY_DEFAULT_SIZE_INCREMENT | ) | `[static]`

| Static constructor. Definition at line 234 of file XFuDynamicArray.h. References XFuDynamicArray< T >::mArraySize, XFuDynamicArray< T >::mElementCount, XFuDynamicArray< T >::mElements, XFuDynamicArray< T >::mSizeIncrement, and XFUDYNAMICARRAY_DEFAULT_SIZE_INCREMENT. Referenced by XFuInetNetwork::init(), XFuBluetoothNetwork::init(), and XFuBluetoothMultiNetwork::init().

template<class T>
T XFuDynamicArray< T >::get | ( |  | ) | const

| Returns the last element from the array. Definition at line 153 of file XFuDynamicArray.h. References XFuDynamicArray< T >::mElementCount, and XFuDynamicArray< T >::mElements.

template<class T>
T XFuDynamicArray< T >::get | ( | const UINT32 | aPos | ) | const

| Returns an element at the specified position in the array. Definition at line 144 of file XFuDynamicArray.h. References XFuDynamicArray< T >::mElementCount, and XFuDynamicArray< T >::mElements.

template<class T>
UINT32 XFuDynamicArray< T >::getSizeIncrement | ( |  | ) | const

| Returns the size increment. Definition at line 110 of file XFuDynamicArray.h. References XFuDynamicArray< T >::mSizeIncrement.

template<class T>
INT XFuDynamicArray< T >::isEmpty | ( |  | ) | const

| Checks whether the array has any elements. Definition at line 135 of file XFuDynamicArray.h. References XFuDynamicArray< T >::mElementCount.

template<class T>
UINT32 XFuDynamicArray< T >::maxSize | ( |  | ) | const

| Returns the size of the array. Definition at line 129 of file XFuDynamicArray.h. References XFuDynamicArray< T >::mArraySize.

template<class T>
void XFuDynamicArray< T >::put | ( | const UINT32 | aPos,
|  | T | aElement
| ) |

| Inserts an element to the array at the specified position. Definition at line 168 of file XFuDynamicArray.h. References XFuDynamicArray< T >::mArraySize, XFuDynamicArray< T >::mElementCount, XFuDynamicArray< T >::mElements, and XFuDynamicArray< T >::setArraySize().

template<class T>
void XFuDynamicArray< T >::put | ( | T | aElement | ) |

| Adds an element to the end of the array. Definition at line 162 of file XFuDynamicArray.h.

template<class T>
T XFuDynamicArray< T >::remove | ( |  | ) |

| Removes the last element from the array and returns the removed element. Definition at line 209 of file XFuDynamicArray.h. References XFuDynamicArray< T >::removeIndex().

template<class T>
T XFuDynamicArray< T >::remove | ( | T | aElement | ) |

| Removes an element from the array. Definition at line 215 of file XFuDynamicArray.h. References XFuDynamicArray< T >::mElementCount, XFuDynamicArray< T >::mElements, and XFuDynamicArray< T >::removeIndex().

template<class T>
T XFuDynamicArray< T >::removeIndex | ( | const UINT32 | aPos | ) |

| Removes an element from the array and returns the removed element. Definition at line 190 of file XFuDynamicArray.h. References XFuDynamicArray< T >::mElementCount, and XFuDynamicArray< T >::mElements. Referenced by XFuDynamicArray< T >::remove().

template<class T>
void XFuDynamicArray< T >::setArraySize | ( | const UINT32 | aSize | ) | `[protected]`

| Resizes the element array. Definition at line 95 of file XFuDynamicArray.h. References XFuDynamicArray< T >::mArraySize, and XFuDynamicArray< T >::mElements. Referenced by XFuDynamicArray< T >::put().

template<class T>
void XFuDynamicArray< T >::setSizeIncrement | ( | const UINT32 | aSizeIncrement | ) |

| Sets the size increment. Definition at line 117 of file XFuDynamicArray.h. References XFuDynamicArray< T >::mSizeIncrement.

template<class T>
UINT32 XFuDynamicArray< T >::size | ( |  | ) | const

| Returns the number of elements stored in the array. Definition at line 123 of file XFuDynamicArray.h. References XFuDynamicArray< T >::mElementCount.

## Member Data Documentation

template<class T>
UINT32 XFuDynamicArray< T >::mArraySize`[protected]`

| The size of the element array. Definition at line 51 of file XFuDynamicArray.h. Referenced by XFuDynamicArray< T >::create(), XFuDynamicArray< T >::maxSize(), XFuDynamicArray< T >::put(), XFuDynamicArray< T >::setArraySize(), and XFuDynamicArray< T >::XFuDynamicArray().

template<class T>
UINT32 XFuDynamicArray< T >::mElementCount`[protected]`

| The number of elements in the array. Definition at line 43 of file XFuDynamicArray.h. Referenced by XFuDynamicArray< T >::clear(), XFuDynamicArray< T >::create(), XFuDynamicArray< T >::get(), XFuDynamicArray< T >::isEmpty(), XFuDynamicArray< T >::put(), XFuDynamicArray< T >::remove(), XFuDynamicArray< T >::removeIndex(), XFuDynamicArray< T >::size(), and XFuDynamicArray< T >::XFuDynamicArray().

template<class T>
T* XFuDynamicArray< T >::mElements`[protected]`

| Array of elements stored by the dynamic array. Definition at line 45 of file XFuDynamicArray.h. Referenced by XFuDynamicArray< T >::create(), XFuDynamicArray< T >::get(), XFuDynamicArray< T >::put(), XFuDynamicArray< T >::remove(), XFuDynamicArray< T >::removeIndex(), XFuDynamicArray< T >::setArraySize(), XFuDynamicArray< T >::XFuDynamicArray(), and XFuDynamicArray< T >::~XFuDynamicArray().

template<class T>
UINT32 XFuDynamicArray< T >::mSizeIncrement`[protected]`

| Size increment. Definition at line 48 of file XFuDynamicArray.h. Referenced by XFuDynamicArray< T >::create(), XFuDynamicArray< T >::getSizeIncrement(), and XFuDynamicArray< T >::setSizeIncrement().

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

- XFuDynamicArray.h

|  | X-Forge Documentation Confidential Copyright © 2002-2003 Fathammer |  | Documentation generated with doxygen by Dimitri van Heesch