#include <irrArray.h>
Inheritance diagram for array:

| array | ( | ) | [inline] |
Constructs a array and allocates an initial chunk of memory.
| start_count,: | Amount of elements to allocate. |
| ~array | ( | ) | [inline] |
Destructor. Frees allocated memory, if set_free_when_destroyed was not set to false by the user before.
| u32 allocated_size | ( | ) | const [inline] |
Returns amount memory allocated.
Performs a binary search for an element, returns -1 if not found. The array will be sorted before the binary search if it is not already sorted.
| element,: | Element to search for. | |
| left,: | First left index | |
| right,: | Last right index. |
| s32 binary_search | ( | const T & | element | ) | [inline] |
Performs a binary search for an element, returns -1 if not found. The array will be sorted before the binary search if it is not already sorted.
| element,: | Element to search for. |
| void clear | ( | ) | [inline] |
| const T* const_pointer | ( | ) | const [inline] |
Returns a const pointer to the array.
| bool empty | ( | ) | const [inline] |
Returns true if array is empty
Erases some elements from the array. may be slow, because all elements following after the erased element have to be copied.
| index,: | Index of the first element to be erased. | |
| count,: | Amount of elements to be erased. |
| void erase | ( | u32 | index | ) | [inline] |
Erases an element from the array. May be slow, because all elements following after the erased element have to be copied.
| index,: | Index of element to be erased. |
| T& getLast | ( | ) | [inline] |
| const T& getLast | ( | ) | const [inline] |
| void insert | ( | const T & | element, | |
| u32 | index = 0 | |||
| ) | [inline] |
Insert item into array at specified position. Please use this only if you know what you are doing (possible performance loss). The preferred method of adding elements should be push_back().
| element,: | Element to be inserted | |
| index,: | Where position to insert the new element. |
| s32 linear_reverse_search | ( | const T & | element | ) | const [inline] |
Finds an element in linear time, which is very slow. Use binary_search for faster finding. Only works if =operator is implemented.
| element,: | Element to search for. |
| s32 linear_search | ( | const T & | element | ) | const [inline] |
Finds an element in linear time, which is very slow. Use binary_search for faster finding. Only works if =operator is implemented.
| element,: | Element to search for. |
| void operator= | ( | const array< T > & | other | ) | [inline] |
| const T& operator[] | ( | u32 | index | ) | const [inline] |
| T& operator[] | ( | u32 | index | ) | [inline] |
| T* pointer | ( | ) | [inline] |
Returns a pointer to the array.
| void push_back | ( | const T & | element | ) | [inline] |
Adds an element at back of array. If the array is to small to add this new element, the array is made bigger.
| element,: | Element to add at the back of the array. |
| void push_front | ( | const T & | element | ) | [inline] |
Adds an element at the front of the array. If the array is to small to add this new element, the array is made bigger. Please note that this is slow, because the whole array needs to be copied for this.
| element,: | Element to add at the back of the array. |
| void reallocate | ( | u32 | new_size | ) | [inline] |
Reallocates the array, make it bigger or smaller.
| new_size,: | New size of array. |
| void set_free_when_destroyed | ( | bool | f | ) | [inline] |
Sets if the array should delete the memory it used.
| f,: | If true, the array frees the allocated memory in its destructor, otherwise not. The default is true. |
| void set_pointer | ( | T * | newPointer, | |
| u32 | size | |||
| ) | [inline] |
Sets pointer to new array, using this as new workspace.
| newPointer,: | Pointer to new array of elements. | |
| size,: | Size of the new array. |
| void set_sorted | ( | bool | _is_sorted | ) | [inline] |
| void set_used | ( | u32 | usedNow | ) | [inline] |
Sets the size of the array.
| usedNow,: | Amount of elements now used. |
| u32 size | ( | ) | const [inline] |
Returns size of used array.
| void sort | ( | ) | [inline] |
Sorts the array using heapsort. There is no additional memory waste and the algorithm performs (O) n log n in worst case.
1.5.1-p1