Make your own free website on

Contents Turbed: A Turbulent Behavior Development System News
In file list.hpp:

class List

Generic list

Public Methods

o List()
Default constructor creates an empty list
oint add(T*)
Add an element to the end of the list
oint insert(T*)
Insert an element in the current cursor position (before current).
ochar insertAt(int, T*)
Insert an element at the given position (before elem in that pos)
ochar insertOn(T&, T*)
Insert an element at the position of the given element (before it)
ochar remove()
Remove element at actual cursor pos.
ochar removeAt(int)
Remove element at the given pos.
ochar removeOn(T&)
Remove the given element (or one equal to him)
ochar replace(T*)
Replace the current element (cursor pos) with the given one
ochar replaceAt(T*, int)
Replace the element at the given pos.
ochar next_elem()
Move cursor to the next element.
ochar prev_elem()
Move cursor to the prev. element.
ochar set_currAt(int)
Set the cursor at the given pos.
ochar set_currOn(T&)
Set the cursor at the given element.
oT* info()
Get the pointer to the current element data.
oT* infoAt(int)
Get the pointer to the element data at the given pos.
oT* infoOn(T&)
Get the pointer to the given element data.
oint longlist()
Get the number of elements on the list.
oint pos_act()
Get the actual pos.
ovoid cleanList()
Erase al elements on the list.
ovirtual ~List()
Destroy the list and free all memory used.

Protected Fields

o* head
Pointer to the List's first element
o* tail
Pointer to the List's last element
o* current
Pointer to the List current element (list cursor)
oint cur_pos
Current cursor list position
oint max_elem
Actual Number of elemnts in the list at any time


Generic list. version 1.1 last updated 1995

the data type to store in the list has to have a copy constructor and redefined the operator = and == to work ok (better if the type is complex or used bizzare routines)!!!! i.e:

class T {
float info;
T& operator=(T& data) {; return *this; }
int operator==(T& data) { return (; }

This class has no child classes.
Daniel Barrero
See Also:

Alphabetic index HTML hierarchy of classes or Java

This software was originally written by Daniel Barrero at the IRIT's Equipe Synthèse d'Images

Generated by doc++