#include <array.h>
Public Methods | |
| array_c () | |
| c'tor | |
| virtual | ~array_c () |
| d'tor | |
| long | get_free () |
| Get first free slot. | |
| long | add (T *ptr) |
| Add an entry to the array. | |
| void | remove (long i) |
| Remove an entry from the array. | |
| void | remove_ptr (T *ptr, bool all=true) |
| Remove an entry from the array. | |
| void | set (long i, T *ptr) |
| Set array entry. | |
| T * | get (long i) |
| Get array entry. | |
| long | find (T *ptr) |
| Find array entry. | |
| long | get_count () |
| Get entry count. | |
| void | clear () |
| Remove all elements. | |
Protected Attributes | |
| T ** | data |
| the array itself | |
| long | count |
| number of entries in array | |
Definition at line 53 of file array.h.
|
|
Finds a free slot using get_free() and sets the entry at that index to ptr. The insertion index is returned. Definition at line 99 of file array.h. Referenced by octree_c::add_complete_node_to_array(), and octree_c::add_node_to_array(). |
|
|
Removes all entries from the array. Definition at line 236 of file array.h. Referenced by octree_c::get_visible(). |
|
|
Returns the index of the first found entry ptr. If no entry is found INVALID_INDEX is returned. |
|
|
Returns the entry with the index i. If i is larger than the number of entries or negative NULL is returned. Definition at line 190 of file array.h. Referenced by brush_c::get_brush_face(). |
|
|
Returns the number of entries (including empty ones). |
|
|
Returns the first unused index in this array. If the array is full the entry count is returned. Definition at line 80 of file array.h. Referenced by array_c< brushface_c >::add(). |
|
|
Sets the entry with index i to NULL. Thereby removing it from the array. The object is just removed from the array. It is not deleted. |
|
||||||||||||
|
If all is true all occurences of ptr in the array are removed. Otherwise the first found will be removed and other entries are left untouched. |
|
||||||||||||
|
Sets the array entry with index i to ptr. If i is larger than the number of entries, the array will be expanded to fit. Previous contents of the array stays untouched. All newly created entries are set to NULL. i may not be negative. Definition at line 157 of file array.h. Referenced by array_c< brushface_c >::add(). |
1.2.18