ucommon
7.0.0
About: GNU uCommon C++ is a portable and optimized class framework for writing C++ applications that need to use threads and support concurrent synchronization, and that use sockets, XML parsing, object serialization, thread-optimized string and data structure classes, etc..
![]() ![]() |
Generate a typed sparse managed object array. More...
#include <object.h>
Public Member Functions | |
sarray (unsigned size) | |
Generate a sparse typed array of specified size. More... | |
T * | get (unsigned offset) |
Get typed member of array. More... | |
T & | operator[] (unsigned offset) |
Array operation to access member object. More... | |
T & | at (unsigned offset) |
const T * | operator() (unsigned offset) const |
void | operator() (unsigned offset, T value) |
![]() | |
unsigned | count (void) |
Get count of array elements. More... | |
Private Member Functions | |
__DELETE_DEFAULTS (sarray) | |
__LOCAL ObjectProtocol * | create (void) __FINAL |
Object factory for creating members of the spare array when they are initially requested. More... | |
Additional Inherited Members | |
![]() | |
virtual ObjectProtocol * | create (void)=0 |
Object factory for creating members of the spare array when they are initially requested. More... | |
void | purge (void) |
Purge the array by deleting all created objects. More... | |
virtual ObjectProtocol * | invalid (void) const |
ObjectProtocol * | get (unsigned offset) |
Get (reference) an object at a specified offset in the array. More... | |
SparseObjects (unsigned size) | |
Create a sparse array of known size. More... | |
virtual | ~SparseObjects () |
Destroy sparse array and delete all generated objects. More... | |
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 |
|
private |
|
inline |
Definition at line 296 of file object.h.
References ucommon::SparseObjects::get().
Referenced by ucommon::sarray< T >::operator()().
|
inlineprivatevirtual |
Object factory for creating members of the spare array when they are initially requested.
Implements ucommon::SparseObjects.
|
inline |
Get typed member of array.
If the object does not exist, it is created.
offset | in array for object. |
Definition at line 282 of file object.h.
References ucommon::SparseObjects::get().
Referenced by ucommon::sarray< T >::operator()(), and ucommon::sarray< T >::operator[]().
|
inline |
Definition at line 300 of file object.h.
References ucommon::sarray< T >::get().
|
inline |
Definition at line 304 of file object.h.
References ucommon::sarray< T >::at().
|
inline |
Array operation to access member object.
If the object does not exist, it is created.
offset | in array for object. |
Definition at line 292 of file object.h.
References ucommon::sarray< T >::get().