Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Related Pages

ListAgenda


Detailed Description

This module is an implementation of the agenda interface using a plain list as its the storage medium.

This is used by the module netsearch, but has been superseded by the more efficienct module treeagenda.

Data Structures

Functions


Function Documentation

Pointer laBest ListAgenda  a  ) 
 

returns the best entry (= first) from the agenda.

Parameters:
a the ListAgenda from which the best item has to be retrieved.
Returns:
the best item in a (or NULL if a is empty).The item remains in the agenda.
Definition at line 313 of file listagenda.c.

References listElement().

void laDelete ListAgenda  a  ) 
 

deletes the specified agenda.

The function deallocates all the items in a using *freeState(). Then it deallocates all the entries and the agenda itself.

Parameters:
a the ListAgenda that has to be deleted.
Definition at line 357 of file listagenda.c.

References listElement(), and listNext().

Boolean laInsert ListAgenda  a,
double  score,
Pointer  state
 

inserts a new entry into the agenda.

Parameters:
a the ListAgenda into which a new element has to be inserted.
score the state is sorted into the list according to the score.
state the item that is inserted into the ListAgenda a.
Returns:
FALSE if the agenda has been truncated and TRUE if we were able to insert the item without any unpleasant side effects. This is going to be reported only once.

If the insertion leads to an overflow, then the worst item from the list is removed. Note that the item to be removed may be the state itself. Definition at line 233 of file listagenda.c.

References listAppendElement(), listDelete(), listElement(), listNext(), listPrependElement(), and listSetNext().

Boolean laIsEmpty ListAgenda  a  ) 
 

checks if the specified ListAgenda is empty.

Parameters:
a the ListAgenda for which emptiness has to be checked.
Returns:
TRUE if agenda a is empty and FALSE otherwise.
Definition at line 191 of file listagenda.c.

Boolean laIsTruncated ListAgenda  a  ) 
 

checks for the truncation of the ListAgenda a.

Parameters:
a the ListAgenda on which the function laIsTruncated is performed.
Returns:
TRUE if the agenda is already truncated and FALSE otherwise.
Definition at line 202 of file listagenda.c.

void laIteratorDelete ListAgendaIterator  ai  ) 
 

deletes the iterator object.

The function deallocates the list cell that was used by the iterator.

Parameters:
ai the iterator object that has to be deleted.
Definition at line 422 of file listagenda.c.

ListAgendaIterator laIteratorNew ListAgenda  a  ) 
 

creates a new iterator object.

This is actually just a single new list cell that points to the first entry.

Parameters:
a the ListAgenda for which a new iterator has to be created.
Returns:
a new ListAgendaIterator that will return all items of a sorted by score.
Definition at line 380 of file listagenda.c.

References listElement(), and listPrependElement().

Pointer laIteratorNextElement ListAgendaIterator  ai  ) 
 

returns the next item in iterator object.

Parameters:
ai the iterator of the ListAgenda a.
Returns:
the best item in the underlying agenda that was not already returned by the iterator.
Definition at line 399 of file listagenda.c.

References listElement(), listNext(), listSetElement(), and listSetNext().

int laMaxSize ListAgenda  a  ) 
 

retrieves the size limit of the agenda.

Parameters:
a the ListAgenda for which the maximum size has to be determined.
Returns:
the max number of entries that can be held by the ListAgenda a.
Definition at line 169 of file listagenda.c.

int laMaxSizeSoFar ListAgenda  a  ) 
 

retrieves the largest attained size of the agenda.

Parameters:
a the ListAgenda for which the largest size has to be retrieved.
Returns:
the maximum size occupied by the agenda a so far.
Definition at line 180 of file listagenda.c.

ListAgenda laNew int  maxsize,
VoidFunction  f
 

creates a new ListAgenda.

Parameters:
maxsize the maximum capacity of the new ListAgenda that has to be created.
f the function that used for deallocating an element.
Returns:
a pointer to a new ListAgenda that can hold upto maxsize entries.
Definition at line 114 of file listagenda.c.

Pointer laRemoveBest ListAgenda  a  ) 
 

removes and returns best entry (= first) from the agenda.

Parameters:
a the ListAgenda from which the best item has to be retrieved.
Returns:
the best item in a.The corresponding entry is removed and deallocated.
It must not be called on an empty agenda.
Definition at line 331 of file listagenda.c.

References listElement(), and listNext().

Boolean laResetTruncated ListAgenda  a  ) 
 

reset the agenda truncation warning.

Parameters:
a the ListAgenda whose truncationWarning will be set to FALSE.
Returns:
the old value of the truncationWarning
Definition at line 213 of file listagenda.c.

Boolean laSetVerbosity ListAgenda  a,
Boolean  b
 

sets verbosity flag.

Parameters:
a the ListAgenda whose verbosity property is set
b a Boolean which we set the verbosity to
Returns:
the old verbosity state
Definition at line 134 of file listagenda.c.

int laSize ListAgenda  a  ) 
 

retrieves size of the agenda.

Parameters:
a the ListAgenda for which the size has to be retrieved.
Returns:
the current number of entries in the ListAgenda a.
Definition at line 158 of file listagenda.c.

Boolean laVerbosity ListAgenda  a  ) 
 

gets verbosity flag.

Parameters:
a the ListAgenda whose verbosity property is set
Returns:
the verbosity state
Definition at line 147 of file listagenda.c.


BLAH 0.95 (20 Oct 2004)