UCommon
|
Generate a typed sparse managed object array. More...
#include <object.h>
Public Member Functions | |
T * | get (unsigned offset) |
Get typed member of array. | |
T & | operator[] (unsigned offset) |
Array operation to access member object. | |
sarray (unsigned size) | |
Generate a sparse typed array of specified size. |
Generate a typed sparse managed object array.
Members in the array are created when they are first referenced. The types for objects that are generated by sarray must have Object as a base class. Managed sparse arrays differ from standard arrays in that the member elements are not allocated from the heap when the array is created, but rather as they are needed.
ucommon::sarray::sarray | ( | unsigned | size | ) | [inline] |
T* ucommon::sarray::get | ( | unsigned | offset | ) | [inline] |
Get typed member of array.
If the object does not exist, it is created.
offset | in array for object. |
Reimplemented from ucommon::sparse_array.
T& ucommon::sarray::operator[] | ( | unsigned | offset | ) | [inline] |