// Copyright (c) 1994 James Clark // See the file COPYING for copying permission. #ifndef List_INCLUDED #define List_INCLUDED 1 #include "IList.h" #include "Link.h" #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif template class ListItem : public Link { public: ListItem(const T &v) : value(v) { } T value; }; template class ListIter; template class List { public: List() { } void append(const T &item) { list_.append(new ListItem(item)); } void insert(const T &item) { list_.insert(new ListItem(item)); } const T &head() const { return list_.head()->value; } void remove(const T &); T get(); int empty() const { return list_.empty(); } friend class ListIter; private: List(const List &); // undefined void operator=(const List &); // undefined IList > list_; }; #ifdef SP_NAMESPACE } #endif #endif /* not List_INCLUDED */ #ifdef SP_DEFINE_TEMPLATES #include "List.cxx" #endif