#include <lists32.h>
Public Types | |
typedef T ** | iterator |
typedef T *const * | const_iterator |
typedef T * | value_type |
typedef uint | size_type |
Public Member Functions | |
StablePointerArray (const StablePointerArray &other) | |
StablePointerArray (StablePointerArray &&other) | |
void | operator= (const StablePointerArray &other) |
void | operator= (StablePointerArray &&other) |
T *const & | operator[] (size_type index) const |
T *& | operator[] (size_type index) |
void | add (T *item) |
iterator | begin () |
const_iterator | begin () const |
void | clear () |
iterator | end () |
const_iterator | end () const |
void | erase (T *item) |
void | erase (iterator &it) |
void | erase_at (size_type index) |
size_type | pack () |
size_type | max_size () const |
size_type | size () const |
StablePointerArray holds pointers in a fixed-size array that maintains position of erased items until pack
is called. It is used by RectList and ScreenItemList. StablePointerArray takes ownership of all pointers that are passed to it and deletes them when calling erase
or when destroying the StablePointerArray.
StablePointerArray used to be used for DrawList, until it was discovered that an LSL7 room with many screen items can overflow the fixed array. StablePointerDynamicArray was created below to handle DrawList, while StablePointerArray keeps the performance advantages of fixed arrays on the stack when rendering frames.
|
inline |
Adds a new pointer to the array.
|
inline |
Erases the object pointed to by the given iterator.
|
inline |
Erases the object pointed to by the given iterator.
|
inline |
Erases the object pointed to at the given index.
|
inline |
Removes freed pointers from the pointer list.
|
inline |
The maximum number of elements the container is able to hold.
|
inline |
The number of populated slots in the array. The size of the array will only go down once pack
is called.