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

#ifndef DLIST_H
#define DLIST_H

#include <iostream.h>

template<class T>

class DList
{
  public:

    int noOfElements;
    T* first;
    T* last;

    DList();

    void remove(T* elem);
    void add   (T* elem);		// insert at end
    void insert(T* elem);		// insert at beginning
    void substitute(T* elem, T* elem1, T* elem2);  // substit. elem by elem1 and 2 
    void deleteAll();

    T* inList(T* elem);

    int NoOfElements() const { return noOfElements; };
    int MemSpace() const;

//    friend ostream& operator<< (ostream& os, DList<T>& list);
};
//-------------------------------------------------------------------------

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

#endif
