template<class t>
class casacore::List< t >
Doubly linked list.
Intended use:
Public interface
Review Status
- Reviewed By:
- UNKNOWN
- Date Reviewed:
- before2004/08/25
Synopsis
This class is a container which by itself has little functionality because the iteration functionality is contained in the iterator classes, ListIter and ConstListIterr. These iterator classes allow traversal, insertion into list, and removal from the list.
This group of classes, List and iterators, was designed to allow multiple iterators to manipulate a list at the same time. However, if only one iterator is required the simple example below shows how a simple list can be created and used without complication. The more complete example below demonstrates all of the functionality of the List classes.
Example
#include <casacore/casa/Containers/List.h>
#include <casacore/casa/Containers/ListIO.h>
main() {
ListIter<int> list(
new List<int>(),
True);
list.addRight(12);
list.addRight(2);
list.addRight(89);
list++;
list.addRight(10);
list++;
list.addRight(8);
list--;
list.pos(0);
list.pos(5);
list.pos(4);
list.step(3);
list.step();
list.step(-4);
list.removeRight();
cout << list << endl;
return 0;
}
The output from this example looks like:
len=4 pos=4 89 10 8 2
Definition at line 186 of file List.h.