/* $Id: slist.h,v 1.3 1996/11/06 11:37:46 roitzsch Exp $ */

#ifndef SLIST_H
#define SLIST_H

#include <iostream>


template<class T> 

class SList
{
  public:

    int noOfElements;
    T* first; 
    T* last; 

    SList();

    void add    (T* elem);		// insert at end
    void insert (T* elem);		// insert at beginning
    int insertAfter (T* elem, T* target);
    int insertBefore(T* elem, T* target);

    T* search (T* target);		// search address of target
    T* inList (T* elem);		// search by equal fct

    void revert();			// revert list
    int  NoOfElements() const { return noOfElements; }
    int  MemSpace() const;

    void deleteAll();
    void print();
};
//-------------------------------------------------------------------------

#if INCLUDE_TEMPLATE_DEFS
#include "slist.c"
#endif
	
#endif


syntax highlighted by Code2HTML, v. 0.9.1