Sonic Flow libsf Reference Guide
SF_List ();
Create an empty list.
virtual ~SF_List ();
Destructor
void add (const void* content);
Add a new node to the end of the list. Argument "content" is the content (a pointer) to be placed to the added node.
void remove (const void* content);
Remove a node from the list. Argument "content" is the content of the node to be removed.
bool find (const void* content);
Find out if a certain node is on the list. Argument "content" is the content of the node to be looked for. Returns true if there is a node with the specified content.
SF_List::SF_List_Node* SF_List::search (const void* content)
Search for a certain node in the list and return the node data structure.
bool is_empty () const;
Returns true if the list is empty and otherwise false.
void* get_first (void*& key) const;
Return the content pointer on the first node on the list and reset the internal state of the list so that it can be traversed with calls to get_next (). If there are no nodes on the list, returns 0. The "key" argument is a reference to a pointer, which the caller must have defined. The "key" is used for re-entrant access to a SF_List.
void* get_next (void*& key) const;
Return the content pointer of the next node on the list. If there is no next, returns 0. The term "next node" is associated to the specified "key" argument, which has been initialized with a call to get_next ().
void sort (int (*comparison_function) (const void* a, const void* b));
Sort the list in ascending order according to the user supplied comparison function. The comparison function must return an integer less than, equal to, or greater than zero to indicate if the content "a" is to be considered less than, equal to, or greater than the content "b", respectively. Uses the insertion sort algorithm.
int count_nodes () const;
Count and return the number of nodes currently on the list.
Last modified: Thu Dec 10 14:10:40 1998
jarno.seppanen@cs.tut.fi
Audio Research Group