Generate a typed sparse managed object array.
More...
#include <object.h>
Inherits SparseObjects.
|
T & | at (unsigned offset) |
|
T * | get (unsigned offset) |
| Get typed member of array. More...
|
|
const T * | operator() (unsigned offset) const |
|
void | operator() (unsigned offset, T value) |
|
T & | operator[] (unsigned offset) |
| Array operation to access member object. More...
|
|
| sarray (unsigned size) |
| Generate a sparse typed array of specified size. More...
|
|
template<class T>
class ucommon::sarray< T >
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.
- Author
- David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org
Definition at line 264 of file object.h.
§ sarray()
Generate a sparse typed array of specified size.
- Parameters
-
Definition at line 274 of file object.h.
§ get()
Get typed member of array.
If the object does not exist, it is created.
- Parameters
-
offset | in array for object. |
- Returns
- pointer to typed object.
Definition at line 282 of file object.h.
§ operator[]()
Array operation to access member object.
If the object does not exist, it is created.
- Parameters
-
offset | in array for object. |
- Returns
- pointer to typed object.
Definition at line 292 of file object.h.
The documentation for this class was generated from the following file: