# WoopsiArray< T > Class Template Reference

`#include <woopsiarray.h>`

List of all members.

## Public Member Functions
| WoopsiArray ()
| ~WoopsiArray ()
const s32 | size () const
void | push_back (const T &value)
void | insert (const s32 index, const T &value)
void | pop_back ()
void | erase (const s32 index)
T & | at (const s32 index) const
bool | empty () const
void | clear ()
T & | operator[] (const s32 index) const

## Detailed Description

### template<class T>
class WoopsiArray< T >

Class providing a dynamic array; that is, an array that will automatically grow to accommodate new data. It provides a fast way to randomly access a list of data. Essentially, it provides the most important functionality of the STL vector class without any of the overhead of including an STL class.

If the data to be stored will store a lot of data that will predominantly be read sequentially, consider using the LinkedList class instead. Resizing the list is an expensive operation that will occur frequently when filling the array with large amounts of data. Adding new data to the linked list is very inexpensive.

## Constructor & Destructor Documentation

template<class T >

WoopsiArray< T >::WoopsiArray | ( |  | ) | `[inline]`

Constructor.

template<class T >

WoopsiArray< T >::~WoopsiArray | ( |  | ) | `[inline]`

Destructor.

## Member Function Documentation

template<class T >

T & WoopsiArray< T >::at | ( | const s32 | index | ) | const`[inline]`

Get a value at the specified location. Does not perform bounds checking.

Parameters:

  | index | The index of the desired value.

Returns:
  The value at the specified index.

template<class T >

void WoopsiArray< T >::clear | ( |  | ) | `[inline]`

Remove all data.

template<class T >

bool WoopsiArray< T >::empty | ( |  | ) | const`[inline]`

Check if the array has any data.

Returns:
  True if the array is empty.

template<class T >

void WoopsiArray< T >::erase | ( | const s32 | index | ) | `[inline]`

Erase a single value at the specified index

template<class T>

void WoopsiArray< T >::insert | ( | const s32 | index,
|  | const T & | value |
| ) |  |  | `[inline]`

Insert a value into the array.

Parameters:

  | index | The index to insert into.
  | value | The value to insert.

template<class T >

T & WoopsiArray< T >::operator[] | ( | const s32 | index | ) | const`[inline]`

Overload the [] operator to allow array-style access.

Parameters:

  | index | The index to retrieve.

Returns:
  The value at the specified index.

template<class T >

void WoopsiArray< T >::pop_back | ( |  | ) | `[inline]`

Remove the last element from the array.

template<class T>

void WoopsiArray< T >::push_back | ( | const T & | value | ) | `[inline]`

Add a value to the end of the array.

Parameters:

  | value | The value to add to the array.

template<class T >

const s32 WoopsiArray< T >::size | ( |  | ) | const`[inline]`

Get the size of the array.

Returns:
  The size of the array.

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

- C:/Documents and Settings/Administrator/Desktop/woopsi-src-0.39/Woopsi/woopsi/woopsiarray.h

All Classes Functions Variables Enumerations Enumerator