Simpatico
v1.10
|
An array of objects that are accessible by one or more linked List objects.
A ListArray is an allocatable array of data objects that also provides access to some or all of its via one or more associated List objects. Each element of the array may be part of at most one List.
Definition at line 30 of file ListArray.h.
#include <ListArray.h>
Public Member Functions | |
ListArray () | |
Constructor. More... | |
virtual | ~ListArray () |
Destructor. More... | |
void | allocate (int capacity, int nList) |
Allocate arrays of Node and List objects. More... | |
int | nList () const |
Get the number of associated linked lists. More... | |
int | capacity () const |
Return allocated size of underlying array of nodes. More... | |
Data & | operator[] (int i) |
Return data for node element i. More... | |
const Data & | operator[] (int i) const |
Return const refereence to Data in Node element number i. More... | |
List< Data > & | list (int i) |
Return a reference to a specific List. More... | |
const List< Data > & | list (int i) const |
Return a const reference to a specific List. More... | |
Node< Data > & | node (int i) |
Return reference to node number i. More... | |
bool | isValid () const |
Return true if the ListAray is valid, or throw an exception. More... | |
Util::ListArray< Data >::ListArray | ( | ) |
Constructor.
Definition at line 148 of file ListArray.h.
|
virtual |
Destructor.
Delete dynamically allocated arrays of Node and List objects.
Definition at line 161 of file ListArray.h.
void Util::ListArray< Data >::allocate | ( | int | capacity, |
int | nList | ||
) |
Allocate arrays of Node and List objects.
capacity | size of array Node<Data> objects |
nList | size of array of List<Data> linked list objects |
Definition at line 178 of file ListArray.h.
References Util::ListArray< Data >::capacity(), and Util::ListArray< Data >::nList().
|
inline |
Get the number of associated linked lists.
Definition at line 201 of file ListArray.h.
Referenced by Util::ListArray< Data >::allocate().
|
inline |
Return allocated size of underlying array of nodes.
Definition at line 67 of file ListArray.h.
Referenced by Util::ListArray< Data >::allocate().
|
inline |
Return data for node element i.
i | array index |
Definition at line 76 of file ListArray.h.
|
inline |
Return const refereence to Data in Node element number i.
i | array index |
Definition at line 90 of file ListArray.h.
References Util::ListArray< Data >::isValid(), Util::ListArray< Data >::list(), and Util::ListArray< Data >::node().
List< Data > & Util::ListArray< Data >::list | ( | int | i | ) |
Return a reference to a specific List.
i | array index |
Definition at line 211 of file ListArray.h.
Referenced by Util::ListArray< Data >::operator[]().
const List< Data > & Util::ListArray< Data >::list | ( | int | i | ) | const |
Return a const reference to a specific List.
i | array index |
Definition at line 227 of file ListArray.h.
Node< Data > & Util::ListArray< Data >::node | ( | int | i | ) |
Return reference to node number i.
i | array index |
Definition at line 243 of file ListArray.h.
Referenced by Util::ListArray< Data >::operator[]().
bool Util::ListArray< Data >::isValid | ( | ) | const |
Return true if the ListAray is valid, or throw an exception.
Definition at line 256 of file ListArray.h.
References UTIL_THROW.
Referenced by Util::ListArray< Data >::operator[]().