|
| GAList (const T &t) |
|
| GAList (const GAList< T > &orig) |
|
GAList< T > & | operator= (const GAList< T > &orig) |
|
GAList< T > * | clone (unsigned int i=0) const |
| Make a copy of a list and return the pointer to the new list. More...
|
|
void | copy (const GAList< T > &orig) |
| Make a complete copy of the list and return a pointer to the new list. More...
|
|
int | destroy () |
| Remove the current node from the list and free the memory it was using. More...
|
|
int | swap (unsigned int a, unsigned int b) |
| Swap two nodes in the list. More...
|
|
T * | remove () |
| Remove the current node from the list. More...
|
|
int | insert (GAList< T > *t, GAListBASE::Location where=GAListBASE::AFTER) |
| Inserts the contents of list in to the current list and removes it from the original list. More...
|
|
int | insert (const T &t, GAListBASE::Location where=GAListBASE::AFTER) |
| Insert the object into the list at the specified place relative to the current location of the embedded iterator. More...
|
|
T * | head () |
|
T * | tail () |
|
T * | current () |
|
T * | next () |
|
T * | prev () |
|
T * | warp (unsigned int i) |
|
T * | warp (const GAListIter< T > &i) |
|
T * | operator[] (unsigned int i) |
|
| GAListBASE (GANodeBASE *n) |
|
int | size () const |
|
template<class T>
class GAList< T >
Container for nodes that have a list structure.
The base list object is responsible for maintaining the list heirarchy. This object is responsible for doing the memory management (allocating and de-allocating the nodes in the list). We insulate the user entirely from nodes - when you use a list, you don't get nodes back, you get the contents of nodes (ie the user doesn't have to think about the list parts of a node, they can simply assume that their data is organized into a list structure). We include an iterator in this object so that you can navigate through the list. You can create another iterator and assign it to your list so you can have multiple iterators. All of the actions take place relative to the current location of the embedded iterator. None of the iterators change the state of the list. Be careful so that you don't end up with an iterator dangling with a pointer to a part of a list that no longer exists (I would need some kind of reference counting and/or message passing to take care of this at a lower level, and I'm not ready to implement that at this point). For now we allocate nodes on the fly. Eventually I would like to do some better memory management (arrays perhaps?) so we don't have to do so much alloc and dealloc and recursion. We depend on the template-ized GAListIter routine, thus the declaration.
current, head, tail, next, prev, warp These iterator methods are defined as access to the embedded iterator of the list. Use these methods to move the insertion point and to traverse the list. You can also create other iterators for this list, but they won't affect the contents.
- Template Parameters
-