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. | |
![]() | |
unsigned | count (void) |
Get count of array elements. | |
virtual | ~sparse_array () |
Destroy sparse array and delete all generated objects. |
Additional Inherited Members | |
![]() | |
virtual ObjectProtocol * | create (void)=0 |
Object factory for creating members of the spare array when they are initially requested. | |
void | purge (void) |
Purge the array by deleting all created objects. | |
sparse_array (unsigned size) | |
Create a sparse array of known 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.
|
inline |
|
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.
|
inline |