WoopsiArray< T > Class Template Reference
#include <woopsiarray.h>
List of all members.
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
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.
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.
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. |
Get the size of the array.
- Returns:
- The size of the array.
The documentation for this class was generated from the following file: