ucc::sarray< T > Class Template Reference

Generate a typed sparse managed object array. More...

#include <object.h>

Inheritance diagram for ucc::sarray< T >:

Inheritance graph
[legend]
Collaboration diagram for ucc::sarray< T >:

Collaboration graph
[legend]

Public Member Functions

 sarray (unsigned size)
 Generate a sparse typed array of specified size.
T * get (unsigned offset)
 Get typed member of array.
T * operator[] (unsigned offset)
 Array operation to access member object.

Detailed Description

template<class T>
class ucc::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@gnutelephony.org>

Definition at line 329 of file object.h.


Constructor & Destructor Documentation

template<class T >
ucc::sarray< T >::sarray ( unsigned  size  )  [inline]

Generate a sparse typed array of specified size.

Parameters:
size of array to create.

Definition at line 336 of file object.h.


Member Function Documentation

template<class T >
T* ucc::sarray< T >::get ( unsigned  offset  )  [inline]

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.

Reimplemented from ucc::sparse_array.

Definition at line 344 of file object.h.

template<class T >
T* ucc::sarray< T >::operator[] ( unsigned  offset  )  [inline]

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 353 of file object.h.


The documentation for this class was generated from the following file:

Generated on Tue Jul 28 21:46:07 2009 for UCommon by  doxygen 1.5.9